Skip to content

Commit

Permalink
Merge remote-tracking branch 'blusunrize/1.20.4' into fix/breaktags
Browse files Browse the repository at this point in the history
  • Loading branch information
voidsong-dragonfly committed Jun 22, 2024
2 parents 6f22495 + 7f5b1ed commit 6026172
Show file tree
Hide file tree
Showing 28 changed files with 350 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,33 @@ protected void registerStatesAndModels()
));

{
ModelFile noneModel = createMetalLadder("metal_ladder", null, null);
ModelFile noneModel = createMetalLadder("metal_ladder", null, null, null);
ModelFile aluModel = createMetalLadder(
"metal_ladder_alu",
rl("block/metal_decoration/aluminum_scaffolding_open"),
rl("block/metal_decoration/aluminum_scaffolding"));
rl("block/metal_decoration/aluminum_scaffolding"),
null);
ModelFile aluModelOpen = createMetalLadder(
"metal_ladder_alu_open",
rl("block/metal_decoration/aluminum_scaffolding_open_u"),
rl("block/metal_decoration/aluminum_scaffolding"),
rl("block/metal_decoration/aluminum_scaffolding_open_sides"));
ModelFile steelModel = createMetalLadder(
"metal_ladder_steel",
rl("block/metal_decoration/steel_scaffolding_open"),
rl("block/metal_decoration/steel_scaffolding"));
rl("block/metal_decoration/steel_scaffolding"),
null);
ModelFile steelModelOpen = createMetalLadder(
"metal_ladder_steel_open",
rl("block/metal_decoration/steel_scaffolding_open_u"),
rl("block/metal_decoration/steel_scaffolding"),
rl("block/metal_decoration/steel_scaffolding_open_sides"));
BlockEntry<MetalLadderBlock> steel = MetalDecoration.METAL_LADDER.get(CoverType.STEEL);
BlockEntry<MetalLadderBlock> alu = MetalDecoration.METAL_LADDER.get(CoverType.ALU);
BlockEntry<MetalLadderBlock> none = MetalDecoration.METAL_LADDER.get(CoverType.NONE);
createDirectionalBlock(none, IEProperties.FACING_HORIZONTAL, noneModel);
createDirectionalBlock(alu, IEProperties.FACING_HORIZONTAL, aluModel);
createDirectionalBlock(steel, IEProperties.FACING_HORIZONTAL, steelModel);
createLadderBlock(alu, aluModel, aluModelOpen);
createLadderBlock(steel, steelModel, steelModelOpen);
itemModel(alu, aluModel);
itemModel(steel, steelModel);
}
Expand Down Expand Up @@ -660,17 +672,23 @@ private void createPump()
));
}

public ModelFile createMetalLadder(String name, @Nullable ResourceLocation bottomTop, @Nullable ResourceLocation sides)
public ModelFile createMetalLadder(String name, @Nullable ResourceLocation bottomTop, @Nullable ResourceLocation sides, @Nullable ResourceLocation front)
{
Map<String, ResourceLocation> textures = new HashMap<>();
ResourceLocation parent;
if(bottomTop!=null)
{
Preconditions.checkNotNull(sides);
parent = new ResourceLocation(ImmersiveEngineering.MODID, "block/ie_scaffoldladder");
textures.put("top", bottomTop);
textures.put("bottom", bottomTop);
textures.put("side", sides);
if(front!=null)
{
parent = new ResourceLocation(ImmersiveEngineering.MODID, "block/ie_scaffoldladder_open");
textures.put("front", front);
}
else
parent = new ResourceLocation(ImmersiveEngineering.MODID, "block/ie_scaffoldladder");
}
else
parent = new ResourceLocation(ImmersiveEngineering.MODID, "block/ie_ladder");
Expand All @@ -691,6 +709,22 @@ private void createDirectionalBlock(Supplier<? extends Block> b, Property<Direct
.setModels(new ConfiguredModel(model, 0, getAngle(d, 180), true));
}

private void createLadderBlock(Supplier<? extends Block> b, ModelFile model, ModelFile modelOpen)
{
VariantBlockStateBuilder builder = getVariantBuilder(b.get());
for(Direction d : DirectionUtils.BY_HORIZONTAL_INDEX)
{
builder.partialState()
.with(IEProperties.FACING_HORIZONTAL, d)
.with(MetalLadderBlock.OPEN, false)
.setModels(new ConfiguredModel(model, 0, getAngle(d, 180), true));
builder.partialState()
.with(IEProperties.FACING_HORIZONTAL, d)
.with(MetalLadderBlock.OPEN, true)
.setModels(new ConfiguredModel(modelOpen, 0, getAngle(d, 180), false));
}
}

private void createWallmount(Supplier<? extends Block> b, ResourceLocation texture)
{
VariantBlockStateBuilder stateBuilder = getVariantBuilder(b.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ protected void addTags(Provider p_256380_)
tag(IETags.recyclingIgnoredComponents)
// Ignore bricks for outputting
.addTag(Tags.Items.INGOTS_BRICK)
.addTag(Tags.Items.INGOTS_NETHER_BRICK)
// Prevent tools used during crafting to be recycled as components
.add(Tools.HAMMER.get())
.add(Tools.SCREWDRIVER.get())
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6026172

Please sign in to comment.