Convert AllTileEntities to Registrate, refactor TE constructors

Update Registrate to build 17
This commit is contained in:
tterrag 2020-06-01 00:33:08 -04:00
parent ea88e8fcf5
commit c486854b7f
110 changed files with 382 additions and 341 deletions

View file

@ -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

View file

@ -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<SchematicannonTileEntity> SCHEMATICANNON = register(
"schematicannon", SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON);
public static final TileEntityEntry<SchematicTableTileEntity> 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<SimpleKineticTileEntity> SIMPLE_KINETIC = register(
"simple_kinetic", SimpleKineticTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL,
AllBlocks.LARGE_COGWHEEL, AllBlocks.ENCASED_SHAFT);
public static final TileEntityEntry<CreativeMotorTileEntity> MOTOR = register(
"motor", CreativeMotorTileEntity::new, AllBlocks.CREATIVE_MOTOR);
public static final TileEntityEntry<GearboxTileEntity> GEARBOX = register(
"gearbox", GearboxTileEntity::new, AllBlocks.GEARBOX);
public static final TileEntityEntry<EncasedShaftTileEntity> ENCASED_SHAFT = register(
"encased_shaft", EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT);
public static final TileEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = register(
"adjustable_pulley", AdjustablePulleyTileEntity::new, AllBlocks.ADJUSTABLE_PULLEY);
public static final TileEntityEntry<EncasedFanTileEntity> ENCASED_FAN = register(
"encased_fan", EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN);
public static final TileEntityEntry<NozzleTileEntity> NOZZLE = register(
"nozzle", NozzleTileEntity::new, AllBlocks.NOZZLE);
public static final TileEntityEntry<ClutchTileEntity> CLUTCH = register(
"clutch", ClutchTileEntity::new, AllBlocks.CLUTCH);
public static final TileEntityEntry<GearshiftTileEntity> GEARSHIFT = register(
"gearshift", GearshiftTileEntity::new, AllBlocks.GEARSHIFT);
public static final TileEntityEntry<TurntableTileEntity> TURNTABLE = register(
"turntable", TurntableTileEntity::new, AllBlocks.TURNTABLE);
public static final TileEntityEntry<HandCrankTileEntity> HAND_CRANK = register(
"hand_crank", HandCrankTileEntity::new, AllBlocks.HAND_CRANK);
public static final TileEntityEntry<CuckooClockTileEntity> 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<BeltTileEntity> BELT = register(
"belt", BeltTileEntity::new, AllBlocks.BELT);
public static final TileEntityEntry<BeltTunnelTileEntity> BELT_TUNNEL = register(
"belt_tunnel", BeltTunnelTileEntity::new, AllBlocks.BELT_TUNNEL);
public static final TileEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = register(
"mechanical_piston", MechanicalPistonTileEntity::new, AllBlocks.MECHANICAL_PISTON,
AllBlocks.STICKY_MECHANICAL_PISTON);
public static final TileEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = register(
"mechanical_bearing", MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING);
public static final TileEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = register(
"clockwork_bearing", ClockworkBearingTileEntity::new, AllBlocks.CLOCKWORK_BEARING);
public static final TileEntityEntry<PulleyTileEntity> ROPE_PULLEY = register(
"rope_pulley", PulleyTileEntity::new, AllBlocks.ROPE_PULLEY);
public static final TileEntityEntry<ChassisTileEntity> CHASSIS = register(
"chassis", ChassisTileEntity::new, AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS);
public static final TileEntityEntry<DrillTileEntity> DRILL = register(
"drill", DrillTileEntity::new, AllBlocks.MECHANICAL_DRILL);
public static final TileEntityEntry<SawTileEntity> SAW = register(
"saw", SawTileEntity::new, AllBlocks.MECHANICAL_SAW);
public static final TileEntityEntry<HarvesterTileEntity> HARVESTER = register(
"harvester", HarvesterTileEntity::new, AllBlocks.MECHANICAL_HARVESTER);
public static final TileEntityEntry<FlywheelTileEntity> FLYWHEEL = register(
"flywheel", FlywheelTileEntity::new, AllBlocks.FLYWHEEL);
public static final TileEntityEntry<FurnaceEngineTileEntity> 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<MillstoneTileEntity> MILLSTONE = register(
"millstone", MillstoneTileEntity::new, AllBlocks.MILLSTONE);
public static final TileEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = register(
"crushing_wheel", CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL);
public static final TileEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER = register(
"crushing_wheel_controller", CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER);
public static final TileEntityEntry<WaterWheelTileEntity> WATER_WHEEL = register(
"water_wheel", WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL);
public static final TileEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = register(
"mechanical_press", MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS);
public static final TileEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = register(
"mechanical_mixer", MechanicalMixerTileEntity::new, AllBlocks.MECHANICAL_MIXER);
public static final TileEntityEntry<DeployerTileEntity> DEPLOYER = register(
"deployer", DeployerTileEntity::new, AllBlocks.DEPLOYER);
public static final TileEntityEntry<BasinTileEntity> BASIN = register(
"basin", BasinTileEntity::new, AllBlocks.BASIN);
public static final TileEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = register(
"mechanical_crafter", MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER);
public static final TileEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = register(
"sequenced_gearshift", SequencedGearshiftTileEntity::new, AllBlocks.SEQUENCED_GEARSHIFT);
public static final TileEntityEntry<SpeedControllerTileEntity> ROTATION_SPEED_CONTROLLER = register(
"rotation_speed_controller", SpeedControllerTileEntity::new, AllBlocks.ROTATION_SPEED_CONTROLLER);
public static final TileEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = register(
"speedometer", SpeedGaugeTileEntity::new, AllBlocks.SPEEDOMETER);
public static final TileEntityEntry<StressGaugeTileEntity> STRESSOMETER = register(
"stressometer", StressGaugeTileEntity::new, AllBlocks.STRESSOMETER);
public static final TileEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = register(
"analog_lever", AnalogLeverTileEntity::new, AllBlocks.ANALOG_LEVER);
public static final TileEntityEntry<CartAssemblerTileEntity> 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<? extends TileEntity> supplier;
public TileEntityType<?> type;
private Supplier<? extends Block>[] blocks;
public static final TileEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = register(
"redstone_link", RedstoneLinkTileEntity::new, AllBlocks.REDSTONE_LINK);
public static final TileEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = register(
"stockpile_switch", StockpileSwitchTileEntity::new, AllBlocks.STOCKPILE_SWITCH);
public static final TileEntityEntry<AdjustableCrateTileEntity> ADJUSTABLE_CRATE = register(
"adjustable_crate", AdjustableCrateTileEntity::new, AllBlocks.ADJUSTABLE_CRATE);
public static final TileEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = register(
"creative_crate", CreativeCrateTileEntity::new, AllBlocks.CREATIVE_CRATE);
public static final TileEntityEntry<ExtractorTileEntity> EXTRACTOR = register(
"extractor", ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR);
public static final TileEntityEntry<LinkedExtractorTileEntity> LINKED_EXTRACTOR = register(
"linked_extractor", LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, AllBlocks.VERTICAL_LINKED_EXTRACTOR);
public static final TileEntityEntry<TransposerTileEntity> TRANSPOSER = register(
"transposer", TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER);
public static final TileEntityEntry<LinkedTransposerTileEntity> LINKED_TRANSPOSER = register(
"linked_transposer", LinkedTransposerTileEntity::new, AllBlocks.LINKED_TRANSPOSER, AllBlocks.VERTICAL_LINKED_TRANSPOSER);
public static final TileEntityEntry<FunnelTileEntity> FUNNEL = register(
"funnel", FunnelTileEntity::new, AllBlocks.FUNNEL, AllBlocks.VERTICAL_FUNNEL);
public static final TileEntityEntry<BeltObserverTileEntity> BELT_OBSERVER = register(
"belt_observer", BeltObserverTileEntity::new, AllBlocks.BELT_OBSERVER);
public static final TileEntityEntry<AdjustableRepeaterTileEntity> ADJUSTABLE_REPEATER = register(
"adjustable_repeater", AdjustableRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_REPEATER);
public static final TileEntityEntry<AdjustablePulseRepeaterTileEntity> ADJUSTABLE_PULSE_REPEATER = register(
"adjustable_pulse_repeater", AdjustablePulseRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_PULSE_REPEATER);
@SafeVarargs
private AllTileEntities(Supplier<? extends TileEntity> supplier, Supplier<? extends Block>... blocks) {
this.supplier = supplier;
this.blocks = blocks;
}
public boolean typeOf(TileEntity te) {
return te.getType()
.equals(type);
}
public static void register(RegistryEvent.Register<TileEntityType<?>> 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 <T extends TileEntity> TileEntityEntry<T> register(String name, NonNullFunction<TileEntityType<T>, ? extends T> supplier, NonNullSupplier<? extends Block>... blocks) {
return Create.registrate().<T>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 <T extends TileEntity> void bind(AllTileEntities type,
Function<? super TileEntityRendererDispatcher, ? extends TileEntityRenderer<?>> renderer) {
ClientRegistry.bindTileEntityRenderer((TileEntityType<T>) type.type,
(Function<TileEntityRendererDispatcher, TileEntityRenderer<T>>) renderer);
private static <T extends TileEntity> void bind(TileEntityEntry<T> type,
Function<? super TileEntityRendererDispatcher, ? extends TileEntityRenderer<? super T>> renderer) {
ClientRegistry.bindTileEntityRenderer(type.get(), renderer);
}
public static void register() {}
}

View file

@ -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);

View file

@ -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

View file

@ -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<? extends DrillTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends HarvesterTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends CuckooClockTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends MechanicalCrafterTileEntity> type) {
super(type);
setLazyTickRate(20);
phase = Phase.IDLE;
groupedItemsBeforeCraft = new GroupedItems();

View file

@ -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<HandC
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new HandCrankTileEntity();
return AllTileEntities.HAND_CRANK.create();
}
@Override

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.contraptions.components.crank;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
public class HandCrankTileEntity extends GeneratingKineticTileEntity {
@ -12,8 +12,8 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity {
public float independentAngle;
public float chasingVelocity;
public HandCrankTileEntity() {
super(AllTileEntities.HAND_CRANK.type);
public HandCrankTileEntity(TileEntityType<? extends HandCrankTileEntity> type) {
super(type);
}
public void turn(boolean back) {

View file

@ -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

View file

@ -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

View file

@ -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<? extends CrushingWheelControllerTileEntity> type) {
super(type);
inventory = new ProcessingInventory(this::itemInserted) {
@Override

View file

@ -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<? extends CrushingWheelTileEntity> type) {
super(type);
setLazyTickRate(20);
}

View file

@ -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<De
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new DeployerTileEntity();
return AllTileEntities.DEPLOYER.create();
}
@Override

View file

@ -12,7 +12,6 @@ import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.curiosities.tools.SandPaperItem;
import com.simibubi.create.foundation.advancement.AllTriggers;
@ -30,6 +29,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
@ -78,8 +78,8 @@ public class DeployerTileEntity extends KineticTileEntity {
PUNCH, USE
}
public DeployerTileEntity() {
super(AllTileEntities.DEPLOYER.type);
public DeployerTileEntity(TileEntityType<? extends DeployerTileEntity> type) {
super(type);
state = State.WAITING;
mode = Mode.USE;
heldItem = ItemStack.EMPTY;

View file

@ -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<Enca
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new EncasedFanTileEntity();
return AllTileEntities.ENCASED_FAN.create();
}
@Override

View file

@ -1,13 +1,13 @@
package com.simibubi.create.content.contraptions.components.fan;
import com.simibubi.create.AllTags.AllBlockTags;
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.config.CKinetics;
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.math.MathHelper;
@ -19,8 +19,8 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity {
protected boolean isGenerator;
protected boolean updateAirFlow;
public EncasedFanTileEntity() {
super(AllTileEntities.ENCASED_FAN.type);
public EncasedFanTileEntity(TileEntityType<? extends EncasedFanTileEntity> type) {
super(type);
isGenerator = false;
airCurrent = new AirCurrent(this);
updateAirFlow = true;

View file

@ -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

View file

@ -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<? extends NozzleTileEntity> type) {
super(type);
setLazyTickRate(5);
}

View file

@ -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

View file

@ -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<? extends FlywheelTileEntity> type) {
super(type);
}
public void setRotation(float speed, float capacity) {

View file

@ -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<FurnaceEngine
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new FurnaceEngineTileEntity();
return AllTileEntities.FURNACE_ENGINE.create();
}
@Override

View file

@ -1,17 +1,17 @@
package com.simibubi.create.content.contraptions.components.flywheel.engine;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.config.AllConfigs;
import net.minecraft.block.AbstractFurnaceBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.tileentity.TileEntityType;
public class FurnaceEngineTileEntity extends EngineTileEntity {
public FurnaceEngineTileEntity() {
super(AllTileEntities.FURNACE_ENGINE.type);
public FurnaceEngineTileEntity(TileEntityType<? extends FurnaceEngineTileEntity> type) {
super(type);
}
@Override

View file

@ -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<MillstoneTileEnt
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new MillstoneTileEntity();
return AllTileEntities.MILLSTONE.create();
}
@Override

View file

@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions.components.millstone;
import java.util.Optional;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.foundation.utility.VecHelper;
@ -11,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.particles.ItemParticleData;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.MathHelper;
@ -30,8 +30,8 @@ public class MillstoneTileEntity extends KineticTileEntity {
public int timer;
private MillingRecipe lastRecipe;
public MillstoneTileEntity() {
super(AllTileEntities.MILLSTONE.type);
public MillstoneTileEntity(TileEntityType<? extends MillstoneTileEntity> type) {
super(type);
inputInv = new ItemStackHandler(1);
outputInv = new ItemStackHandler(9);
}

View file

@ -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<Mechanical
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new MechanicalMixerTileEntity();
return AllTileEntities.MECHANICAL_MIXER.create();
}
@Override

View file

@ -5,7 +5,6 @@ import java.util.LinkedList;
import java.util.List;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity;
import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity;
import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInventory;
@ -23,6 +22,7 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.particles.ItemParticleData;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
@ -40,8 +40,8 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {
public ScrollValueBehaviour minIngredients;
public MechanicalMixerTileEntity() {
super(AllTileEntities.MECHANICAL_MIXER.type);
public MechanicalMixerTileEntity(TileEntityType<? extends MechanicalMixerTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends CreativeMotorTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends MechanicalPressTileEntity> type) {
super(type);
mode = Mode.WORLD;
}

View file

@ -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<SawTile
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new SawTileEntity();
return AllTileEntities.SAW.create();
}
@Override

View file

@ -10,7 +10,6 @@ import java.util.stream.Collectors;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.components.actors.BlockBreakingKineticTileEntity;
import com.simibubi.create.content.contraptions.processing.ProcessingInventory;
import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity;
@ -46,6 +45,7 @@ import net.minecraft.particles.ItemParticleData;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.tags.BlockTags;
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;
@ -65,8 +65,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
private FilteringBehaviour filtering;
private boolean destroyed;
public SawTileEntity() {
super(AllTileEntities.SAW.type);
public SawTileEntity(TileEntityType<? extends SawTileEntity> type) {
super(type);
inventory = new ProcessingInventory(this::start);
inventory.remainingTime = -1;
recipeIndex = 0;

View file

@ -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;

View file

@ -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<Clockwork
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new ClockworkBearingTileEntity();
return AllTileEntities.CLOCKWORK_BEARING.create();
}
@Override

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be
import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
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;
@ -31,8 +31,8 @@ public class ClockworkBearingTileEntity extends KineticTileEntity implements IBe
protected boolean running;
protected boolean assembleNextTick;
public ClockworkBearingTileEntity() {
super(AllTileEntities.CLOCKWORK_BEARING.type);
public ClockworkBearingTileEntity(TileEntityType<? extends ClockworkBearingTileEntity> type) {
super(type);
setLazyTickRate(3);
}

View file

@ -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<Mechanic
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new MechanicalBearingTileEntity();
return AllTileEntities.MECHANICAL_BEARING.create();
}
@Override

View file

@ -4,7 +4,6 @@ import static net.minecraft.state.properties.BlockStateProperties.FACING;
import java.util.List;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntity;
@ -18,6 +17,7 @@ import com.simibubi.create.foundation.utility.ServerSpeedProvider;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
@ -36,8 +36,8 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp
protected ScrollOptionBehaviour<RotationMode> movementMode;
protected float lastGeneratedSpeed;
public MechanicalBearingTileEntity() {
super(AllTileEntities.MECHANICAL_BEARING.type);
public MechanicalBearingTileEntity(TileEntityType<? extends MechanicalBearingTileEntity> type) {
super(type);
isWindmill = false;
setLazyTickRate(3);
}

View file

@ -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

View file

@ -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<? extends ChassisTileEntity> type) {
super(type);
}
@Override

View file

@ -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<CartAss
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new CartAssemblerTileEntity();
return AllTileEntities.CART_ASSEMBLER.create();
}
@Override

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.mo
import java.util.List;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
@ -12,14 +11,15 @@ import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.INamedIco
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollOptionBehaviour;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
public class CartAssemblerTileEntity extends SmartTileEntity {
protected ScrollOptionBehaviour<CartMovementMode> movementMode;
public CartAssemblerTileEntity() {
super(AllTileEntities.CART_ASSEMBLER.type);
public CartAssemblerTileEntity(TileEntityType<? extends CartAssemblerTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends MechanicalPistonTileEntity> type) {
super(type);
}
@Override

View file

@ -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<Pulle
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new PulleyTileEntity();
return AllTileEntities.ROPE_PULLEY.create();
}
@Override

View file

@ -1,7 +1,6 @@
package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
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.ContraptionCollider;
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntity;
@ -12,6 +11,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import net.minecraft.block.Blocks;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -21,8 +21,8 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
protected int initialOffset;
public PulleyTileEntity() {
super(AllTileEntities.ROPE_PULLEY.type);
public PulleyTileEntity(TileEntityType<? extends PulleyTileEntity> type) {
super(type);
}
@Override

View file

@ -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<TurntableTileEnt
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new TurntableTileEntity();
return AllTileEntities.TURNTABLE.create();
}
@Override

View file

@ -1,12 +1,13 @@
package com.simibubi.create.content.contraptions.components.turntable;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import net.minecraft.tileentity.TileEntityType;
public class TurntableTileEntity extends KineticTileEntity {
public TurntableTileEntity() {
super(AllTileEntities.TURNTABLE.type);
public TurntableTileEntity(TileEntityType<? extends TurntableTileEntity> type) {
super(type);
}
}

View file

@ -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<Water
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new WaterWheelTileEntity();
return AllTileEntities.WATER_WHEEL.create();
}
@Override

View file

@ -4,10 +4,10 @@ import java.util.HashMap;
import java.util.Map;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
@ -15,8 +15,8 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity {
private Map<Direction, Float> flows;
public WaterWheelTileEntity() {
super(AllTileEntities.WATER_WHEEL.type);
public WaterWheelTileEntity(TileEntityType<? extends WaterWheelTileEntity> type) {
super(type);
flows = new HashMap<>();
for (Direction d : Direction.values())
setFlow(d, 0);

View file

@ -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<BasinTileEntity>, IWrenchab
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new BasinTileEntity();
return AllTileEntities.BASIN.create();
}
@Override

View file

@ -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);
}

View file

@ -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<? extends BasinTileEntity> type) {
super(type);
contentsChanged = true;
recipeInventory = new BasinInputInventory();
}

View file

@ -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

View file

@ -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<? extends SpeedControllerTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends SequencedGearshiftTileEntity> type) {
super(type);
instructions = Instruction.createDefault();
currentInstruction = -1;
currentInstructionDuration = -1;

View file

@ -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<BeltTileEnt
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new BeltTileEntity();
return AllTileEntities.BELT.create();
}
@Override

View file

@ -14,7 +14,6 @@ import java.util.List;
import java.util.Map;
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.AllBeltAttachments.Tracker;
import com.simibubi.create.content.contraptions.relays.belt.BeltBlock.Part;
@ -33,6 +32,7 @@ import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
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.math.AxisAlignedBB;
@ -58,8 +58,8 @@ public class BeltTileEntity extends KineticTileEntity {
public CompoundNBT trackerUpdateTag;
public BeltTileEntity() {
super(AllTileEntities.BELT.type);
public BeltTileEntity(TileEntityType<? extends BeltTileEntity> type) {
super(type);
controller = BlockPos.ZERO;
attachmentTracker = new Tracker(this);
itemHandler = LazyOptional.empty();

View file

@ -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

View file

@ -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<? extends SimpleKineticTileEntity> type) {
super(type);
}
@Override

View file

@ -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<Adjus
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new AdjustablePulleyTileEntity();
return AllTileEntities.ADJUSTABLE_PULLEY.create();
}
@Override

View file

@ -1,17 +1,17 @@
package com.simibubi.create.content.contraptions.relays.encased;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
public class AdjustablePulleyTileEntity extends KineticTileEntity {
int signal;
boolean signalChanged;
public AdjustablePulleyTileEntity() {
super(AllTileEntities.ADJUSTABLE_PULLEY.type);
public AdjustablePulleyTileEntity(TileEntityType<? extends AdjustablePulleyTileEntity> type) {
super(type);
signal = 0;
setLazyTickRate(40);
}

View file

@ -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

View file

@ -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<? extends ClutchTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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

View file

@ -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<? extends EncasedShaftTileEntity> type) {
super(type);
}
}

View file

@ -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<GearshiftTi
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new GearshiftTileEntity();
return AllTileEntities.GEARSHIFT.create();
}
@Override

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.relays.gauge;
import java.util.Random;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.foundation.utility.ColorHelper;
@ -60,9 +61,9 @@ public class GaugeBlock extends DirectionalAxisKineticBlock {
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
switch (type) {
case SPEED:
return new SpeedGaugeTileEntity();
return AllTileEntities.SPEEDOMETER.create();
case STRESS:
return new StressGaugeTileEntity();
return AllTileEntities.STRESSOMETER.create();
default:
return null;
}

View file

@ -2,7 +2,6 @@ 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.SpeedLevel;
import com.simibubi.create.content.contraptions.goggles.GogglesItem;
import com.simibubi.create.foundation.advancement.AllTriggers;
@ -10,13 +9,14 @@ import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.TextFormatting;
public class SpeedGaugeTileEntity extends GaugeTileEntity{
public SpeedGaugeTileEntity() {
super(AllTileEntities.SPEEDOMETER.type);
public SpeedGaugeTileEntity(TileEntityType<? extends SpeedGaugeTileEntity> type) {
super(type);
}
@Override

View file

@ -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<? extends StressGaugeTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends GearboxTileEntity> type) {
super(type);
}
}

View file

@ -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<? extends GearshiftTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends BeltObserverTileEntity> type) {
super(type);
setLazyTickRate(20);
}

View file

@ -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<BeltTunnelTileEntity>,
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new BeltTunnelTileEntity();
return AllTileEntities.BELT_TUNNEL.create();
}
@Override

View file

@ -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<Pair<Direction, Boolean>> flapsToSend;
public BeltTunnelTileEntity() {
super(AllTileEntities.BELT_TUNNEL.type);
public BeltTunnelTileEntity(TileEntityType<? extends BeltTunnelTileEntity> type) {
super(type);
flaps = new HashMap<>();
syncedFlaps = new HashMap<>();
initialize = true;

View file

@ -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<? extends AdjustablePulseRepeaterTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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<? extends LinkedExtractorTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<? extends FunnelTileEntity> type) {
super(type);
}
@Override

View file

@ -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

View file

@ -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<IItemHandler> invHandler;
public AdjustableCrateTileEntity() {
this(AllTileEntities.ADJUSTABLE_CRATE.type);
}
public AdjustableCrateTileEntity(TileEntityType<?> type) {
super(type);
allowedAmount = 512;

View file

@ -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<CreativeCrateT
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new CreativeCrateTileEntity();
return AllTileEntities.CREATIVE_CRATE.create();
}
@Override

View file

@ -4,7 +4,6 @@ import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
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.filtering.FilteringBehaviour;
@ -13,6 +12,7 @@ import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.common.capabilities.Capability;
@ -22,8 +22,8 @@ import net.minecraftforge.items.IItemHandler;
public class CreativeCrateTileEntity extends CrateTileEntity {
public CreativeCrateTileEntity() {
super(AllTileEntities.CREATIVE_CRATE.type);
public CreativeCrateTileEntity(TileEntityType<? extends CreativeCrateTileEntity> type) {
super(type);
inv = new CreativeCrateInventory(this);
itemHandler = LazyOptional.of(() -> inv);
}

View file

@ -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<AnalogL
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new AnalogLeverTileEntity();
return AllTileEntities.ANALOG_LEVER.create();
}
@Override

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.logistics.block.redstone;
import java.util.List;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
@ -10,6 +9,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.math.MathHelper;
public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggleInformation {
@ -18,8 +18,8 @@ public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggl
int lastChange;
InterpolatedChasingValue clientState = new InterpolatedChasingValue().withSpeed(.2f);
public AnalogLeverTileEntity() {
super(AllTileEntities.ANALOG_LEVER.type);
public AnalogLeverTileEntity(TileEntityType<? extends AnalogLeverTileEntity> type) {
super(type);
}
@Override

View file

@ -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<Red
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new RedstoneLinkTileEntity();
return AllTileEntities.REDSTONE_LINK.create();
}
@Override

View file

@ -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.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
@ -15,6 +14,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkBehaviour;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
@ -25,13 +25,8 @@ public class RedstoneLinkTileEntity extends SmartTileEntity {
private LinkBehaviour link;
private boolean transmitter;
public RedstoneLinkTileEntity() {
super(AllTileEntities.REDSTONE_LINK.type);
}
public RedstoneLinkTileEntity(boolean transmitter) {
this();
this.transmitter = transmitter;
public RedstoneLinkTileEntity(TileEntityType<? extends RedstoneLinkTileEntity> type) {
super(type);
}
@Override

Some files were not shown because too many files have changed in this diff Show more