Fan and other tweaks

- Fix zero-length air current causing NPE
- Fix vertical air currents sometimes checking blocks for handlers
multiple times
- Fix blocking handlers at end of air flow not receiving processing
- Use Registrate namespace instead of "create" in fluid-related methods
in CreateRegistrate
- Flatten block property configuration in AllBlocks
- Make crushing wheel controller material solid
- Add note to Create.REGISTRATE
This commit is contained in:
PepperCode1 2023-09-19 14:57:03 -07:00
parent 4cda09e0e7
commit 9d74a40654
7 changed files with 110 additions and 147 deletions

View file

@ -361,8 +361,7 @@ public class AllBlocks {
public static final BlockEntry<CogWheelBlock> COGWHEEL = REGISTRATE.block("cogwheel", CogWheelBlock::small) public static final BlockEntry<CogWheelBlock> COGWHEEL = REGISTRATE.block("cogwheel", CogWheelBlock::small)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.sound(SoundType.WOOD)) .properties(p -> p.sound(SoundType.WOOD).color(MaterialColor.DIRT))
.properties(p -> p.color(MaterialColor.DIRT))
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.axisBlockProvider(false)) .blockstate(BlockStateGen.axisBlockProvider(false))
@ -374,8 +373,7 @@ public class AllBlocks {
public static final BlockEntry<CogWheelBlock> LARGE_COGWHEEL = public static final BlockEntry<CogWheelBlock> LARGE_COGWHEEL =
REGISTRATE.block("large_cogwheel", CogWheelBlock::large) REGISTRATE.block("large_cogwheel", CogWheelBlock::large)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.sound(SoundType.WOOD)) .properties(p -> p.sound(SoundType.WOOD).color(MaterialColor.DIRT))
.properties(p -> p.color(MaterialColor.DIRT))
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.blockstate(BlockStateGen.axisBlockProvider(false)) .blockstate(BlockStateGen.axisBlockProvider(false))
@ -441,8 +439,7 @@ public class AllBlocks {
public static final BlockEntry<GearboxBlock> GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new) public static final BlockEntry<GearboxBlock> GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(p -> p.color(MaterialColor.PODZOL))
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCTBehaviour(AllSpriteShifts.ANDESITE_CASING))) .onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCTBehaviour(AllSpriteShifts.ANDESITE_CASING)))
@ -455,8 +452,7 @@ public class AllBlocks {
public static final BlockEntry<ClutchBlock> CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new) public static final BlockEntry<ClutchBlock> CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(p -> p.color(MaterialColor.PODZOL))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
@ -467,8 +463,7 @@ public class AllBlocks {
public static final BlockEntry<GearshiftBlock> GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new) public static final BlockEntry<GearshiftBlock> GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(p -> p.color(MaterialColor.PODZOL))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
@ -480,8 +475,7 @@ public class AllBlocks {
public static final BlockEntry<ChainDriveBlock> ENCASED_CHAIN_DRIVE = public static final BlockEntry<ChainDriveBlock> ENCASED_CHAIN_DRIVE =
REGISTRATE.block("encased_chain_drive", ChainDriveBlock::new) REGISTRATE.block("encased_chain_drive", ChainDriveBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(p -> p.color(MaterialColor.PODZOL))
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> new ChainDriveGenerator((state, suffix) -> p.models() .blockstate((c, p) -> new ChainDriveGenerator((state, suffix) -> p.models()
@ -493,8 +487,7 @@ public class AllBlocks {
public static final BlockEntry<ChainGearshiftBlock> ADJUSTABLE_CHAIN_GEARSHIFT = public static final BlockEntry<ChainGearshiftBlock> ADJUSTABLE_CHAIN_GEARSHIFT =
REGISTRATE.block("adjustable_chain_gearshift", ChainGearshiftBlock::new) REGISTRATE.block("adjustable_chain_gearshift", ChainGearshiftBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.NETHER))
.properties(p -> p.color(MaterialColor.NETHER))
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> new ChainDriveGenerator((state, suffix) -> { .blockstate((c, p) -> new ChainDriveGenerator((state, suffix) -> {
@ -512,10 +505,10 @@ public class AllBlocks {
public static final BlockEntry<BeltBlock> BELT = REGISTRATE.block("belt", BeltBlock::new) public static final BlockEntry<BeltBlock> BELT = REGISTRATE.block("belt", BeltBlock::new)
.initialProperties(SharedProperties.BELT_MATERIAL, MaterialColor.COLOR_GRAY) .initialProperties(SharedProperties.BELT_MATERIAL, MaterialColor.COLOR_GRAY)
.properties(p -> p.sound(SoundType.WOOL)
.strength(0.8F)
.color(MaterialColor.COLOR_GRAY))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.properties(p -> p.sound(SoundType.WOOL))
.properties(p -> p.strength(0.8F))
.properties(p -> p.color(MaterialColor.COLOR_GRAY))
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(new BeltGenerator()::generate) .blockstate(new BeltGenerator()::generate)
.transform(BlockStressDefaults.setImpact(0)) .transform(BlockStressDefaults.setImpact(0))
@ -539,8 +532,7 @@ public class AllBlocks {
public static final BlockEntry<WaterWheelBlock> WATER_WHEEL = REGISTRATE.block("water_wheel", WaterWheelBlock::new) public static final BlockEntry<WaterWheelBlock> WATER_WHEEL = REGISTRATE.block("water_wheel", WaterWheelBlock::new)
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.color(MaterialColor.DIRT)) .properties(p -> p.noOcclusion().color(MaterialColor.DIRT))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate( .blockstate(
(c, p) -> BlockStateGen.directionalBlockIgnoresWaterlogged(c, p, s -> AssetLookup.partialBaseModel(c, p))) (c, p) -> BlockStateGen.directionalBlockIgnoresWaterlogged(c, p, s -> AssetLookup.partialBaseModel(c, p)))
@ -554,8 +546,7 @@ public class AllBlocks {
public static final BlockEntry<LargeWaterWheelBlock> LARGE_WATER_WHEEL = public static final BlockEntry<LargeWaterWheelBlock> LARGE_WATER_WHEEL =
REGISTRATE.block("large_water_wheel", LargeWaterWheelBlock::new) REGISTRATE.block("large_water_wheel", LargeWaterWheelBlock::new)
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.color(MaterialColor.DIRT)) .properties(p -> p.noOcclusion().color(MaterialColor.DIRT))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> axisBlock(c, p, .blockstate((c, p) -> axisBlock(c, p,
s -> s.getValue(LargeWaterWheelBlock.EXTENSION) ? AssetLookup.partialBaseModel(c, p, "extension") s -> s.getValue(LargeWaterWheelBlock.EXTENSION) ? AssetLookup.partialBaseModel(c, p, "extension")
@ -571,8 +562,7 @@ public class AllBlocks {
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.blockstate((c, p) -> p.getVariantBuilder(c.get()) .blockstate((c, p) -> p.getVariantBuilder(c.get())
.forAllStatesExcept(BlockStateGen.mapToAir(p), WaterWheelStructuralBlock.FACING)) .forAllStatesExcept(BlockStateGen.mapToAir(p), WaterWheelStructuralBlock.FACING))
.properties(p -> p.color(MaterialColor.DIRT)) .properties(p -> p.noOcclusion().color(MaterialColor.DIRT))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.lang("Large Water Wheel") .lang("Large Water Wheel")
.register(); .register();
@ -665,8 +655,8 @@ public class AllBlocks {
public static final BlockEntry<CrushingWheelControllerBlock> CRUSHING_WHEEL_CONTROLLER = public static final BlockEntry<CrushingWheelControllerBlock> CRUSHING_WHEEL_CONTROLLER =
REGISTRATE.block("crushing_wheel_controller", CrushingWheelControllerBlock::new) REGISTRATE.block("crushing_wheel_controller", CrushingWheelControllerBlock::new)
.initialProperties(SharedProperties.CRUSHING_WHEEL_CONTROLLER_MATERIAL) .initialProperties(SharedProperties.CRUSHING_WHEEL_CONTROLLER_MATERIAL)
.properties(p -> p.color(MaterialColor.STONE)) .properties(p -> p.color(MaterialColor.STONE)
.properties(p -> p.noOcclusion() .noOcclusion()
.noDrops() .noDrops()
.air()) .air())
.blockstate((c, p) -> p.getVariantBuilder(c.get()) .blockstate((c, p) -> p.getVariantBuilder(c.get())
@ -676,8 +666,7 @@ public class AllBlocks {
public static final BlockEntry<MechanicalPressBlock> MECHANICAL_PRESS = public static final BlockEntry<MechanicalPressBlock> MECHANICAL_PRESS =
REGISTRATE.block("mechanical_press", MechanicalPressBlock::new) REGISTRATE.block("mechanical_press", MechanicalPressBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.PODZOL)) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
.transform(BlockStressDefaults.setImpact(8.0)) .transform(BlockStressDefaults.setImpact(8.0))
@ -688,8 +677,7 @@ public class AllBlocks {
public static final BlockEntry<MechanicalMixerBlock> MECHANICAL_MIXER = public static final BlockEntry<MechanicalMixerBlock> MECHANICAL_MIXER =
REGISTRATE.block("mechanical_mixer", MechanicalMixerBlock::new) REGISTRATE.block("mechanical_mixer", MechanicalMixerBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.STONE)) .properties(p -> p.noOcclusion().color(MaterialColor.STONE))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p)))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@ -700,8 +688,7 @@ public class AllBlocks {
public static final BlockEntry<BasinBlock> BASIN = REGISTRATE.block("basin", BasinBlock::new) public static final BlockEntry<BasinBlock> BASIN = REGISTRATE.block("basin", BasinBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_GRAY).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new BasinGenerator()::generate) .blockstate(new BasinGenerator()::generate)
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@ -713,8 +700,7 @@ public class AllBlocks {
public static final BlockEntry<BlazeBurnerBlock> BLAZE_BURNER = public static final BlockEntry<BlazeBurnerBlock> BLAZE_BURNER =
REGISTRATE.block("blaze_burner", BlazeBurnerBlock::new) REGISTRATE.block("blaze_burner", BlazeBurnerBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_GRAY).lightLevel(BlazeBurnerBlock::getLight))
.properties(p -> p.lightLevel(BlazeBurnerBlock::getLight))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.tag(AllBlockTags.FAN_PROCESSING_CATALYSTS_BLASTING.tag, AllBlockTags.FAN_PROCESSING_CATALYSTS_SMOKING.tag, AllBlockTags.FAN_TRANSPARENT.tag, AllBlockTags.PASSIVE_BOILER_HEATERS.tag) .tag(AllBlockTags.FAN_PROCESSING_CATALYSTS_BLASTING.tag, AllBlockTags.FAN_PROCESSING_CATALYSTS_SMOKING.tag, AllBlockTags.FAN_TRANSPARENT.tag, AllBlockTags.PASSIVE_BOILER_HEATERS.tag)
@ -730,8 +716,7 @@ public class AllBlocks {
public static final BlockEntry<LitBlazeBurnerBlock> LIT_BLAZE_BURNER = public static final BlockEntry<LitBlazeBurnerBlock> LIT_BLAZE_BURNER =
REGISTRATE.block("lit_blaze_burner", LitBlazeBurnerBlock::new) REGISTRATE.block("lit_blaze_burner", LitBlazeBurnerBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.COLOR_LIGHT_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_LIGHT_GRAY).lightLevel(LitBlazeBurnerBlock::getLight))
.properties(p -> p.lightLevel(LitBlazeBurnerBlock::getLight))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.tag(AllBlockTags.FAN_PROCESSING_CATALYSTS_HAUNTING.tag, AllBlockTags.FAN_PROCESSING_CATALYSTS_SMOKING.tag, AllBlockTags.FAN_TRANSPARENT.tag, AllBlockTags.PASSIVE_BOILER_HEATERS.tag) .tag(AllBlockTags.FAN_PROCESSING_CATALYSTS_HAUNTING.tag, AllBlockTags.FAN_PROCESSING_CATALYSTS_SMOKING.tag, AllBlockTags.FAN_TRANSPARENT.tag, AllBlockTags.PASSIVE_BOILER_HEATERS.tag)
@ -759,8 +744,7 @@ public class AllBlocks {
public static final BlockEntry<EjectorBlock> WEIGHTED_EJECTOR = public static final BlockEntry<EjectorBlock> WEIGHTED_EJECTOR =
REGISTRATE.block("weighted_ejector", EjectorBlock::new) REGISTRATE.block("weighted_ejector", EjectorBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.noOcclusion().color(MaterialColor.COLOR_GRAY))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> p.horizontalBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p), 180)) .blockstate((c, p) -> p.horizontalBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p), 180))
.transform(BlockStressDefaults.setImpact(2.0)) .transform(BlockStressDefaults.setImpact(2.0))
@ -770,10 +754,8 @@ public class AllBlocks {
.register(); .register();
public static final BlockEntry<ChuteBlock> CHUTE = REGISTRATE.block("chute", ChuteBlock::new) public static final BlockEntry<ChuteBlock> CHUTE = REGISTRATE.block("chute", ChuteBlock::new)
.addLayer(() -> RenderType::cutoutMipped)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_GRAY).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.blockstate(new ChuteGenerator()::generate) .blockstate(new ChuteGenerator()::generate)
@ -782,12 +764,12 @@ public class AllBlocks {
.register(); .register();
public static final BlockEntry<SmartChuteBlock> SMART_CHUTE = REGISTRATE.block("smart_chute", SmartChuteBlock::new) public static final BlockEntry<SmartChuteBlock> SMART_CHUTE = REGISTRATE.block("smart_chute", SmartChuteBlock::new)
.addLayer(() -> RenderType::cutoutMipped)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_GRAY)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .sound(SoundType.NETHERITE_BLOCK)
.properties(p -> p.noOcclusion()) .noOcclusion()
.properties(p -> p.isRedstoneConductor((level, pos, state) -> false)) .isRedstoneConductor((level, pos, state) -> false))
.addLayer(() -> RenderType::cutoutMipped)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p))) .blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p)))
.item() .item()
@ -846,8 +828,7 @@ public class AllBlocks {
public static final BlockEntry<EncasedPipeBlock> ENCASED_FLUID_PIPE = public static final BlockEntry<EncasedPipeBlock> ENCASED_FLUID_PIPE =
REGISTRATE.block("encased_fluid_pipe", p -> new EncasedPipeBlock(p, AllBlocks.COPPER_CASING::get)) REGISTRATE.block("encased_fluid_pipe", p -> new EncasedPipeBlock(p, AllBlocks.COPPER_CASING::get))
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::copperMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_LIGHT_GRAY)) .properties(p -> p.noOcclusion().color(MaterialColor.TERRACOTTA_LIGHT_GRAY))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.encasedPipe()) .blockstate(BlockStateGen.encasedPipe())
.onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCTBehaviour(AllSpriteShifts.COPPER_CASING))) .onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCTBehaviour(AllSpriteShifts.COPPER_CASING)))
@ -936,8 +917,7 @@ public class AllBlocks {
public static final BlockEntry<FluidTankBlock> FLUID_TANK = REGISTRATE.block("fluid_tank", FluidTankBlock::regular) public static final BlockEntry<FluidTankBlock> FLUID_TANK = REGISTRATE.block("fluid_tank", FluidTankBlock::regular)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::copperMetal)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().isRedstoneConductor((p1, p2, p3) -> true))
.properties(p -> p.isRedstoneConductor((p1, p2, p3) -> true))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new FluidTankGenerator()::generate) .blockstate(new FluidTankGenerator()::generate)
.onRegister(CreateRegistrate.blockModel(() -> FluidTankModel::standard)) .onRegister(CreateRegistrate.blockModel(() -> FluidTankModel::standard))
@ -951,8 +931,7 @@ public class AllBlocks {
public static final BlockEntry<FluidTankBlock> CREATIVE_FLUID_TANK = public static final BlockEntry<FluidTankBlock> CREATIVE_FLUID_TANK =
REGISTRATE.block("creative_fluid_tank", FluidTankBlock::creative) REGISTRATE.block("creative_fluid_tank", FluidTankBlock::creative)
.initialProperties(SharedProperties::copperMetal) .initialProperties(SharedProperties::copperMetal)
.properties(BlockBehaviour.Properties::noOcclusion) .properties(p -> p.noOcclusion().color(MaterialColor.COLOR_PURPLE))
.properties(p -> p.color(MaterialColor.COLOR_PURPLE))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(AllBlockTags.SAFE_NBT.tag) .tag(AllBlockTags.SAFE_NBT.tag)
.blockstate(new FluidTankGenerator("creative_")::generate) .blockstate(new FluidTankGenerator("creative_")::generate)
@ -1066,8 +1045,7 @@ public class AllBlocks {
public static final BlockEntry<PistonExtensionPoleBlock> PISTON_EXTENSION_POLE = public static final BlockEntry<PistonExtensionPoleBlock> PISTON_EXTENSION_POLE =
REGISTRATE.block("piston_extension_pole", PistonExtensionPoleBlock::new) REGISTRATE.block("piston_extension_pole", PistonExtensionPoleBlock::new)
.initialProperties(() -> Blocks.PISTON_HEAD) .initialProperties(() -> Blocks.PISTON_HEAD)
.properties(p -> p.sound(SoundType.SCAFFOLDING)) .properties(p -> p.sound(SoundType.SCAFFOLDING).color(MaterialColor.DIRT))
.properties(p -> p.color(MaterialColor.DIRT))
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.directionalBlockProviderIgnoresWaterlogged(false)) .blockstate(BlockStateGen.directionalBlockProviderIgnoresWaterlogged(false))
.simpleItem() .simpleItem()
@ -1087,8 +1065,7 @@ public class AllBlocks {
public static final BlockEntry<GantryCarriageBlock> GANTRY_CARRIAGE = public static final BlockEntry<GantryCarriageBlock> GANTRY_CARRIAGE =
REGISTRATE.block("gantry_carriage", GantryCarriageBlock::new) REGISTRATE.block("gantry_carriage", GantryCarriageBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.PODZOL)) .properties(p -> p.noOcclusion().color(MaterialColor.PODZOL))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.directionalAxisBlockProvider()) .blockstate(BlockStateGen.directionalAxisBlockProvider())
.item() .item()
@ -1193,8 +1170,7 @@ public class AllBlocks {
public static final BlockEntry<CartAssemblerBlock> CART_ASSEMBLER = public static final BlockEntry<CartAssemblerBlock> CART_ASSEMBLER =
REGISTRATE.block("cart_assembler", CartAssemblerBlock::new) REGISTRATE.block("cart_assembler", CartAssemblerBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.noOcclusion().color(MaterialColor.COLOR_GRAY))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.cartAssembler()) .blockstate(BlockStateGen.cartAssembler())
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
@ -1350,8 +1326,7 @@ public class AllBlocks {
public static final BlockEntry<ElevatorContactBlock> ELEVATOR_CONTACT = public static final BlockEntry<ElevatorContactBlock> ELEVATOR_CONTACT =
REGISTRATE.block("elevator_contact", ElevatorContactBlock::new) REGISTRATE.block("elevator_contact", ElevatorContactBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW)) .properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW).lightLevel(ElevatorContactBlock::getLight))
.properties(p -> p.lightLevel(ElevatorContactBlock::getLight))
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate((c, p) -> p.directionalBlock(c.get(), state -> { .blockstate((c, p) -> p.directionalBlock(c.get(), state -> {
Boolean calling = state.getValue(ElevatorContactBlock.CALLING); Boolean calling = state.getValue(ElevatorContactBlock.CALLING);
@ -1406,8 +1381,8 @@ public class AllBlocks {
public static final BlockEntry<SailBlock> SAIL_FRAME = REGISTRATE.block("sail_frame", p -> SailBlock.frame(p)) public static final BlockEntry<SailBlock> SAIL_FRAME = REGISTRATE.block("sail_frame", p -> SailBlock.frame(p))
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.color(MaterialColor.DIRT)) .properties(p -> p.color(MaterialColor.DIRT)
.properties(p -> p.sound(SoundType.SCAFFOLDING) .sound(SoundType.SCAFFOLDING)
.noOcclusion()) .noOcclusion())
.transform(axeOnly()) .transform(axeOnly())
.blockstate(BlockStateGen.directionalBlockProvider(false)) .blockstate(BlockStateGen.directionalBlockProvider(false))
@ -1420,8 +1395,8 @@ public class AllBlocks {
public static final BlockEntry<SailBlock> SAIL = public static final BlockEntry<SailBlock> SAIL =
REGISTRATE.block("white_sail", p -> SailBlock.withCanvas(p, DyeColor.WHITE)) REGISTRATE.block("white_sail", p -> SailBlock.withCanvas(p, DyeColor.WHITE))
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.color(MaterialColor.SNOW)) .properties(p -> p.color(MaterialColor.SNOW)
.properties(p -> p.sound(SoundType.SCAFFOLDING) .sound(SoundType.SCAFFOLDING)
.noOcclusion()) .noOcclusion())
.transform(axeOnly()) .transform(axeOnly())
.blockstate(BlockStateGen.directionalBlockProvider(false)) .blockstate(BlockStateGen.directionalBlockProvider(false))
@ -1438,8 +1413,8 @@ public class AllBlocks {
String colourName = colour.getSerializedName(); String colourName = colour.getSerializedName();
return REGISTRATE.block(colourName + "_sail", p -> SailBlock.withCanvas(p, colour)) return REGISTRATE.block(colourName + "_sail", p -> SailBlock.withCanvas(p, colour))
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.color(colour.getMaterialColor())) .properties(p -> p.color(colour.getMaterialColor())
.properties(p -> p.sound(SoundType.SCAFFOLDING) .sound(SoundType.SCAFFOLDING)
.noOcclusion()) .noOcclusion())
.transform(axeOnly()) .transform(axeOnly())
.blockstate((c, p) -> p.directionalBlock(c.get(), p.models() .blockstate((c, p) -> p.directionalBlock(c.get(), p.models()
@ -1461,8 +1436,7 @@ public class AllBlocks {
.register(); .register();
public static final BlockEntry<CasingBlock> COPPER_CASING = REGISTRATE.block("copper_casing", CasingBlock::new) public static final BlockEntry<CasingBlock> COPPER_CASING = REGISTRATE.block("copper_casing", CasingBlock::new)
.properties(p -> p.color(MaterialColor.TERRACOTTA_LIGHT_GRAY)) .properties(p -> p.color(MaterialColor.TERRACOTTA_LIGHT_GRAY).sound(SoundType.COPPER))
.properties(p -> p.sound(SoundType.COPPER))
.transform(BuilderTransformers.casing(() -> AllSpriteShifts.COPPER_CASING)) .transform(BuilderTransformers.casing(() -> AllSpriteShifts.COPPER_CASING))
.register(); .register();
@ -1484,8 +1458,7 @@ public class AllBlocks {
public static final BlockEntry<MechanicalCrafterBlock> MECHANICAL_CRAFTER = public static final BlockEntry<MechanicalCrafterBlock> MECHANICAL_CRAFTER =
REGISTRATE.block("mechanical_crafter", MechanicalCrafterBlock::new) REGISTRATE.block("mechanical_crafter", MechanicalCrafterBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW)) .properties(p -> p.noOcclusion().color(MaterialColor.TERRACOTTA_YELLOW))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(BlockStateGen.horizontalBlockProvider(true)) .blockstate(BlockStateGen.horizontalBlockProvider(true))
.transform(BlockStressDefaults.setImpact(2.0)) .transform(BlockStressDefaults.setImpact(2.0))
@ -1510,8 +1483,7 @@ public class AllBlocks {
public static final BlockEntry<FlywheelBlock> FLYWHEEL = REGISTRATE.block("flywheel", FlywheelBlock::new) public static final BlockEntry<FlywheelBlock> FLYWHEEL = REGISTRATE.block("flywheel", FlywheelBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW)) .properties(p -> p.noOcclusion().color(MaterialColor.TERRACOTTA_YELLOW))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.transform(BlockStressDefaults.setNoImpact()) .transform(BlockStressDefaults.setNoImpact())
.blockstate(BlockStateGen.axisBlockProvider(true)) .blockstate(BlockStateGen.axisBlockProvider(true))
@ -1579,15 +1551,13 @@ public class AllBlocks {
public static final BlockEntry<CasingBlock> RAILWAY_CASING = REGISTRATE.block("railway_casing", CasingBlock::new) public static final BlockEntry<CasingBlock> RAILWAY_CASING = REGISTRATE.block("railway_casing", CasingBlock::new)
.transform(BuilderTransformers.layeredCasing(() -> AllSpriteShifts.RAILWAY_CASING_SIDE, .transform(BuilderTransformers.layeredCasing(() -> AllSpriteShifts.RAILWAY_CASING_SIDE,
() -> AllSpriteShifts.RAILWAY_CASING)) () -> AllSpriteShifts.RAILWAY_CASING))
.properties(p -> p.color(MaterialColor.TERRACOTTA_CYAN)) .properties(p -> p.color(MaterialColor.TERRACOTTA_CYAN).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.lang("Train Casing") .lang("Train Casing")
.register(); .register();
public static final BlockEntry<StationBlock> TRACK_STATION = REGISTRATE.block("track_station", StationBlock::new) public static final BlockEntry<StationBlock> TRACK_STATION = REGISTRATE.block("track_station", StationBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.PODZOL)) .properties(p -> p.color(MaterialColor.PODZOL).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> p.simpleBlock(c.get(), AssetLookup.partialBaseModel(c, p))) .blockstate((c, p) -> p.simpleBlock(c.get(), AssetLookup.partialBaseModel(c, p)))
.onRegister(assignDataBehaviour(new StationSummaryDisplaySource(), "station_summary")) .onRegister(assignDataBehaviour(new StationSummaryDisplaySource(), "station_summary"))
@ -1599,9 +1569,9 @@ public class AllBlocks {
public static final BlockEntry<SignalBlock> TRACK_SIGNAL = REGISTRATE.block("track_signal", SignalBlock::new) public static final BlockEntry<SignalBlock> TRACK_SIGNAL = REGISTRATE.block("track_signal", SignalBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.PODZOL)) .properties(p -> p.color(MaterialColor.PODZOL)
.properties(p -> p.noOcclusion()) .noOcclusion()
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> p.getVariantBuilder(c.get()) .blockstate((c, p) -> p.getVariantBuilder(c.get())
.forAllStates(state -> ConfiguredModel.builder() .forAllStates(state -> ConfiguredModel.builder()
@ -1616,9 +1586,9 @@ public class AllBlocks {
public static final BlockEntry<TrackObserverBlock> TRACK_OBSERVER = public static final BlockEntry<TrackObserverBlock> TRACK_OBSERVER =
REGISTRATE.block("track_observer", TrackObserverBlock::new) REGISTRATE.block("track_observer", TrackObserverBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.PODZOL)) .properties(p -> p.color(MaterialColor.PODZOL)
.properties(p -> p.noOcclusion()) .noOcclusion()
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .sound(SoundType.NETHERITE_BLOCK))
.blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p))) .blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.onRegister(assignDataBehaviour(new ObservedTrainNameSource(), "observed_train_name")) .onRegister(assignDataBehaviour(new ObservedTrainNameSource(), "observed_train_name"))
@ -1641,8 +1611,7 @@ public class AllBlocks {
public static final BlockEntry<ControlsBlock> TRAIN_CONTROLS = REGISTRATE.block("controls", ControlsBlock::new) public static final BlockEntry<ControlsBlock> TRAIN_CONTROLS = REGISTRATE.block("controls", ControlsBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN)) .properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> p.horizontalBlock(c.get(), .blockstate((c, p) -> p.horizontalBlock(c.get(),
@ -1657,8 +1626,8 @@ public class AllBlocks {
public static final BlockEntry<ItemVaultBlock> ITEM_VAULT = REGISTRATE.block("item_vault", ItemVaultBlock::new) public static final BlockEntry<ItemVaultBlock> ITEM_VAULT = REGISTRATE.block("item_vault", ItemVaultBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.TERRACOTTA_BLUE)) .properties(p -> p.color(MaterialColor.TERRACOTTA_BLUE)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK) .sound(SoundType.NETHERITE_BLOCK)
.explosionResistance(1200)) .explosionResistance(1200))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> p.getVariantBuilder(c.get()) .blockstate((c, p) -> p.getVariantBuilder(c.get())
@ -1743,8 +1712,7 @@ public class AllBlocks {
public static final BlockEntry<SmartObserverBlock> SMART_OBSERVER = public static final BlockEntry<SmartObserverBlock> SMART_OBSERVER =
REGISTRATE.block("content_observer", SmartObserverBlock::new) REGISTRATE.block("content_observer", SmartObserverBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN)) .properties(p -> p.noOcclusion().color(MaterialColor.TERRACOTTA_BROWN))
.properties(p -> p.noOcclusion())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(new SmartObserverGenerator()::generate) .blockstate(new SmartObserverGenerator()::generate)
.onRegister(assignDataBehaviour(new ItemCountDisplaySource(), "count_items")) .onRegister(assignDataBehaviour(new ItemCountDisplaySource(), "count_items"))
@ -1759,8 +1727,7 @@ public class AllBlocks {
public static final BlockEntry<ThresholdSwitchBlock> THRESHOLD_SWITCH = public static final BlockEntry<ThresholdSwitchBlock> THRESHOLD_SWITCH =
REGISTRATE.block("stockpile_switch", ThresholdSwitchBlock::new) REGISTRATE.block("stockpile_switch", ThresholdSwitchBlock::new)
.initialProperties(SharedProperties::stone) .initialProperties(SharedProperties::stone)
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN)) .properties(p -> p.noOcclusion().color(MaterialColor.TERRACOTTA_BROWN))
.properties(p -> p.noOcclusion())
.transform(axeOrPickaxe()) .transform(axeOrPickaxe())
.blockstate(new ThresholdSwitchGenerator()::generate) .blockstate(new ThresholdSwitchGenerator()::generate)
.onRegister(assignDataBehaviour(new FillLevelDisplaySource(), "fill_level")) .onRegister(assignDataBehaviour(new FillLevelDisplaySource(), "fill_level"))
@ -1803,8 +1770,7 @@ public class AllBlocks {
public static final BlockEntry<NixieTubeBlock> ORANGE_NIXIE_TUBE = public static final BlockEntry<NixieTubeBlock> ORANGE_NIXIE_TUBE =
REGISTRATE.block("nixie_tube", p -> new NixieTubeBlock(p, DyeColor.ORANGE)) REGISTRATE.block("nixie_tube", p -> new NixieTubeBlock(p, DyeColor.ORANGE))
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.lightLevel($ -> 5)) .properties(p -> p.lightLevel($ -> 5).color(DyeColor.ORANGE.getMaterialColor()))
.properties(p -> p.color(DyeColor.ORANGE.getMaterialColor()))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new NixieTubeGenerator()::generate) .blockstate(new NixieTubeGenerator()::generate)
.addLayer(() -> RenderType::translucent) .addLayer(() -> RenderType::translucent)
@ -1818,8 +1784,7 @@ public class AllBlocks {
String colourName = colour.getSerializedName(); String colourName = colour.getSerializedName();
return REGISTRATE.block(colourName + "_nixie_tube", p -> new NixieTubeBlock(p, colour)) return REGISTRATE.block(colourName + "_nixie_tube", p -> new NixieTubeBlock(p, colour))
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(colour.getMaterialColor())) .properties(p -> p.lightLevel($ -> 5).color(colour.getMaterialColor()))
.properties(p -> p.lightLevel($ -> 5))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(new NixieTubeGenerator()::generate) .blockstate(new NixieTubeGenerator()::generate)
.loot((p, b) -> p.dropOther(b, ORANGE_NIXIE_TUBE.get())) .loot((p, b) -> p.dropOther(b, ORANGE_NIXIE_TUBE.get()))
@ -1952,8 +1917,7 @@ public class AllBlocks {
String colourName = colour.getSerializedName(); String colourName = colour.getSerializedName();
return REGISTRATE.block(colourName + "_toolbox", p -> new ToolboxBlock(p, colour)) return REGISTRATE.block(colourName + "_toolbox", p -> new ToolboxBlock(p, colour))
.initialProperties(SharedProperties::wooden) .initialProperties(SharedProperties::wooden)
.properties(p -> p.sound(SoundType.WOOD)) .properties(p -> p.sound(SoundType.WOOD).color(colour.getMaterialColor()))
.properties(p -> p.color(colour.getMaterialColor()))
.addLayer(() -> RenderType::cutoutMipped) .addLayer(() -> RenderType::cutoutMipped)
.loot((lt, block) -> { .loot((lt, block) -> {
Builder builder = LootTable.lootTable(); Builder builder = LootTable.lootTable();
@ -2050,10 +2014,9 @@ public class AllBlocks {
public static final BlockEntry<GirderBlock> METAL_GIRDER = REGISTRATE.block("metal_girder", GirderBlock::new) public static final BlockEntry<GirderBlock> METAL_GIRDER = REGISTRATE.block("metal_girder", GirderBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.blockstate(GirderBlockStateGenerator::blockState) .properties(p -> p.color(MaterialColor.COLOR_GRAY).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.color(MaterialColor.COLOR_GRAY))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(GirderBlockStateGenerator::blockState)
.onRegister(CreateRegistrate.blockModel(() -> ConnectedGirderModel::new)) .onRegister(CreateRegistrate.blockModel(() -> ConnectedGirderModel::new))
.item() .item()
.transform(customItemModel()) .transform(customItemModel())
@ -2062,10 +2025,9 @@ public class AllBlocks {
public static final BlockEntry<GirderEncasedShaftBlock> METAL_GIRDER_ENCASED_SHAFT = public static final BlockEntry<GirderEncasedShaftBlock> METAL_GIRDER_ENCASED_SHAFT =
REGISTRATE.block("metal_girder_encased_shaft", GirderEncasedShaftBlock::new) REGISTRATE.block("metal_girder_encased_shaft", GirderEncasedShaftBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.blockstate(GirderBlockStateGenerator::blockStateWithShaft) .properties(p -> p.color(MaterialColor.COLOR_GRAY).sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.color(MaterialColor.COLOR_GRAY))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(GirderBlockStateGenerator::blockStateWithShaft)
.loot((p, b) -> p.add(b, RegistrateBlockLootTables.createSingleItemTable(METAL_GIRDER.get()) .loot((p, b) -> p.add(b, RegistrateBlockLootTables.createSingleItemTable(METAL_GIRDER.get())
.withPool(RegistrateBlockLootTables.applyExplosionCondition(SHAFT.get(), LootPool.lootPool() .withPool(RegistrateBlockLootTables.applyExplosionCondition(SHAFT.get(), LootPool.lootPool()
.setRolls(ConstantValue.exactly(1.0F)) .setRolls(ConstantValue.exactly(1.0F))
@ -2204,8 +2166,8 @@ public class AllBlocks {
public static final BlockEntry<Block> ZINC_ORE = REGISTRATE.block("zinc_ore", Block::new) public static final BlockEntry<Block> ZINC_ORE = REGISTRATE.block("zinc_ore", Block::new)
.initialProperties(() -> Blocks.GOLD_ORE) .initialProperties(() -> Blocks.GOLD_ORE)
.properties(p -> p.color(MaterialColor.METAL)) .properties(p -> p.color(MaterialColor.METAL)
.properties(p -> p.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.STONE)) .sound(SoundType.STONE))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.loot((lt, b) -> lt.add(b, .loot((lt, b) -> lt.add(b,
@ -2221,8 +2183,8 @@ public class AllBlocks {
public static final BlockEntry<Block> DEEPSLATE_ZINC_ORE = REGISTRATE.block("deepslate_zinc_ore", Block::new) public static final BlockEntry<Block> DEEPSLATE_ZINC_ORE = REGISTRATE.block("deepslate_zinc_ore", Block::new)
.initialProperties(() -> Blocks.DEEPSLATE_GOLD_ORE) .initialProperties(() -> Blocks.DEEPSLATE_GOLD_ORE)
.properties(p -> p.color(MaterialColor.STONE)) .properties(p -> p.color(MaterialColor.STONE)
.properties(p -> p.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.DEEPSLATE)) .sound(SoundType.DEEPSLATE))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.loot((lt, b) -> lt.add(b, .loot((lt, b) -> lt.add(b,
@ -2238,8 +2200,7 @@ public class AllBlocks {
public static final BlockEntry<Block> RAW_ZINC_BLOCK = REGISTRATE.block("raw_zinc_block", Block::new) public static final BlockEntry<Block> RAW_ZINC_BLOCK = REGISTRATE.block("raw_zinc_block", Block::new)
.initialProperties(() -> Blocks.RAW_GOLD_BLOCK) .initialProperties(() -> Blocks.RAW_GOLD_BLOCK)
.properties(p -> p.color(MaterialColor.GLOW_LICHEN)) .properties(p -> p.color(MaterialColor.GLOW_LICHEN).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(Tags.Blocks.STORAGE_BLOCKS) .tag(Tags.Blocks.STORAGE_BLOCKS)
.tag(BlockTags.NEEDS_IRON_TOOL) .tag(BlockTags.NEEDS_IRON_TOOL)
@ -2251,8 +2212,7 @@ public class AllBlocks {
public static final BlockEntry<Block> ZINC_BLOCK = REGISTRATE.block("zinc_block", Block::new) public static final BlockEntry<Block> ZINC_BLOCK = REGISTRATE.block("zinc_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(() -> Blocks.IRON_BLOCK)
.properties(p -> p.color(MaterialColor.GLOW_LICHEN)) .properties(p -> p.color(MaterialColor.GLOW_LICHEN).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.tag(BlockTags.NEEDS_IRON_TOOL) .tag(BlockTags.NEEDS_IRON_TOOL)
.tag(Tags.Blocks.STORAGE_BLOCKS) .tag(Tags.Blocks.STORAGE_BLOCKS)
@ -2265,8 +2225,7 @@ public class AllBlocks {
public static final BlockEntry<Block> ANDESITE_ALLOY_BLOCK = REGISTRATE.block("andesite_alloy_block", Block::new) public static final BlockEntry<Block> ANDESITE_ALLOY_BLOCK = REGISTRATE.block("andesite_alloy_block", Block::new)
.initialProperties(() -> Blocks.ANDESITE) .initialProperties(() -> Blocks.ANDESITE)
.properties(p -> p.color(MaterialColor.STONE)) .properties(p -> p.color(MaterialColor.STONE).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("andesite_block")) .blockstate(simpleCubeAll("andesite_block"))
.tag(Tags.Blocks.STORAGE_BLOCKS) .tag(Tags.Blocks.STORAGE_BLOCKS)
@ -2278,9 +2237,9 @@ public class AllBlocks {
public static final BlockEntry<Block> INDUSTRIAL_IRON_BLOCK = REGISTRATE.block("industrial_iron_block", Block::new) public static final BlockEntry<Block> INDUSTRIAL_IRON_BLOCK = REGISTRATE.block("industrial_iron_block", Block::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.COLOR_GRAY)) .properties(p -> p.color(MaterialColor.COLOR_GRAY)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK)) .sound(SoundType.NETHERITE_BLOCK)
.properties(p -> p.requiresCorrectToolForDrops()) .requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models() .blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
.cubeColumn(c.getName(), p.modLoc("block/industrial_iron_block"), .cubeColumn(c.getName(), p.modLoc("block/industrial_iron_block"),
@ -2293,8 +2252,7 @@ public class AllBlocks {
public static final BlockEntry<Block> BRASS_BLOCK = REGISTRATE.block("brass_block", Block::new) public static final BlockEntry<Block> BRASS_BLOCK = REGISTRATE.block("brass_block", Block::new)
.initialProperties(() -> Blocks.IRON_BLOCK) .initialProperties(() -> Blocks.IRON_BLOCK)
.properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW)) .properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("brass_block")) .blockstate(simpleCubeAll("brass_block"))
.tag(BlockTags.NEEDS_IRON_TOOL) .tag(BlockTags.NEEDS_IRON_TOOL)
@ -2309,12 +2267,12 @@ public class AllBlocks {
public static final BlockEntry<ExperienceBlock> EXPERIENCE_BLOCK = public static final BlockEntry<ExperienceBlock> EXPERIENCE_BLOCK =
REGISTRATE.block("experience_block", ExperienceBlock::new) REGISTRATE.block("experience_block", ExperienceBlock::new)
.initialProperties(SharedProperties::softMetal) .initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.PLANT)) .properties(p -> p.color(MaterialColor.PLANT)
.properties(p -> p.sound(new ForgeSoundType(1, .5f, () -> SoundEvents.AMETHYST_BLOCK_BREAK, .sound(new ForgeSoundType(1, .5f, () -> SoundEvents.AMETHYST_BLOCK_BREAK,
() -> SoundEvents.AMETHYST_BLOCK_STEP, () -> SoundEvents.AMETHYST_BLOCK_PLACE, () -> SoundEvents.AMETHYST_BLOCK_STEP, () -> SoundEvents.AMETHYST_BLOCK_PLACE,
() -> SoundEvents.AMETHYST_BLOCK_HIT, () -> SoundEvents.AMETHYST_BLOCK_FALL))) () -> SoundEvents.AMETHYST_BLOCK_HIT, () -> SoundEvents.AMETHYST_BLOCK_FALL))
.properties(p -> p.requiresCorrectToolForDrops()) .requiresCorrectToolForDrops()
.properties(p -> p.lightLevel(s -> 15)) .lightLevel(s -> 15))
.blockstate((c, p) -> p.simpleBlock(c.get(), AssetLookup.standardModel(c, p))) .blockstate((c, p) -> p.simpleBlock(c.get(), AssetLookup.standardModel(c, p)))
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.lang("Block of Experience") .lang("Block of Experience")
@ -2342,8 +2300,7 @@ public class AllBlocks {
public static final BlockEntry<Block> ROSE_QUARTZ_TILES = REGISTRATE.block("rose_quartz_tiles", Block::new) public static final BlockEntry<Block> ROSE_QUARTZ_TILES = REGISTRATE.block("rose_quartz_tiles", Block::new)
.initialProperties(() -> Blocks.DEEPSLATE) .initialProperties(() -> Blocks.DEEPSLATE)
.properties(p -> p.color(MaterialColor.TERRACOTTA_PINK)) .properties(p -> p.color(MaterialColor.TERRACOTTA_PINK).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("palettes/rose_quartz_tiles")) .blockstate(simpleCubeAll("palettes/rose_quartz_tiles"))
.recipe((c, p) -> p.stonecutting(DataIngredient.items(AllItems.POLISHED_ROSE_QUARTZ), c::get, 2)) .recipe((c, p) -> p.stonecutting(DataIngredient.items(AllItems.POLISHED_ROSE_QUARTZ), c::get, 2))
@ -2353,8 +2310,7 @@ public class AllBlocks {
public static final BlockEntry<Block> SMALL_ROSE_QUARTZ_TILES = public static final BlockEntry<Block> SMALL_ROSE_QUARTZ_TILES =
REGISTRATE.block("small_rose_quartz_tiles", Block::new) REGISTRATE.block("small_rose_quartz_tiles", Block::new)
.initialProperties(() -> Blocks.DEEPSLATE) .initialProperties(() -> Blocks.DEEPSLATE)
.properties(p -> p.color(MaterialColor.TERRACOTTA_PINK)) .properties(p -> p.color(MaterialColor.TERRACOTTA_PINK).requiresCorrectToolForDrops())
.properties(p -> p.requiresCorrectToolForDrops())
.transform(pickaxeOnly()) .transform(pickaxeOnly())
.blockstate(simpleCubeAll("palettes/small_rose_quartz_tiles")) .blockstate(simpleCubeAll("palettes/small_rose_quartz_tiles"))
.recipe((c, p) -> p.stonecutting(DataIngredient.items(AllItems.POLISHED_ROSE_QUARTZ), c::get, 2)) .recipe((c, p) -> p.stonecutting(DataIngredient.items(AllItems.POLISHED_ROSE_QUARTZ), c::get, 2))

View file

@ -73,6 +73,10 @@ public class Create {
@Deprecated @Deprecated
public static final Random RANDOM = new Random(); public static final Random RANDOM = new Random();
/**
* <b>Other mods should not use this field!</b> If you are an addon developer, create your own instance of
* {@link CreateRegistrate}.
*/
public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(ID); public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(ID);
static { static {

View file

@ -2,12 +2,13 @@ package com.simibubi.create.content.decoration;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.simibubi.create.foundation.utility.Components;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.ChatType;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ScaffoldingBlockItem; import net.minecraft.world.item.ScaffoldingBlockItem;
@ -47,9 +48,9 @@ public class MetalScaffoldingBlockItem extends ScaffoldingBlockItem {
if (!level.isClientSide && !level.isInWorldBounds(blockpos$mutableblockpos)) { if (!level.isClientSide && !level.isInWorldBounds(blockpos$mutableblockpos)) {
Player player = pContext.getPlayer(); Player player = pContext.getPlayer();
int j = level.getMaxBuildHeight(); int j = level.getMaxBuildHeight();
if (player instanceof ServerPlayer && blockpos$mutableblockpos.getY() >= j) { if (player instanceof ServerPlayer sp && blockpos$mutableblockpos.getY() >= j) {
((ServerPlayer) player).sendMessage( sp.sendMessage(
(new TranslatableComponent("build.tooHigh", j - 1)).withStyle(ChatFormatting.RED), Components.translatable("build.tooHigh", j - 1).withStyle(ChatFormatting.RED),
ChatType.GAME_INFO, Util.NIL_UUID); ChatType.GAME_INFO, Util.NIL_UUID);
} }
break; break;

View file

@ -206,8 +206,10 @@ public class AirCurrent {
currentSegment.type = type; currentSegment.type = type;
} }
} }
if (currentSegment != null) {
currentSegment.endOffset = searchEnd + searchStep + toOffset; currentSegment.endOffset = searchEnd + searchStep + toOffset;
segments.add(currentSegment); segments.add(currentSegment);
}
// Build Bounding Box // Build Bounding Box
if (maxDistance < 0.25f) if (maxDistance < 0.25f)
@ -296,18 +298,18 @@ public class AirCurrent {
affectedItemHandlers.clear(); affectedItemHandlers.clear();
int limit = getLimit(); int limit = getLimit();
for (int i = 1; i <= limit; i++) { for (int i = 1; i <= limit; i++) {
FanProcessingType segmentType = getTypeAt(i - 0.5f); FanProcessingType segmentType = getTypeAt(i - 1);
for (int offset : Iterate.zeroAndOne) { for (int offset : Iterate.zeroAndOne) {
BlockPos pos = start.relative(direction, i) BlockPos pos = start.relative(direction, i)
.below(offset); .below(offset);
TransportedItemStackHandlerBehaviour behaviour = TransportedItemStackHandlerBehaviour behaviour =
BlockEntityBehaviour.get(world, pos, TransportedItemStackHandlerBehaviour.TYPE); BlockEntityBehaviour.get(world, pos, TransportedItemStackHandlerBehaviour.TYPE);
if (behaviour == null) if (behaviour != null) {
continue;
FanProcessingType type = FanProcessingType.getAt(world, pos); FanProcessingType type = FanProcessingType.getAt(world, pos);
if (type == AllFanProcessingTypes.NONE) if (type == AllFanProcessingTypes.NONE)
type = segmentType; type = segmentType;
affectedItemHandlers.add(Pair.of(behaviour, type)); affectedItemHandlers.add(Pair.of(behaviour, type));
}
if (direction.getAxis() if (direction.getAxis()
.isVertical()) .isVertical())
break; break;

View file

@ -122,6 +122,7 @@ public class AirFlowParticle extends SimpleAnimatedParticle {
this.spriteSet = animatedSprite; this.spriteSet = animatedSprite;
} }
@Override
public Particle createParticle(AirFlowParticleData data, ClientLevel worldIn, double x, double y, double z, public Particle createParticle(AirFlowParticleData data, ClientLevel worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) { double xSpeed, double ySpeed, double zSpeed) {
BlockEntity be = worldIn.getBlockEntity(new BlockPos(data.posX, data.posY, data.posZ)); BlockEntity be = worldIn.getBlockEntity(new BlockPos(data.posX, data.posY, data.posZ));

View file

@ -11,7 +11,6 @@ import java.util.function.UnaryOperator;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import com.simibubi.create.Create;
import com.simibubi.create.CreateClient; import com.simibubi.create.CreateClient;
import com.simibubi.create.content.decoration.encasing.CasingConnectivity; import com.simibubi.create.content.decoration.encasing.CasingConnectivity;
import com.simibubi.create.content.fluids.VirtualFluid; import com.simibubi.create.content.fluids.VirtualFluid;
@ -189,8 +188,8 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
BiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory, BiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory,
NonNullFunction<ForgeFlowingFluid.Properties, T> factory) { NonNullFunction<ForgeFlowingFluid.Properties, T> factory) {
return entry(name, return entry(name,
c -> new VirtualFluidBuilder<>(self(), self(), name, c, Create.asResource("fluid/" + name + "_still"), c -> new VirtualFluidBuilder<>(self(), self(), name, c, new ResourceLocation(getModid(), "fluid/" + name + "_still"),
Create.asResource("fluid/" + name + "_flow"), attributesFactory, factory)); new ResourceLocation(getModid(), "fluid/" + name + "_flow"), attributesFactory, factory));
} }
public <T extends ForgeFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow, public <T extends ForgeFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow,
@ -203,8 +202,8 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name) { public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name) {
return entry(name, return entry(name,
c -> new VirtualFluidBuilder<>(self(), self(), name, c, Create.asResource("fluid/" + name + "_still"), c -> new VirtualFluidBuilder<>(self(), self(), name, c, new ResourceLocation(getModid(), "fluid/" + name + "_still"),
Create.asResource("fluid/" + name + "_flow"), null, VirtualFluid::new)); new ResourceLocation(getModid(), "fluid/" + name + "_flow"), null, VirtualFluid::new));
} }
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow) { public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name, ResourceLocation still, ResourceLocation flow) {
@ -214,12 +213,12 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) { public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) {
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow")); return fluid(name, new ResourceLocation(getModid(), "fluid/" + name + "_still"), new ResourceLocation(getModid(), "fluid/" + name + "_flow"));
} }
public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name, public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name,
NonNullBiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory) { NonNullBiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory) {
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"), return fluid(name, new ResourceLocation(getModid(), "fluid/" + name + "_still"), new ResourceLocation(getModid(), "fluid/" + name + "_flow"),
attributesFactory); attributesFactory);
} }

View file

@ -13,7 +13,7 @@ public class SharedProperties {
new Material(MaterialColor.COLOR_GRAY, false, true, true, true, false, false, PushReaction.NORMAL); new Material(MaterialColor.COLOR_GRAY, false, true, true, true, false, false, PushReaction.NORMAL);
public static final Material CRUSHING_WHEEL_CONTROLLER_MATERIAL = public static final Material CRUSHING_WHEEL_CONTROLLER_MATERIAL =
new Material(MaterialColor.NONE, false, false, true, true, false, false, PushReaction.BLOCK); new Material(MaterialColor.NONE, false, true, true, true, false, false, PushReaction.BLOCK);
public static Block wooden() { public static Block wooden() {
return Blocks.STRIPPED_SPRUCE_WOOD; return Blocks.STRIPPED_SPRUCE_WOOD;