diff --git a/build.gradle b/build.gradle index aaa7cd4e5..7074e9f38 100644 --- a/build.gradle +++ b/build.gradle @@ -97,7 +97,7 @@ configurations { dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.3' - def registrate = "com.tterrag.registrate:Registrate:MC1.15.2-0.0.3.11" + def registrate = "com.tterrag.registrate:Registrate:MC1.15.2-0.0.3.17" implementation fg.deobf(registrate) shade registrate diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index a6683e095..5eb3f62a5 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -1,7 +1,6 @@ package com.simibubi.create; import java.util.function.Function; -import java.util.function.Supplier; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.components.actors.DrillRenderer; @@ -88,119 +87,145 @@ import com.simibubi.create.content.schematics.block.SchematicTableTileEntity; import com.simibubi.create.content.schematics.block.SchematicannonRenderer; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; -import com.simibubi.create.foundation.utility.Lang; +import com.tterrag.registrate.util.entry.TileEntityEntry; +import com.tterrag.registrate.util.nullness.NonNullFunction; +import com.tterrag.registrate.util.nullness.NonNullSupplier; import net.minecraft.block.Block; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; -public enum AllTileEntities { +public class AllTileEntities { // Schematics - SCHEMATICANNON(SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON), - SCHEMATIC_TABLE(SchematicTableTileEntity::new, AllBlocks.SCHEMATIC_TABLE), + public static final TileEntityEntry SCHEMATICANNON = register( + "schematicannon", SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON); + public static final TileEntityEntry SCHEMATIC_TABLE = register( + "schematic_table", SchematicTableTileEntity::new, AllBlocks.SCHEMATIC_TABLE); // Kinetics - SIMPLE_KINETIC(SimpleKineticTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL, - AllBlocks.ENCASED_SHAFT), - MOTOR(CreativeMotorTileEntity::new, AllBlocks.CREATIVE_MOTOR), - GEARBOX(GearboxTileEntity::new, AllBlocks.GEARBOX), - ENCASED_SHAFT(EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT), - ADJUSTABLE_PULLEY(AdjustablePulleyTileEntity::new, AllBlocks.ADJUSTABLE_PULLEY), - ENCASED_FAN(EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN), - NOZZLE(NozzleTileEntity::new, AllBlocks.NOZZLE), - CLUTCH(ClutchTileEntity::new, AllBlocks.CLUTCH), - GEARSHIFT(GearshiftTileEntity::new, AllBlocks.GEARSHIFT), - TURNTABLE(TurntableTileEntity::new, AllBlocks.TURNTABLE), - HAND_CRANK(HandCrankTileEntity::new, AllBlocks.HAND_CRANK), - CUCKOO_CLOCK(CuckooClockTileEntity::new, AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK), + public static final TileEntityEntry SIMPLE_KINETIC = register( + "simple_kinetic", SimpleKineticTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL, + AllBlocks.LARGE_COGWHEEL, AllBlocks.ENCASED_SHAFT); + public static final TileEntityEntry MOTOR = register( + "motor", CreativeMotorTileEntity::new, AllBlocks.CREATIVE_MOTOR); + public static final TileEntityEntry GEARBOX = register( + "gearbox", GearboxTileEntity::new, AllBlocks.GEARBOX); + public static final TileEntityEntry ENCASED_SHAFT = register( + "encased_shaft", EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT); + public static final TileEntityEntry ADJUSTABLE_PULLEY = register( + "adjustable_pulley", AdjustablePulleyTileEntity::new, AllBlocks.ADJUSTABLE_PULLEY); + public static final TileEntityEntry ENCASED_FAN = register( + "encased_fan", EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN); + public static final TileEntityEntry NOZZLE = register( + "nozzle", NozzleTileEntity::new, AllBlocks.NOZZLE); + public static final TileEntityEntry CLUTCH = register( + "clutch", ClutchTileEntity::new, AllBlocks.CLUTCH); + public static final TileEntityEntry GEARSHIFT = register( + "gearshift", GearshiftTileEntity::new, AllBlocks.GEARSHIFT); + public static final TileEntityEntry TURNTABLE = register( + "turntable", TurntableTileEntity::new, AllBlocks.TURNTABLE); + public static final TileEntityEntry HAND_CRANK = register( + "hand_crank", HandCrankTileEntity::new, AllBlocks.HAND_CRANK); + public static final TileEntityEntry CUCKOO_CLOCK = register( + "cuckoo_clock", CuckooClockTileEntity::new, AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK); - BELT(BeltTileEntity::new, AllBlocks.BELT), - BELT_TUNNEL(BeltTunnelTileEntity::new, AllBlocks.BELT_TUNNEL), - MECHANICAL_PISTON(MechanicalPistonTileEntity::new, AllBlocks.MECHANICAL_PISTON, - AllBlocks.STICKY_MECHANICAL_PISTON), - MECHANICAL_BEARING(MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING), - CLOCKWORK_BEARING(ClockworkBearingTileEntity::new, AllBlocks.CLOCKWORK_BEARING), - ROPE_PULLEY(PulleyTileEntity::new, AllBlocks.ROPE_PULLEY), - CHASSIS(ChassisTileEntity::new, AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, - AllBlocks.SECONDARY_LINEAR_CHASSIS), - DRILL(DrillTileEntity::new, AllBlocks.MECHANICAL_DRILL), - SAW(SawTileEntity::new, AllBlocks.MECHANICAL_SAW), - HARVESTER(HarvesterTileEntity::new, AllBlocks.MECHANICAL_HARVESTER), - FLYWHEEL(FlywheelTileEntity::new, AllBlocks.FLYWHEEL), - FURNACE_ENGINE(FurnaceEngineTileEntity::new, AllBlocks.FURNACE_ENGINE), + public static final TileEntityEntry BELT = register( + "belt", BeltTileEntity::new, AllBlocks.BELT); + public static final TileEntityEntry BELT_TUNNEL = register( + "belt_tunnel", BeltTunnelTileEntity::new, AllBlocks.BELT_TUNNEL); + public static final TileEntityEntry MECHANICAL_PISTON = register( + "mechanical_piston", MechanicalPistonTileEntity::new, AllBlocks.MECHANICAL_PISTON, + AllBlocks.STICKY_MECHANICAL_PISTON); + public static final TileEntityEntry MECHANICAL_BEARING = register( + "mechanical_bearing", MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING); + public static final TileEntityEntry CLOCKWORK_BEARING = register( + "clockwork_bearing", ClockworkBearingTileEntity::new, AllBlocks.CLOCKWORK_BEARING); + public static final TileEntityEntry ROPE_PULLEY = register( + "rope_pulley", PulleyTileEntity::new, AllBlocks.ROPE_PULLEY); + public static final TileEntityEntry CHASSIS = register( + "chassis", ChassisTileEntity::new, AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS); + public static final TileEntityEntry DRILL = register( + "drill", DrillTileEntity::new, AllBlocks.MECHANICAL_DRILL); + public static final TileEntityEntry SAW = register( + "saw", SawTileEntity::new, AllBlocks.MECHANICAL_SAW); + public static final TileEntityEntry HARVESTER = register( + "harvester", HarvesterTileEntity::new, AllBlocks.MECHANICAL_HARVESTER); + public static final TileEntityEntry FLYWHEEL = register( + "flywheel", FlywheelTileEntity::new, AllBlocks.FLYWHEEL); + public static final TileEntityEntry FURNACE_ENGINE = register( + "furnace_engine", FurnaceEngineTileEntity::new, AllBlocks.FURNACE_ENGINE); - MILLSTONE(MillstoneTileEntity::new, AllBlocks.MILLSTONE), - CRUSHING_WHEEL(CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL), - CRUSHING_WHEEL_CONTROLLER(CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER), - WATER_WHEEL(WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL), - MECHANICAL_PRESS(MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS), - MECHANICAL_MIXER(MechanicalMixerTileEntity::new, AllBlocks.MECHANICAL_MIXER), - DEPLOYER(DeployerTileEntity::new, AllBlocks.DEPLOYER), - BASIN(BasinTileEntity::new, AllBlocks.BASIN), - MECHANICAL_CRAFTER(MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER), - SEQUENCED_GEARSHIFT(SequencedGearshiftTileEntity::new, AllBlocks.SEQUENCED_GEARSHIFT), - ROTATION_SPEED_CONTROLLER(SpeedControllerTileEntity::new, AllBlocks.ROTATION_SPEED_CONTROLLER), - SPEEDOMETER(SpeedGaugeTileEntity::new, AllBlocks.SPEEDOMETER), - STRESSOMETER(StressGaugeTileEntity::new, AllBlocks.STRESSOMETER), - ANALOG_LEVER(AnalogLeverTileEntity::new, AllBlocks.ANALOG_LEVER), - CART_ASSEMBLER(CartAssemblerTileEntity::new, AllBlocks.CART_ASSEMBLER), + public static final TileEntityEntry MILLSTONE = register( + "millstone", MillstoneTileEntity::new, AllBlocks.MILLSTONE); + public static final TileEntityEntry CRUSHING_WHEEL = register( + "crushing_wheel", CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL); + public static final TileEntityEntry CRUSHING_WHEEL_CONTROLLER = register( + "crushing_wheel_controller", CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER); + public static final TileEntityEntry WATER_WHEEL = register( + "water_wheel", WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL); + public static final TileEntityEntry MECHANICAL_PRESS = register( + "mechanical_press", MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS); + public static final TileEntityEntry MECHANICAL_MIXER = register( + "mechanical_mixer", MechanicalMixerTileEntity::new, AllBlocks.MECHANICAL_MIXER); + public static final TileEntityEntry DEPLOYER = register( + "deployer", DeployerTileEntity::new, AllBlocks.DEPLOYER); + public static final TileEntityEntry BASIN = register( + "basin", BasinTileEntity::new, AllBlocks.BASIN); + public static final TileEntityEntry MECHANICAL_CRAFTER = register( + "mechanical_crafter", MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER); + public static final TileEntityEntry SEQUENCED_GEARSHIFT = register( + "sequenced_gearshift", SequencedGearshiftTileEntity::new, AllBlocks.SEQUENCED_GEARSHIFT); + public static final TileEntityEntry ROTATION_SPEED_CONTROLLER = register( + "rotation_speed_controller", SpeedControllerTileEntity::new, AllBlocks.ROTATION_SPEED_CONTROLLER); + public static final TileEntityEntry SPEEDOMETER = register( + "speedometer", SpeedGaugeTileEntity::new, AllBlocks.SPEEDOMETER); + public static final TileEntityEntry STRESSOMETER = register( + "stressometer", StressGaugeTileEntity::new, AllBlocks.STRESSOMETER); + public static final TileEntityEntry ANALOG_LEVER = register( + "analog_lever", AnalogLeverTileEntity::new, AllBlocks.ANALOG_LEVER); + public static final TileEntityEntry CART_ASSEMBLER = register( + "cart_assembler", CartAssemblerTileEntity::new, AllBlocks.CART_ASSEMBLER); // Logistics - REDSTONE_LINK(RedstoneLinkTileEntity::new, AllBlocks.REDSTONE_LINK), - STOCKPILE_SWITCH(StockpileSwitchTileEntity::new, AllBlocks.STOCKPILE_SWITCH), - ADJUSTABLE_CRATE(AdjustableCrateTileEntity::new, AllBlocks.ADJUSTABLE_CRATE), - CREATIVE_CRATE(CreativeCrateTileEntity::new, AllBlocks.CREATIVE_CRATE), - EXTRACTOR(ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR), - LINKED_EXTRACTOR(LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, - AllBlocks.VERTICAL_LINKED_EXTRACTOR), - TRANSPOSER(TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER), - LINKED_TRANSPOSER(LinkedTransposerTileEntity::new, AllBlocks.LINKED_TRANSPOSER, - AllBlocks.VERTICAL_LINKED_TRANSPOSER), - FUNNEL(FunnelTileEntity::new, AllBlocks.FUNNEL, AllBlocks.VERTICAL_FUNNEL), - BELT_OBSERVER(BeltObserverTileEntity::new, AllBlocks.BELT_OBSERVER), - ADJUSTABLE_REPEATER(AdjustableRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_REPEATER), - ADJUSTABLE_PULSE_REPEATER(AdjustablePulseRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_PULSE_REPEATER), - - ; - - private Supplier supplier; - public TileEntityType type; - private Supplier[] blocks; + public static final TileEntityEntry REDSTONE_LINK = register( + "redstone_link", RedstoneLinkTileEntity::new, AllBlocks.REDSTONE_LINK); + public static final TileEntityEntry STOCKPILE_SWITCH = register( + "stockpile_switch", StockpileSwitchTileEntity::new, AllBlocks.STOCKPILE_SWITCH); + public static final TileEntityEntry ADJUSTABLE_CRATE = register( + "adjustable_crate", AdjustableCrateTileEntity::new, AllBlocks.ADJUSTABLE_CRATE); + public static final TileEntityEntry CREATIVE_CRATE = register( + "creative_crate", CreativeCrateTileEntity::new, AllBlocks.CREATIVE_CRATE); + public static final TileEntityEntry EXTRACTOR = register( + "extractor", ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR); + public static final TileEntityEntry LINKED_EXTRACTOR = register( + "linked_extractor", LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, AllBlocks.VERTICAL_LINKED_EXTRACTOR); + public static final TileEntityEntry TRANSPOSER = register( + "transposer", TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER); + public static final TileEntityEntry LINKED_TRANSPOSER = register( + "linked_transposer", LinkedTransposerTileEntity::new, AllBlocks.LINKED_TRANSPOSER, AllBlocks.VERTICAL_LINKED_TRANSPOSER); + public static final TileEntityEntry FUNNEL = register( + "funnel", FunnelTileEntity::new, AllBlocks.FUNNEL, AllBlocks.VERTICAL_FUNNEL); + public static final TileEntityEntry BELT_OBSERVER = register( + "belt_observer", BeltObserverTileEntity::new, AllBlocks.BELT_OBSERVER); + public static final TileEntityEntry ADJUSTABLE_REPEATER = register( + "adjustable_repeater", AdjustableRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_REPEATER); + public static final TileEntityEntry ADJUSTABLE_PULSE_REPEATER = register( + "adjustable_pulse_repeater", AdjustablePulseRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_PULSE_REPEATER); @SafeVarargs - private AllTileEntities(Supplier supplier, Supplier... blocks) { - this.supplier = supplier; - this.blocks = blocks; - } - - public boolean typeOf(TileEntity te) { - return te.getType() - .equals(type); - } - - public static void register(RegistryEvent.Register> event) { - for (AllTileEntities tileEntity : values()) { - Block[] blocks = new Block[tileEntity.blocks.length]; - for (int i = 0; i < blocks.length; i++) - blocks[i] = tileEntity.blocks[i].get(); - - ResourceLocation resourceLocation = new ResourceLocation(Create.ID, Lang.asId(tileEntity.name())); - tileEntity.type = TileEntityType.Builder.create(tileEntity.supplier, blocks) - .build(null) - .setRegistryName(resourceLocation); - event.getRegistry() - .register(tileEntity.type); - } + public static TileEntityEntry register(String name, NonNullFunction, ? extends T> supplier, NonNullSupplier... blocks) { + return Create.registrate().tileEntity(name, supplier) + .validBlocks(blocks) + .register(); } + // TODO move to TileEntityBuilder#renderer @OnlyIn(Dist.CLIENT) public static void registerRenderers() { bind(SCHEMATICANNON, SchematicannonRenderer::new); @@ -255,13 +280,11 @@ public enum AllTileEntities { bind(ADJUSTABLE_PULSE_REPEATER, AdjustableRepeaterRenderer::new); } - @SuppressWarnings("unchecked") // TODO 1.15 this generic stuff is incompatible with the enum system - need - // strong types @OnlyIn(Dist.CLIENT) - private static void bind(AllTileEntities type, - Function> renderer) { - ClientRegistry.bindTileEntityRenderer((TileEntityType) type.type, - (Function>) renderer); + private static void bind(TileEntityEntry type, + Function> renderer) { + ClientRegistry.bindTileEntityRenderer(type.get(), renderer); } - + + public static void register() {} } diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 7cf99d912..48400db3d 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -61,9 +61,9 @@ public class Create { AllItems.register(); AllPaletteBlocks.register(); AllEntityTypes.register(); + AllTileEntities.register(); modEventBus.addGenericListener(IRecipeSerializer.class, AllRecipeTypes::register); - modEventBus.addGenericListener(TileEntityType.class, AllTileEntities::register); modEventBus.addGenericListener(ContainerType.class, AllContainerTypes::register); modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register); modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java index ed792dced..f7422b3da 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.actors; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; @@ -53,7 +54,7 @@ public class DrillBlock extends DirectionalKineticBlock implements IPortableBloc @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new DrillTileEntity(); + return AllTileEntities.DRILL.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillTileEntity.java index e7c712408..8987a1334 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillTileEntity.java @@ -1,7 +1,6 @@ package com.simibubi.create.content.contraptions.components.actors; -import com.simibubi.create.AllTileEntities; - +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.DamageSource; import net.minecraft.util.math.BlockPos; @@ -9,8 +8,8 @@ public class DrillTileEntity extends BlockBreakingKineticTileEntity { public static DamageSource damageSourceDrill = new DamageSource("create.drill").setDamageBypassesArmor(); - public DrillTileEntity() { - super(AllTileEntities.DRILL.type); + public DrillTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java index 56429c94b..6c5bdee4d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.actors; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; @@ -22,7 +23,7 @@ public class HarvesterBlock extends AttachedActorBlock implements IPortableBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new HarvesterTileEntity(); + return new HarvesterTileEntity(AllTileEntities.HARVESTER.get()); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java index 3436370d8..5f40441f2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterTileEntity.java @@ -1,12 +1,13 @@ package com.simibubi.create.content.contraptions.components.actors; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.tileEntity.SyncedTileEntity; +import net.minecraft.tileentity.TileEntityType; + public class HarvesterTileEntity extends SyncedTileEntity { - public HarvesterTileEntity() { - super(AllTileEntities.HARVESTER.type); + public HarvesterTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java index 65eb7c08a..f0455e019 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.clock; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import net.minecraft.block.Block; @@ -37,7 +38,7 @@ public class CuckooClockBlock extends HorizontalKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new CuckooClockTileEntity(); + return AllTileEntities.CUCKOO_CLOCK.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java index d3c83c4c9..e2cd4fb51 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java @@ -4,7 +4,6 @@ import static com.simibubi.create.foundation.utility.AngleHelper.deg; import static com.simibubi.create.foundation.utility.AngleHelper.getShortestAngleDiff; import static com.simibubi.create.foundation.utility.AngleHelper.rad; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; import com.simibubi.create.foundation.gui.widgets.InterpolatedValue; @@ -14,6 +13,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ParticleTypes; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; @@ -35,8 +35,8 @@ public class CuckooClockTileEntity extends KineticTileEntity { PIG, CREEPER, SURPRISE; } - public CuckooClockTileEntity() { - super(AllTileEntities.CUCKOO_CLOCK.type); + public CuckooClockTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java index 72a60c541..cf916a304 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.crafter; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.content.contraptions.components.crafter.ConnectedInputHandler.ConnectedInput; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity.Phase; @@ -53,7 +54,7 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock implements IT @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new MechanicalCrafterTileEntity(); + return AllTileEntities.MECHANICAL_CRAFTER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java index a1f9c8487..dd65147d7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java @@ -10,7 +10,6 @@ import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.components.crafter.ConnectedInputHandler.ConnectedInput; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterBlock.Pointing; @@ -29,6 +28,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -85,8 +85,8 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { private InsertingBehaviour inserting; private EdgeInteractionBehaviour connectivity; - public MechanicalCrafterTileEntity() { - super(AllTileEntities.MECHANICAL_CRAFTER.type); + public MechanicalCrafterTileEntity(TileEntityType type) { + super(type); setLazyTickRate(20); phase = Phase.IDLE; groupedItemsBeforeCraft = new GroupedItems(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java index 664d6d9e0..54f66dc3c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.crank; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import com.simibubi.create.foundation.block.ITE; @@ -83,7 +84,7 @@ public class HandCrankBlock extends DirectionalKineticBlock implements ITE type) { + super(type); } public void turn(boolean back) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelBlock.java index 7046e6c10..d360bee73 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelBlock.java @@ -4,6 +4,7 @@ import static com.simibubi.create.content.contraptions.components.crusher.Crushi import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; import com.simibubi.create.foundation.block.ITE; @@ -29,7 +30,7 @@ public class CrushingWheelBlock extends RotatedPillarKineticBlock implements ITE @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new CrushingWheelTileEntity(); + return AllTileEntities.CRUSHING_WHEEL.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java index ac28b87a5..f5dc51ac1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.crusher; import java.util.Random; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; @@ -58,7 +59,7 @@ public class CrushingWheelControllerBlock extends Block @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new CrushingWheelControllerTileEntity(); + return AllTileEntities.CRUSHING_WHEEL_CONTROLLER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index 9b00a7f98..ad8179594 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -7,7 +7,6 @@ import java.util.Random; import java.util.UUID; import com.simibubi.create.AllRecipeTypes; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.processing.ProcessingInventory; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.foundation.config.AllConfigs; @@ -26,6 +25,7 @@ import net.minecraft.particles.IParticleData; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.ITickableTileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; @@ -47,8 +47,8 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen private RecipeWrapper wrapper; public float crushingspeed; - public CrushingWheelControllerTileEntity() { - super(AllTileEntities.CRUSHING_WHEEL_CONTROLLER.type); + public CrushingWheelControllerTileEntity(TileEntityType type) { + super(type); inventory = new ProcessingInventory(this::itemInserted) { @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelTileEntity.java index 4c8b563f8..6a50b7366 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelTileEntity.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.contraptions.components.crusher; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; @@ -17,8 +17,8 @@ public class CrushingWheelTileEntity extends KineticTileEntity { public static DamageSource damageSource = new DamageSource("create.crush").setDamageBypassesArmor() .setDifficultyScaled(); - public CrushingWheelTileEntity() { - super(AllTileEntities.CRUSHING_WHEEL.type); + public CrushingWheelTileEntity(TileEntityType type) { + super(type); setLazyTickRate(20); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java index c1604fda5..222fbbbd3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.deployer; import com.simibubi.create.AllItems; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; @@ -34,7 +35,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock implements ITE type) { + super(type); state = State.WAITING; mode = Mode.USE; heldItem = ItemStack.EMPTY; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanBlock.java index 20a8fb794..8030485f5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.fan; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; @@ -25,7 +26,7 @@ public class EncasedFanBlock extends DirectionalKineticBlock implements ITE type) { + super(type); isGenerator = false; airCurrent = new AirCurrent(this); updateAirFlow = true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java index 47b6c4cc6..00c96b4f3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.fan; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ProperDirectionalBlock; @@ -37,7 +38,7 @@ public class NozzleBlock extends ProperDirectionalBlock implements IWrenchable { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new NozzleTileEntity(); + return AllTileEntities.NOZZLE.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java index 885c45e03..bdc9e1dad 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; @@ -16,6 +15,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -32,8 +32,8 @@ public class NozzleTileEntity extends SmartTileEntity { private boolean pushing; private BlockPos fanPos; - public NozzleTileEntity() { - super(AllTileEntities.NOZZLE.type); + public NozzleTileEntity(TileEntityType type) { + super(type); setLazyTickRate(5); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java index 23b04820c..9e6ea5200 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.flywheel; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.foundation.utility.Lang; @@ -33,7 +34,7 @@ public class FlywheelBlock extends HorizontalKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new FlywheelTileEntity(); + return AllTileEntities.FLYWHEEL.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java index 96cb3ef79..b4aa412db 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java @@ -1,10 +1,10 @@ package com.simibubi.create.content.contraptions.components.flywheel; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity; import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.AxisAlignedBB; public class FlywheelTileEntity extends GeneratingKineticTileEntity { @@ -17,8 +17,8 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity { InterpolatedChasingValue visualSpeed = new InterpolatedChasingValue(); float angle; - public FlywheelTileEntity() { - super(AllTileEntities.FLYWHEEL.type); + public FlywheelTileEntity(TileEntityType type) { + super(type); } public void setRotation(float speed, float capacity) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java index a35c1d04f..85a84e172 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.flywheel.engine; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; @@ -46,7 +47,7 @@ public class FurnaceEngineBlock extends EngineBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneBlock.java index 17189f4bd..9296333ee 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.millstone; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticBlock; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; @@ -37,7 +38,7 @@ public class MillstoneBlock extends KineticBlock implements ITE type) { + super(type); inputInv = new ItemStackHandler(1); outputInv = new ItemStackHandler(9); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java index 14edee1a3..b236c0724 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.mixer; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticBlock; import com.simibubi.create.foundation.block.ITE; @@ -24,7 +25,7 @@ public class MechanicalMixerBlock extends KineticBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java index c67338988..32765f9c1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.motor; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import net.minecraft.block.BlockState; @@ -27,7 +28,7 @@ public class CreativeMotorBlock extends DirectionalKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new CreativeMotorTileEntity(); + return AllTileEntities.MOTOR.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorTileEntity.java index 1a2a66f7a..83ccc8421 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/motor/CreativeMotorTileEntity.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.motor; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; @@ -11,13 +10,15 @@ import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollVal import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour.StepContext; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.tileentity.TileEntityType; + public class CreativeMotorTileEntity extends GeneratingKineticTileEntity { public static final int DEFAULT_SPEED = 16; protected ScrollValueBehaviour generatedSpeed; - public CreativeMotorTileEntity() { - super(AllTileEntities.MOTOR.type); + public CreativeMotorTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java index e31dc7273..a844b47df 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressBlock.java @@ -6,6 +6,7 @@ import java.util.Optional; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode; import com.simibubi.create.content.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; @@ -71,7 +72,7 @@ public class MechanicalPressBlock extends HorizontalKineticBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new MechanicalPressTileEntity(); + return AllTileEntities.MECHANICAL_PRESS.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index 1329061c9..f74f9e725 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -6,7 +6,6 @@ import java.util.Optional; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.AllSoundEvents; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInventory; import com.simibubi.create.content.logistics.InWorldProcessing; @@ -25,6 +24,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.NonNullList; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; @@ -64,8 +64,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { public Mode mode; public boolean finished; - public MechanicalPressTileEntity() { - super(AllTileEntities.MECHANICAL_PRESS.type); + public MechanicalPressTileEntity(TileEntityType type) { + super(type); mode = Mode.WORLD; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java index ece9e6f1d..440fbb138 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.saw; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.content.contraptions.components.actors.SawMovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; @@ -59,7 +60,7 @@ public class SawBlock extends DirectionalAxisKineticBlock implements ITE type) { + super(type); inventory = new ProcessingInventory(this::start); inventory.remainingTime = -1; recipeIndex = 0; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java index 11cf6dbcb..d1922b240 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java @@ -43,7 +43,7 @@ public class MountedStorage { } // Split double flexcrates - if (te.getType() == AllTileEntities.ADJUSTABLE_CRATE.type) { + if (AllTileEntities.ADJUSTABLE_CRATE.is(te)) { if (te.getBlockState().get(AdjustableCrateBlock.DOUBLE)) te.getWorld().setBlockState(te.getPos(), te.getBlockState().with(AdjustableCrateBlock.DOUBLE, false)); te.updateContainingBlockInfo(); @@ -105,8 +105,7 @@ public class MountedStorage { public static boolean canUseAsStorage(TileEntity te) { if (te == null) return false; - TileEntityType type = te.getType(); - if (type == AllTileEntities.ADJUSTABLE_CRATE.type) + if (AllTileEntities.ADJUSTABLE_CRATE.is(te)) return true; if (te instanceof ShulkerBoxTileEntity) return true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingBlock.java index 6456c3a44..18112fbfa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.bearing; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.BlockState; @@ -20,7 +21,7 @@ public class ClockworkBearingBlock extends BearingBlock implements ITE type) { + super(type); setLazyTickRate(3); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingBlock.java index 59b46461f..253a49a71 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.bearing; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; @@ -22,7 +23,7 @@ public class MechanicalBearingBlock extends BearingBlock implements ITE movementMode; protected float lastGeneratedSpeed; - public MechanicalBearingTileEntity() { - super(AllTileEntities.MECHANICAL_BEARING.type); + public MechanicalBearingTileEntity(TileEntityType type) { + super(type); isWindmill = false; setLazyTickRate(3); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java index b42e38fcc..339268081 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ch import com.simibubi.create.AllItems; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import net.minecraft.block.BlockState; @@ -37,7 +38,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock implements @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new ChassisTileEntity(); + return AllTileEntities.CHASSIS.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/ChassisTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/ChassisTileEntity.java index a4a37396c..454af89ea 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/ChassisTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/ChassisTileEntity.java @@ -10,7 +10,6 @@ import java.util.List; import java.util.Set; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementTraits; import com.simibubi.create.content.contraptions.components.structureMovement.ChassisRangeDisplay; import com.simibubi.create.foundation.config.AllConfigs; @@ -24,6 +23,7 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -35,8 +35,8 @@ public class ChassisTileEntity extends SmartTileEntity { ScrollValueBehaviour range; - public ChassisTileEntity() { - super(AllTileEntities.CHASSIS.type); + public ChassisTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java index 9c73a924a..3a44dd4d1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.mo import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity.CartMovementMode; import com.simibubi.create.content.contraptions.wrench.IWrenchable; @@ -55,7 +56,7 @@ public class CartAssemblerBlock extends AbstractRailBlock implements ITE movementMode; - public CartAssemblerTileEntity() { - super(AllTileEntities.CART_ASSEMBLER.type); + public CartAssemblerTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java index ca502730b..a9d63a460 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pi import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.config.AllConfigs; @@ -99,7 +100,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock implement @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new MechanicalPistonTileEntity(); + return AllTileEntities.MECHANICAL_PISTON.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index 92e756df4..72d966c48 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -1,7 +1,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.piston; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionCollider; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntity; @@ -12,6 +11,7 @@ import com.simibubi.create.foundation.utility.ServerSpeedProvider; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -24,8 +24,8 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { protected boolean hadCollisionWithOtherPiston; protected int extensionLength; - public MechanicalPistonTileEntity() { - super(AllTileEntities.MECHANICAL_PISTON.type); + public MechanicalPistonTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java index 1c80d317e..4489d5225 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalAxisKineticBlock; import com.simibubi.create.foundation.block.ITE; @@ -35,7 +36,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java index ea800df11..0110bd7b3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.turntable; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticBlock; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.block.ITE; @@ -31,7 +32,7 @@ public class TurntableBlock extends KineticBlock implements ITE type) { + super(type); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java index 27b35b459..5e89056f3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.components.waterwheel; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; @@ -31,7 +32,7 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE flows; - public WaterWheelTileEntity() { - super(AllTileEntities.WATER_WHEEL.type); + public WaterWheelTileEntity(TileEntityType type) { + super(type); flows = new HashMap<>(); for (Direction d : Direction.values()) setFlow(d, 0); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java index b4daafc37..cd43ee148 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.processing; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.block.ITE; @@ -40,7 +41,7 @@ public class BasinBlock extends Block implements ITE, IWrenchab @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new BasinTileEntity(); + return AllTileEntities.BASIN.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java index 915311ed4..121b3e6f4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java @@ -155,7 +155,7 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity { if (!world.isRemote) { SimpleTrigger trigger = AllTriggers.MIXER_MIX; - if (getType() == AllTileEntities.MECHANICAL_PRESS.type) + if (AllTileEntities.MECHANICAL_PRESS.is(this)) trigger = AllTriggers.PRESS_COMPACT; AllTriggers.triggerForNearbyPlayers(trigger, world, pos, 4); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index 0301bb18b..0c9c8febf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -2,13 +2,13 @@ package com.simibubi.create.content.contraptions.processing; import java.util.Optional; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.tileEntity.SyncedTileEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; @@ -91,8 +91,8 @@ public class BasinTileEntity extends SyncedTileEntity implements ITickableTileEn LazyOptional.of(() -> new BasinInventory(inputInventory, outputInventory)); public BasinInputInventory recipeInventory; - public BasinTileEntity() { - super(AllTileEntities.BASIN.type); + public BasinTileEntity(TileEntityType type) { + super(type); contentsChanged = true; recipeInventory = new BasinInputInventory(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerBlock.java index 83a6d203f..a62ee04a3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.relays.advanced; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalAxisKineticBlock; import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock; @@ -21,7 +22,7 @@ public class SpeedControllerBlock extends HorizontalAxisKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new SpeedControllerTileEntity(); + return AllTileEntities.ROTATION_SPEED_CONTROLLER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java index 96f72698f..ed827e517 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.relays.advanced; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.RotationPropagator; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.components.motor.CreativeMotorTileEntity; @@ -14,6 +13,7 @@ import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.Vec3d; @@ -22,8 +22,8 @@ public class SpeedControllerTileEntity extends KineticTileEntity { public static final int DEFAULT_SPEED = 16; protected ScrollValueBehaviour targetSpeed; - public SpeedControllerTileEntity() { - super(AllTileEntities.ROTATION_SPEED_CONTROLLER.type); + public SpeedControllerTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java index 91980dfe3..6c9edacce 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.relays.advanced.sequencer; import com.simibubi.create.AllItems; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalAxisKineticBlock; import com.simibubi.create.content.contraptions.base.KineticBlock; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; @@ -48,7 +49,7 @@ public class SequencedGearshiftBlock extends HorizontalAxisKineticBlock implemen @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new SequencedGearshiftTileEntity(); + return AllTileEntities.SEQUENCED_GEARSHIFT.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java index 2252d195e..717436fd8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java @@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.relays.advanced.sequencer; import java.util.Vector; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraftforge.common.util.Constants.NBT; @@ -16,8 +16,8 @@ public class SequencedGearshiftTileEntity extends SplitShaftTileEntity { int currentInstructionDuration; int timer; - public SequencedGearshiftTileEntity() { - super(AllTileEntities.SEQUENCED_GEARSHIFT.type); + public SequencedGearshiftTileEntity(TileEntityType type) { + super(type); instructions = Instruction.createDefault(); currentInstruction = -1; currentInstructionDuration = -1; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index dd202a31a..62ad662e1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -9,6 +9,7 @@ import org.apache.commons.lang3.mutable.MutableInt; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.content.contraptions.relays.belt.transport.BeltMovementHandler.TransportedEntityInfo; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; @@ -403,7 +404,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE type) { + super(type); controller = BlockPos.ZERO; attachmentTracker = new Tracker(this); itemHandler = LazyOptional.empty(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java index 4d0f48efd..8e1159d21 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.relays.elementary; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; import net.minecraft.block.BlockRenderType; @@ -37,7 +38,7 @@ public class ShaftBlock extends RotatedPillarKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new SimpleKineticTileEntity(); + return AllTileEntities.SIMPLE_KINETIC.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/SimpleKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/SimpleKineticTileEntity.java index fe52aaeff..de86e0acb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/SimpleKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/SimpleKineticTileEntity.java @@ -1,14 +1,14 @@ package com.simibubi.create.content.contraptions.relays.elementary; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.AxisAlignedBB; public class SimpleKineticTileEntity extends KineticTileEntity { - public SimpleKineticTileEntity() { - super(AllTileEntities.SIMPLE_KINETIC.type); + public SimpleKineticTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyBlock.java index 17af83c04..9627a008f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.relays.encased; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.Block; @@ -30,7 +31,7 @@ public class AdjustablePulleyBlock extends EncasedBeltBlock implements ITE type) { + super(type); signal = 0; setLazyTickRate(40); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchBlock.java index fd70a567b..100a6be02 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchBlock.java @@ -1,5 +1,7 @@ package com.simibubi.create.content.contraptions.relays.encased; +import com.simibubi.create.AllTileEntities; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; @@ -15,7 +17,7 @@ public class ClutchBlock extends GearshiftBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new ClutchTileEntity(); + return AllTileEntities.CLUTCH.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchTileEntity.java index 32d2503cb..34f40bf2b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ClutchTileEntity.java @@ -1,14 +1,13 @@ package com.simibubi.create.content.contraptions.relays.encased; -import com.simibubi.create.AllTileEntities; - import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; public class ClutchTileEntity extends SplitShaftTileEntity { - public ClutchTileEntity() { - super(AllTileEntities.CLUTCH.type); + public ClutchTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java index 2c3104e36..0d2ab3fc2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.relays.encased; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; @@ -181,7 +182,7 @@ public class EncasedBeltBlock extends RotatedPillarKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new EncasedShaftTileEntity(); + return AllTileEntities.ENCASED_SHAFT.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftBlock.java index 087a6e924..289bb42b5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.relays.encased; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; import net.minecraft.block.BlockState; @@ -25,7 +26,7 @@ public class EncasedShaftBlock extends RotatedPillarKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new EncasedShaftTileEntity(); + return AllTileEntities.ENCASED_SHAFT.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftTileEntity.java index 7d9583fa1..a34417018 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedShaftTileEntity.java @@ -1,12 +1,13 @@ package com.simibubi.create.content.contraptions.relays.encased; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import net.minecraft.tileentity.TileEntityType; + public class EncasedShaftTileEntity extends KineticTileEntity { - public EncasedShaftTileEntity() { - super(AllTileEntities.ENCASED_SHAFT.type); + public EncasedShaftTileEntity(TileEntityType type) { + super(type); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java index ade9972a1..5a235677b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.relays.encased; import java.util.Random; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.RotationPropagator; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.relays.gearbox.GearshiftTileEntity; @@ -33,7 +34,7 @@ public class GearshiftBlock extends EncasedShaftBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java index 1bb5c7235..66dcbb476 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java @@ -2,19 +2,19 @@ package com.simibubi.create.content.contraptions.relays.gauge; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.IRotate.StressImpact; import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; import com.simibubi.create.foundation.item.ItemDescription; import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.text.TextFormatting; public class StressGaugeTileEntity extends GaugeTileEntity { - public StressGaugeTileEntity() { - super(AllTileEntities.STRESSOMETER.type); + public StressGaugeTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java index f4877d762..7995f758d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; import com.simibubi.create.AllItems; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; import net.minecraft.block.BlockState; @@ -30,7 +31,7 @@ public class GearboxBlock extends RotatedPillarKineticBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new GearboxTileEntity(); + return AllTileEntities.DEPLOYER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxTileEntity.java index 41cd6dee5..e30eee6cc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxTileEntity.java @@ -1,12 +1,13 @@ package com.simibubi.create.content.contraptions.relays.gearbox; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.encased.DirectionalShaftHalvesTileEntity; +import net.minecraft.tileentity.TileEntityType; + public class GearboxTileEntity extends DirectionalShaftHalvesTileEntity { - public GearboxTileEntity() { - super(AllTileEntities.GEARBOX.type); + public GearboxTileEntity(TileEntityType type) { + super(type); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearshiftTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearshiftTileEntity.java index 5ae2e6731..a819022c1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearshiftTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearshiftTileEntity.java @@ -1,15 +1,15 @@ package com.simibubi.create.content.contraptions.relays.gearbox; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity; import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; public class GearshiftTileEntity extends SplitShaftTileEntity { - public GearshiftTileEntity() { - super(AllTileEntities.GEARSHIFT.type); + public GearshiftTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java index 29656f230..bbf38ec79 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Random; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; import com.simibubi.create.content.contraptions.relays.belt.AllBeltAttachments.IBeltAttachment; import com.simibubi.create.content.contraptions.relays.belt.BeltBlock; @@ -60,7 +61,7 @@ public class BeltObserverBlock extends HorizontalBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new BeltObserverTileEntity(); + return AllTileEntities.BELT_OBSERVER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java index 3e7ad9df1..f56148779 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.logistics.block.belts.observer; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverBlock.Mode; @@ -11,6 +10,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; @@ -19,8 +19,8 @@ public class BeltObserverTileEntity extends SmartTileEntity { private FilteringBehaviour filtering; public int turnOffTicks = 0; - public BeltObserverTileEntity() { - super(AllTileEntities.BELT_OBSERVER.type); + public BeltObserverTileEntity(TileEntityType type) { + super(type); setLazyTickRate(20); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java index 0bcc7f48c..4e5b8b9fa 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.List; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.belt.BeltBlock; import com.simibubi.create.content.contraptions.relays.belt.BeltBlock.Slope; import com.simibubi.create.content.contraptions.wrench.IWrenchable; @@ -65,7 +66,7 @@ public class BeltTunnelBlock extends Block implements ITE, @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new BeltTunnelTileEntity(); + return AllTileEntities.BELT_TUNNEL.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java index 4c7429f74..0ea67c232 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java @@ -7,7 +7,6 @@ import java.util.List; import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape; import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; import com.simibubi.create.foundation.tileEntity.SyncedTileEntity; @@ -20,6 +19,7 @@ import net.minecraft.nbt.ListNBT; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -38,8 +38,8 @@ public class BeltTunnelTileEntity extends SyncedTileEntity implements ITickableT private List> flapsToSend; - public BeltTunnelTileEntity() { - super(AllTileEntities.BELT_TUNNEL.type); + public BeltTunnelTileEntity(TileEntityType type) { + super(type); flaps = new HashMap<>(); syncedFlaps = new HashMap<>(); initialize = true; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustablePulseRepeaterTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustablePulseRepeaterTileEntity.java index 504ca1ac0..a3639fd05 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustablePulseRepeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustablePulseRepeaterTileEntity.java @@ -2,12 +2,12 @@ package com.simibubi.create.content.logistics.block.diodes; import static com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterBlock.POWERING; -import com.simibubi.create.AllTileEntities; +import net.minecraft.tileentity.TileEntityType; public class AdjustablePulseRepeaterTileEntity extends AdjustableRepeaterTileEntity { - public AdjustablePulseRepeaterTileEntity() { - super(AllTileEntities.ADJUSTABLE_PULSE_REPEATER.type); + public AdjustablePulseRepeaterTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterBlock.java index 4b76ec5c0..3ba865ded 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.logistics.block.diodes; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -34,8 +35,8 @@ public class AdjustableRepeaterBlock extends AbstractDiodeBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return AllBlocks.ADJUSTABLE_REPEATER.get() == this ? new AdjustableRepeaterTileEntity() - : new AdjustablePulseRepeaterTileEntity(); + return AllBlocks.ADJUSTABLE_REPEATER.is(this) ? AllTileEntities.ADJUSTABLE_REPEATER.create() + : AllTileEntities.ADJUSTABLE_PULSE_REPEATER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java index 3c1ce7e07..96daf1994 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java @@ -5,7 +5,6 @@ import static net.minecraft.block.RedstoneDiodeBlock.POWERED; import java.util.List; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; @@ -22,11 +21,7 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity { public boolean charging; ScrollValueBehaviour maxState; - public AdjustableRepeaterTileEntity() { - this(AllTileEntities.ADJUSTABLE_REPEATER.type); - } - - protected AdjustableRepeaterTileEntity(TileEntityType type) { + public AdjustableRepeaterTileEntity(TileEntityType type) { super(type); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java index 64bd25365..11c53eec1 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.extractor; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.logistics.block.AttachedLogisticalBlock; @@ -61,7 +62,7 @@ public class ExtractorBlock extends BeltAttachableLogisticalBlock implements IPo @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new ExtractorTileEntity(); + return AllTileEntities.EXTRACTOR.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java index ba8da1dea..7f7b2fcd7 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java @@ -3,7 +3,6 @@ package com.simibubi.create.content.logistics.block.extractor; import java.util.List; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.logistics.block.AttachedLogisticalBlock; @@ -33,11 +32,7 @@ public class ExtractorTileEntity extends SmartTileEntity { protected FilteringBehaviour filtering; protected boolean extractingToBelt; - public ExtractorTileEntity() { - this(AllTileEntities.EXTRACTOR.type); - } - - protected ExtractorTileEntity(TileEntityType tileEntityTypeIn) { + public ExtractorTileEntity(TileEntityType tileEntityTypeIn) { super(tileEntityTypeIn); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java index bb4f97ee3..0b027ca9d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.logistics.block.extractor; import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.logistics.block.AttachedLogisticalBlock; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.VecHelper; @@ -31,7 +32,7 @@ public class LinkedExtractorBlock extends ExtractorBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new LinkedExtractorTileEntity(); + return AllTileEntities.LINKED_EXTRACTOR.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorTileEntity.java index 996e610b9..ee01fdb0b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorTileEntity.java @@ -6,18 +6,19 @@ import java.util.List; import org.apache.commons.lang3.tuple.Pair; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkBehaviour; +import net.minecraft.tileentity.TileEntityType; + public class LinkedExtractorTileEntity extends ExtractorTileEntity { public boolean receivedSignal; public LinkBehaviour receiver; - public LinkedExtractorTileEntity() { - super(AllTileEntities.LINKED_EXTRACTOR.type); + public LinkedExtractorTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java index ad77e36c4..62e929c6e 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java @@ -6,6 +6,7 @@ import java.util.List; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.components.structureMovement.IPortableBlock; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; @@ -63,7 +64,7 @@ public class FunnelBlock extends AttachedLogisticalBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new FunnelTileEntity(); + return AllTileEntities.FUNNEL.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java index a517486da..fb2d2f541 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java @@ -4,7 +4,6 @@ import java.util.List; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllSoundEvents; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.logistics.block.AttachedLogisticalBlock; @@ -20,6 +19,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; @@ -32,8 +32,8 @@ public class FunnelTileEntity extends SmartTileEntity { private InsertingBehaviour inserting; private ItemStack justEaten; - public FunnelTileEntity() { - super(AllTileEntities.FUNNEL.type); + public FunnelTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateBlock.java index aec887c45..2d5b0c2af 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.logistics.block.inventories; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.item.ItemHelper; import net.minecraft.block.BlockState; @@ -30,7 +31,7 @@ public class AdjustableCrateBlock extends CrateBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new AdjustableCrateTileEntity(); + return AllTileEntities.ADJUSTABLE_CRATE.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java index 1c94907e1..18a319954 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java @@ -1,7 +1,6 @@ package com.simibubi.create.content.logistics.block.inventories; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllTileEntities; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -62,10 +61,6 @@ public class AdjustableCrateTileEntity extends CrateTileEntity implements INamed public int itemCount; protected LazyOptional invHandler; - public AdjustableCrateTileEntity() { - this(AllTileEntities.ADJUSTABLE_CRATE.type); - } - public AdjustableCrateTileEntity(TileEntityType type) { super(type); allowedAmount = 512; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateBlock.java index eea8b45ab..f83ba35db 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.logistics.block.inventories; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.BlockState; @@ -21,7 +22,7 @@ public class CreativeCrateBlock extends CrateBlock implements ITE type) { + super(type); inv = new CreativeCrateInventory(this); itemHandler = LazyOptional.of(() -> inv); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java index 7793215eb..0daa7cef2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.redstone; import java.util.Random; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import net.minecraft.block.Block; @@ -40,7 +41,7 @@ public class AnalogLeverBlock extends HorizontalFaceBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java index eb5d973a3..666455ea8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.logistics.block.redstone; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.block.ProperDirectionalBlock; @@ -109,7 +110,7 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock implements ITE type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchBlock.java index 89239a931..9ee3dc559 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.redstone; import com.simibubi.create.AllItems; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.gui.ScreenOpener; @@ -151,7 +152,7 @@ public class StockpileSwitchBlock extends HorizontalBlock implements ITE observedInventory; - public StockpileSwitchTileEntity() { - this(AllTileEntities.STOCKPILE_SWITCH.type); - } - public StockpileSwitchTileEntity(TileEntityType typeIn) { super(typeIn); onWhenAbove = .75f; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerBlock.java index 90f6e7fd5..c86246796 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.logistics.block.transposer; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; @@ -24,7 +25,7 @@ public class LinkedTransposerBlock extends TransposerBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new LinkedTransposerTileEntity(); + return AllTileEntities.LINKED_TRANSPOSER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerTileEntity.java index 439f522ef..ee8fbd031 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/transposer/LinkedTransposerTileEntity.java @@ -6,19 +6,20 @@ import java.util.List; import org.apache.commons.lang3.tuple.Pair; -import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.logistics.block.extractor.ExtractorSlots; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkBehaviour; +import net.minecraft.tileentity.TileEntityType; + public class LinkedTransposerTileEntity extends TransposerTileEntity { public boolean receivedSignal; public LinkBehaviour receiver; - public LinkedTransposerTileEntity() { - super(AllTileEntities.LINKED_TRANSPOSER.type); + public LinkedTransposerTileEntity(TileEntityType type) { + super(type); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerBlock.java index 862d31fe6..750df6a95 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.transposer; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.logistics.block.belts.BeltAttachableLogisticalBlock; import net.minecraft.block.Block; @@ -38,7 +39,7 @@ public class TransposerBlock extends BeltAttachableLogisticalBlock { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new TransposerTileEntity(); + return AllTileEntities.TRANSPOSER.create(); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerTileEntity.java index a564cd6ca..67ea6cfec 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/transposer/TransposerTileEntity.java @@ -23,11 +23,7 @@ public class TransposerTileEntity extends ExtractorTileEntity { private InsertingBehaviour inserting; - public TransposerTileEntity() { - this(AllTileEntities.TRANSPOSER.type); - } - - protected TransposerTileEntity(TileEntityType tileEntityTypeIn) { + public TransposerTileEntity(TileEntityType tileEntityTypeIn) { super(tileEntityTypeIn); } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java index d5e375858..15fc62543 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.schematics.block; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; @@ -74,7 +75,7 @@ public class SchematicTableBlock extends HorizontalBlock implements ITE tileEntityTypeIn) { super(tileEntityTypeIn); inventory = new SchematicTableInventory(); diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java index 19646216d..b67ed740b 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.schematics.block; import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; @@ -33,7 +34,7 @@ public class SchematicannonBlock extends Block implements ITE