Skip to content

Commit 7ae2dd7

Browse files
committed
post merge fixes
1 parent db2f0be commit 7ae2dd7

File tree

6 files changed

+10
-46
lines changed

6 files changed

+10
-46
lines changed

common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerGenerator.java

-20
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,4 @@ protected int getXRotation(BlockState state) {
3030
protected int getYRotation(BlockState state) {
3131
return 0;
3232
}
33-
34-
//fixme abstract
35-
@Override
36-
public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov, BlockState state) {
37-
Style style = state.getValue(BoilerBlock.STYLE);
38-
Direction.Axis axis = state.getValue(BoilerBlock.HORIZONTAL_AXIS);
39-
boolean raised = state.getValue(BoilerBlock.RAISED);
40-
41-
// I know it's barbaric to have the rotation be separate models instead of in blockstate,
42-
// but when I do it in blockstate there's horrible shading issues for the z rotation
43-
String colorName = color == null ? "netherite" : color.name().toLowerCase(Locale.ROOT);
44-
return prov.models().withExistingParent(ctx.getName() + "_" + style.getSerializedName() + "_" + axis.getName() + (raised ? "_raised" : ""), prov.modLoc("block/palettes/boiler/boiler"))
45-
.customLoader(CustomObjModelBuilder::begin)
46-
.flipV(true)
47-
.modelLocation(prov.modLoc("models/block/palettes/boiler/boiler_"+axis.getName()+(raised ? "_raised" : "")+".obj"))
48-
.end()
49-
.texture("front", prov.modLoc("block/palettes/" + colorName + "/" + style.getTexture()))
50-
.texture("sides", prov.modLoc("block/palettes/" + colorName + "/" + (wrapping != null ? wrapping.prefix("wrapped_boiler_side") : "boiler_side")))
51-
.texture("particle", prov.modLoc("block/palettes/" + colorName + "/riveted_pillar_top"));
52-
}
5333
}

common/src/main/java/com/railwayteam/railways/registry/CRBlocks.java

-16
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,6 @@ private static BlockEntry<SmokeStackBlock> makeSmokeStack(String variant, SmokeS
585585
.initialProperties(SharedProperties::softMetal)
586586
.properties(p -> p.sound(SoundType.COPPER))
587587
.transform(BuilderTransformers.headstock())
588-
// fixme
589-
// .blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
590-
// .forAllStatesExcept(state -> ConfiguredModel.builder()
591-
// .modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(false, state.getValue(HeadstockBlock.UPSIDE_DOWN))))
592-
// .rotationY(((int) state.getValue(HeadstockBlock.FACING).toYRot() + 180) % 360)
593-
// .build(), HeadstockBlock.WATERLOGGED
594-
// )
595-
// )
596588
.transform(axeOrPickaxe())
597589
.transform(BuilderTransformers.variantBuffer())
598590
.lang("Headstock")
@@ -610,14 +602,6 @@ private static BlockEntry<SmokeStackBlock> makeSmokeStack(String variant, SmokeS
610602
.initialProperties(SharedProperties::softMetal)
611603
.properties(p -> p.sound(SoundType.COPPER))
612604
.transform(axeOrPickaxe())
613-
//fixme
614-
// .blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
615-
// .forAllStatesExcept(state -> ConfiguredModel.builder()
616-
// .modelFile(p.models().getExistingFile(state.getValue(CopycatHeadstockBlock.STYLE).getModel(true, state.getValue(CopycatHeadstockBlock.UPSIDE_DOWN))))
617-
// .rotationY(((int) state.getValue(CopycatHeadstockBlock.FACING).toYRot() + 180) % 360)
618-
// .build(), CopycatHeadstockBlock.WATERLOGGED
619-
// )
620-
// )
621605
.transform(BuilderTransformers.copycatHeadstock())
622606
.lang("Copycat Headstock")
623607
/*.item()

fabric/src/main/java/com/railwayteam/railways/base/data/fabric/BuilderTransformersImpl.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.railwayteam.railways.content.semaphore.SemaphoreBlock;
2525
import com.railwayteam.railways.content.smokestack.block.AbstractSmokeStackBlock;
2626
import com.railwayteam.railways.content.smokestack.block.DieselSmokeStackBlock;
27-
import com.railwayteam.railways.content.smokestack.block.OilburnerSmokeStackBlock;
2827
import com.railwayteam.railways.content.smokestack.block.SmokeStackBlock;
2928
import com.railwayteam.railways.content.switches.TrackSwitchBlock;
3029
import com.railwayteam.railways.registry.CRBlocks;
@@ -320,7 +319,7 @@ public static <B extends LinkPinBlock, P> NonNullUnaryOperator<BlockBuilder<B, P
320319
public static <B extends HeadstockBlock, P> NonNullUnaryOperator<BlockBuilder<B, P>> headstock() {
321320
return b -> b.blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
322321
.forAllStatesExcept(state -> ConfiguredModel.builder()
323-
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(false)))
322+
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(false, state.getValue(HeadstockBlock.UPSIDE_DOWN))))
324323
.rotationY(((int) state.getValue(HeadstockBlock.FACING).toYRot() + 180) % 360)
325324
.build(), HeadstockBlock.WATERLOGGED
326325
)
@@ -336,7 +335,7 @@ public static <B extends CopycatHeadstockBlock, P> NonNullUnaryOperator<BlockBui
336335
return b -> b
337336
.blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
338337
.forAllStatesExcept(state -> ConfiguredModel.builder()
339-
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(true)))
338+
.modelFile(p.models().getExistingFile(state.getValue(CopycatHeadstockBlock.STYLE).getModel(true, state.getValue(CopycatHeadstockBlock.UPSIDE_DOWN))))
340339
.rotationY(((int) state.getValue(HeadstockBlock.FACING).toYRot() + 180) % 360)
341340
.build(), HeadstockBlock.WATERLOGGED
342341
)

fabric/src/main/java/com/railwayteam/railways/content/palettes/boiler/fabric/BoilerGeneratorImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ protected BoilerGeneratorImpl(@Nullable DyeColor color, CRPalettes.@Nullable Wra
2424
public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov, BlockState state) {
2525
BoilerBlock.Style style = state.getValue(BoilerBlock.STYLE);
2626
Direction.Axis axis = state.getValue(BoilerBlock.HORIZONTAL_AXIS);
27+
boolean raised = state.getValue(BoilerBlock.RAISED);
2728

2829
// I know it's barbaric to have the rotation be separate models instead of in blockstate,
2930
// but when I do it in blockstate there's horrible shading issues for the z rotation
3031
String colorName = color == null ? "netherite" : color.name().toLowerCase(Locale.ROOT);
31-
return prov.models().withExistingParent(ctx.getName() + "_" + style.getSerializedName() + "_" + axis.getName(), prov.modLoc("block/palettes/boiler/boiler"))
32+
return prov.models().withExistingParent(ctx.getName() + "_" + style.getSerializedName() + "_" + axis.getName() + (raised ? "_raised" : ""), prov.modLoc("block/palettes/boiler/boiler"))
3233
.customLoader(ObjModelBuilder::begin)
3334
.flipV(true)
34-
.modelLocation(prov.modLoc("models/block/palettes/boiler/boiler_"+axis.getName()+".obj"))
35+
.modelLocation(prov.modLoc("models/block/palettes/boiler/boiler_"+axis.getName()+(raised ? "_raised" : "")+".obj"))
3536
.end()
3637
.texture("front", prov.modLoc("block/palettes/" + colorName + "/" + style.getTexture()))
3738
.texture("sides", prov.modLoc("block/palettes/" + colorName + "/" + (wrapping != null ? wrapping.prefix("wrapped_boiler_side") : "boiler_side")))

forge/src/main/java/com/railwayteam/railways/base/data/forge/BuilderTransformersImpl.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.railwayteam.railways.content.semaphore.SemaphoreBlock;
2525
import com.railwayteam.railways.content.smokestack.block.AbstractSmokeStackBlock;
2626
import com.railwayteam.railways.content.smokestack.block.DieselSmokeStackBlock;
27-
import com.railwayteam.railways.content.smokestack.block.OilburnerSmokeStackBlock;
2827
import com.railwayteam.railways.content.smokestack.block.SmokeStackBlock;
2928
import com.railwayteam.railways.content.switches.TrackSwitchBlock;
3029
import com.railwayteam.railways.registry.CRBlocks;
@@ -319,7 +318,7 @@ public static <B extends LinkPinBlock, P> NonNullUnaryOperator<BlockBuilder<B, P
319318
public static <B extends HeadstockBlock, P> NonNullUnaryOperator<BlockBuilder<B, P>> headstock() {
320319
return b -> b.blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
321320
.forAllStatesExcept(state -> ConfiguredModel.builder()
322-
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(false)))
321+
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(false, state.getValue(HeadstockBlock.UPSIDE_DOWN))))
323322
.rotationY(((int) state.getValue(HeadstockBlock.FACING).toYRot() + 180) % 360)
324323
.build(), HeadstockBlock.WATERLOGGED
325324
)
@@ -336,7 +335,7 @@ public static <B extends CopycatHeadstockBlock, P> NonNullUnaryOperator<BlockBui
336335
return b -> b
337336
.blockstate((c, p) -> p.getVariantBuilder(c.getEntry())
338337
.forAllStatesExcept(state -> ConfiguredModel.builder()
339-
.modelFile(p.models().getExistingFile(state.getValue(HeadstockBlock.STYLE).getModel(true)))
338+
.modelFile(p.models().getExistingFile(state.getValue(CopycatHeadstockBlock.STYLE).getModel(true, state.getValue(CopycatHeadstockBlock.UPSIDE_DOWN))))
340339
.rotationY(((int) state.getValue(HeadstockBlock.FACING).toYRot() + 180) % 360)
341340
.build(), HeadstockBlock.WATERLOGGED
342341
)

forge/src/main/java/com/railwayteam/railways/content/palettes/boiler/forge/BoilerGeneratorImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ protected BoilerGeneratorImpl(@Nullable DyeColor color, CRPalettes.@Nullable Wra
2525
public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov, BlockState state) {
2626
BoilerBlock.Style style = state.getValue(BoilerBlock.STYLE);
2727
Direction.Axis axis = state.getValue(BoilerBlock.HORIZONTAL_AXIS);
28+
boolean raised = state.getValue(BoilerBlock.RAISED);
2829

2930
// I know it's barbaric to have the rotation be separate models instead of in blockstate,
3031
// but when I do it in blockstate there's horrible shading issues for the z rotation
3132
String colorName = color == null ? "netherite" : color.name().toLowerCase(Locale.ROOT);
32-
return prov.models().withExistingParent(ctx.getName() + "_" + style.getSerializedName() + "_" + axis.getName(), prov.modLoc("block/palettes/boiler/boiler"))
33+
return prov.models().withExistingParent(ctx.getName() + "_" + style.getSerializedName() + "_" + axis.getName() + (raised ? "_raised" : ""), prov.modLoc("block/palettes/boiler/boiler"))
3334
.customLoader(ObjModelBuilder::begin)
3435
.flipV(true)
35-
.modelLocation(prov.modLoc("models/block/palettes/boiler/boiler_"+axis.getName()+".obj"))
36+
.modelLocation(prov.modLoc("models/block/palettes/boiler/boiler_"+axis.getName()+(raised ? "_raised" : "")+".obj"))
3637
.end()
3738
.texture("front", prov.modLoc("block/palettes/" + colorName + "/" + style.getTexture()))
3839
.texture("sides", prov.modLoc("block/palettes/" + colorName + "/" + (wrapping != null ? wrapping.prefix("wrapped_boiler_side") : "boiler_side")))

0 commit comments

Comments
 (0)