package com.simibubi.create; import java.util.function.Function; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.components.actors.DrillRenderer; import com.simibubi.create.content.contraptions.components.actors.DrillTileEntity; import com.simibubi.create.content.contraptions.components.actors.HarvesterRenderer; import com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity; import com.simibubi.create.content.contraptions.components.clock.CuckooClockRenderer; import com.simibubi.create.content.contraptions.components.clock.CuckooClockTileEntity; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterRenderer; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity; import com.simibubi.create.content.contraptions.components.crank.HandCrankRenderer; import com.simibubi.create.content.contraptions.components.crank.HandCrankTileEntity; import com.simibubi.create.content.contraptions.components.crusher.CrushingWheelControllerTileEntity; import com.simibubi.create.content.contraptions.components.crusher.CrushingWheelTileEntity; import com.simibubi.create.content.contraptions.components.deployer.DeployerRenderer; import com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity; import com.simibubi.create.content.contraptions.components.fan.EncasedFanRenderer; import com.simibubi.create.content.contraptions.components.fan.EncasedFanTileEntity; import com.simibubi.create.content.contraptions.components.fan.NozzleTileEntity; import com.simibubi.create.content.contraptions.components.flywheel.FlywheelRenderer; import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity; import com.simibubi.create.content.contraptions.components.flywheel.engine.EngineRenderer; import com.simibubi.create.content.contraptions.components.flywheel.engine.FurnaceEngineTileEntity; import com.simibubi.create.content.contraptions.components.millstone.MillstoneRenderer; import com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity; import com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerRenderer; import com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity; import com.simibubi.create.content.contraptions.components.motor.CreativeMotorRenderer; import com.simibubi.create.content.contraptions.components.motor.CreativeMotorTileEntity; import com.simibubi.create.content.contraptions.components.press.MechanicalPressRenderer; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity; import com.simibubi.create.content.contraptions.components.saw.SawRenderer; import com.simibubi.create.content.contraptions.components.saw.SawTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.bearing.BearingRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.bearing.ClockworkBearingTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity; import com.simibubi.create.content.contraptions.components.turntable.TurntableTileEntity; import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelTileEntity; import com.simibubi.create.content.contraptions.processing.BasinRenderer; import com.simibubi.create.content.contraptions.processing.BasinTileEntity; import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerRenderer; import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftTileEntity; import com.simibubi.create.content.contraptions.relays.belt.BeltRenderer; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.contraptions.relays.elementary.SimpleKineticTileEntity; import com.simibubi.create.content.contraptions.relays.encased.AdjustablePulleyTileEntity; import com.simibubi.create.content.contraptions.relays.encased.ClutchTileEntity; import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftRenderer; import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftTileEntity; import com.simibubi.create.content.contraptions.relays.encased.SplitShaftRenderer; import com.simibubi.create.content.contraptions.relays.gauge.GaugeBlock; import com.simibubi.create.content.contraptions.relays.gauge.GaugeRenderer; import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity; import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity; import com.simibubi.create.content.contraptions.relays.gearbox.GearboxRenderer; import com.simibubi.create.content.contraptions.relays.gearbox.GearboxTileEntity; import com.simibubi.create.content.contraptions.relays.gearbox.GearshiftTileEntity; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverRenderer; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverTileEntity; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelRenderer; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelTileEntity; import com.simibubi.create.content.logistics.block.diodes.AdjustablePulseRepeaterTileEntity; import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterRenderer; import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterTileEntity; import com.simibubi.create.content.logistics.block.extractor.ExtractorTileEntity; import com.simibubi.create.content.logistics.block.extractor.LinkedExtractorTileEntity; import com.simibubi.create.content.logistics.block.funnel.FunnelTileEntity; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateTileEntity; import com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity; import com.simibubi.create.content.logistics.block.redstone.AnalogLeverRenderer; import com.simibubi.create.content.logistics.block.redstone.AnalogLeverTileEntity; import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkTileEntity; import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchTileEntity; import com.simibubi.create.content.logistics.block.transposer.LinkedTransposerTileEntity; import com.simibubi.create.content.logistics.block.transposer.TransposerTileEntity; 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.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.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.ClientRegistry; public class AllTileEntities { // Schematics public static final TileEntityEntry SCHEMATICANNON = register( "schematicannon", SchematicannonTileEntity::new, AllBlocks.SCHEMATICANNON); public static final TileEntityEntry SCHEMATIC_TABLE = register( "schematic_table", SchematicTableTileEntity::new, AllBlocks.SCHEMATIC_TABLE); // Kinetics public static final TileEntityEntry SIMPLE_KINETIC = register( "simple_kinetic", SimpleKineticTileEntity::new, AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL, AllBlocks.ENCASED_SHAFT); public static final TileEntityEntry MOTOR = register( "motor", CreativeMotorTileEntity::new, AllBlocks.CREATIVE_MOTOR); public static final TileEntityEntry GEARBOX = register( "gearbox", GearboxTileEntity::new, AllBlocks.GEARBOX); public static final TileEntityEntry ENCASED_SHAFT = register( "encased_shaft", EncasedShaftTileEntity::new, AllBlocks.ENCASED_SHAFT, AllBlocks.ENCASED_BELT); public static final TileEntityEntry ADJUSTABLE_PULLEY = register( "adjustable_pulley", AdjustablePulleyTileEntity::new, AllBlocks.ADJUSTABLE_PULLEY); public static final TileEntityEntry ENCASED_FAN = register( "encased_fan", EncasedFanTileEntity::new, AllBlocks.ENCASED_FAN); public static final TileEntityEntry NOZZLE = register( "nozzle", NozzleTileEntity::new, AllBlocks.NOZZLE); public static final TileEntityEntry CLUTCH = register( "clutch", ClutchTileEntity::new, AllBlocks.CLUTCH); public static final TileEntityEntry GEARSHIFT = register( "gearshift", GearshiftTileEntity::new, AllBlocks.GEARSHIFT); public static final TileEntityEntry TURNTABLE = register( "turntable", TurntableTileEntity::new, AllBlocks.TURNTABLE); public static final TileEntityEntry HAND_CRANK = register( "hand_crank", HandCrankTileEntity::new, AllBlocks.HAND_CRANK); public static final TileEntityEntry CUCKOO_CLOCK = register( "cuckoo_clock", CuckooClockTileEntity::new, AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK); public static final TileEntityEntry BELT = register( "belt", BeltTileEntity::new, AllBlocks.BELT); public static final TileEntityEntry BELT_TUNNEL = register( "belt_tunnel", BeltTunnelTileEntity::new, AllBlocks.BELT_TUNNEL); public static final TileEntityEntry MECHANICAL_PISTON = register( "mechanical_piston", MechanicalPistonTileEntity::new, AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON); public static final TileEntityEntry MECHANICAL_BEARING = register( "mechanical_bearing", MechanicalBearingTileEntity::new, AllBlocks.MECHANICAL_BEARING); public static final TileEntityEntry CLOCKWORK_BEARING = register( "clockwork_bearing", ClockworkBearingTileEntity::new, AllBlocks.CLOCKWORK_BEARING); public static final TileEntityEntry ROPE_PULLEY = register( "rope_pulley", PulleyTileEntity::new, AllBlocks.ROPE_PULLEY); public static final TileEntityEntry CHASSIS = register( "chassis", ChassisTileEntity::new, AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS); public static final TileEntityEntry DRILL = register( "drill", DrillTileEntity::new, AllBlocks.MECHANICAL_DRILL); public static final TileEntityEntry SAW = register( "saw", SawTileEntity::new, AllBlocks.MECHANICAL_SAW); public static final TileEntityEntry HARVESTER = register( "harvester", HarvesterTileEntity::new, AllBlocks.MECHANICAL_HARVESTER); public static final TileEntityEntry FLYWHEEL = register( "flywheel", FlywheelTileEntity::new, AllBlocks.FLYWHEEL); public static final TileEntityEntry FURNACE_ENGINE = register( "furnace_engine", FurnaceEngineTileEntity::new, AllBlocks.FURNACE_ENGINE); public static final TileEntityEntry MILLSTONE = register( "millstone", MillstoneTileEntity::new, AllBlocks.MILLSTONE); public static final TileEntityEntry CRUSHING_WHEEL = register( "crushing_wheel", CrushingWheelTileEntity::new, AllBlocks.CRUSHING_WHEEL); public static final TileEntityEntry CRUSHING_WHEEL_CONTROLLER = register( "crushing_wheel_controller", CrushingWheelControllerTileEntity::new, AllBlocks.CRUSHING_WHEEL_CONTROLLER); public static final TileEntityEntry WATER_WHEEL = register( "water_wheel", WaterWheelTileEntity::new, AllBlocks.WATER_WHEEL); public static final TileEntityEntry MECHANICAL_PRESS = register( "mechanical_press", MechanicalPressTileEntity::new, AllBlocks.MECHANICAL_PRESS); public static final TileEntityEntry MECHANICAL_MIXER = register( "mechanical_mixer", MechanicalMixerTileEntity::new, AllBlocks.MECHANICAL_MIXER); public static final TileEntityEntry DEPLOYER = register( "deployer", DeployerTileEntity::new, AllBlocks.DEPLOYER); public static final TileEntityEntry BASIN = register( "basin", BasinTileEntity::new, AllBlocks.BASIN); public static final TileEntityEntry MECHANICAL_CRAFTER = register( "mechanical_crafter", MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER); public static final TileEntityEntry SEQUENCED_GEARSHIFT = register( "sequenced_gearshift", SequencedGearshiftTileEntity::new, AllBlocks.SEQUENCED_GEARSHIFT); public static final TileEntityEntry ROTATION_SPEED_CONTROLLER = register( "rotation_speed_controller", SpeedControllerTileEntity::new, AllBlocks.ROTATION_SPEED_CONTROLLER); public static final TileEntityEntry SPEEDOMETER = register( "speedometer", SpeedGaugeTileEntity::new, AllBlocks.SPEEDOMETER); public static final TileEntityEntry STRESSOMETER = register( "stressometer", StressGaugeTileEntity::new, AllBlocks.STRESSOMETER); public static final TileEntityEntry ANALOG_LEVER = register( "analog_lever", AnalogLeverTileEntity::new, AllBlocks.ANALOG_LEVER); public static final TileEntityEntry CART_ASSEMBLER = register( "cart_assembler", CartAssemblerTileEntity::new, AllBlocks.CART_ASSEMBLER); // Logistics public static final TileEntityEntry REDSTONE_LINK = register( "redstone_link", RedstoneLinkTileEntity::new, AllBlocks.REDSTONE_LINK); public static final TileEntityEntry STOCKPILE_SWITCH = register( "stockpile_switch", StockpileSwitchTileEntity::new, AllBlocks.STOCKPILE_SWITCH); public static final TileEntityEntry ADJUSTABLE_CRATE = register( "adjustable_crate", AdjustableCrateTileEntity::new, AllBlocks.ADJUSTABLE_CRATE); public static final TileEntityEntry CREATIVE_CRATE = register( "creative_crate", CreativeCrateTileEntity::new, AllBlocks.CREATIVE_CRATE); public static final TileEntityEntry EXTRACTOR = register( "extractor", ExtractorTileEntity::new, AllBlocks.EXTRACTOR, AllBlocks.VERTICAL_EXTRACTOR); public static final TileEntityEntry LINKED_EXTRACTOR = register( "linked_extractor", LinkedExtractorTileEntity::new, AllBlocks.LINKED_EXTRACTOR, AllBlocks.VERTICAL_LINKED_EXTRACTOR); public static final TileEntityEntry TRANSPOSER = register( "transposer", TransposerTileEntity::new, AllBlocks.TRANSPOSER, AllBlocks.VERTICAL_TRANSPOSER); public static final TileEntityEntry LINKED_TRANSPOSER = register( "linked_transposer", LinkedTransposerTileEntity::new, AllBlocks.LINKED_TRANSPOSER, AllBlocks.VERTICAL_LINKED_TRANSPOSER); public static final TileEntityEntry FUNNEL = register( "funnel", FunnelTileEntity::new, AllBlocks.FUNNEL, AllBlocks.VERTICAL_FUNNEL); public static final TileEntityEntry BELT_OBSERVER = register( "belt_observer", BeltObserverTileEntity::new, AllBlocks.BELT_OBSERVER); public static final TileEntityEntry ADJUSTABLE_REPEATER = register( "adjustable_repeater", AdjustableRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_REPEATER); public static final TileEntityEntry ADJUSTABLE_PULSE_REPEATER = register( "adjustable_pulse_repeater", AdjustablePulseRepeaterTileEntity::new, AllBlocks.ADJUSTABLE_PULSE_REPEATER); @SafeVarargs public static TileEntityEntry register(String name, NonNullFunction, ? extends T> supplier, NonNullSupplier... blocks) { return Create.registrate().tileEntity(name, supplier) .validBlocks(blocks) .register(); } // TODO move to TileEntityBuilder#renderer @OnlyIn(Dist.CLIENT) public static void registerRenderers() { bind(SCHEMATICANNON, SchematicannonRenderer::new); bind(SIMPLE_KINETIC, KineticTileEntityRenderer::new); bind(TURNTABLE, KineticTileEntityRenderer::new); bind(MOTOR, CreativeMotorRenderer::new); bind(ENCASED_SHAFT, EncasedShaftRenderer::new); bind(ADJUSTABLE_PULLEY, EncasedShaftRenderer::new); bind(DRILL, DrillRenderer::new); bind(SAW, SawRenderer::new); bind(ENCASED_FAN, EncasedFanRenderer::new); bind(GEARBOX, GearboxRenderer::new); bind(GEARSHIFT, SplitShaftRenderer::new); bind(CLUTCH, SplitShaftRenderer::new); bind(SEQUENCED_GEARSHIFT, SplitShaftRenderer::new); bind(BELT, BeltRenderer::new); bind(WATER_WHEEL, KineticTileEntityRenderer::new); bind(HAND_CRANK, HandCrankRenderer::new); bind(CUCKOO_CLOCK, CuckooClockRenderer::new); bind(ANALOG_LEVER, AnalogLeverRenderer::new); bind(MECHANICAL_PISTON, MechanicalPistonRenderer::new); bind(MECHANICAL_BEARING, BearingRenderer::new); bind(CLOCKWORK_BEARING, BearingRenderer::new); bind(ROPE_PULLEY, PulleyRenderer::new); bind(HARVESTER, HarvesterRenderer::new); bind(MILLSTONE, MillstoneRenderer::new); bind(CRUSHING_WHEEL, KineticTileEntityRenderer::new); bind(MECHANICAL_PRESS, MechanicalPressRenderer::new); bind(MECHANICAL_MIXER, MechanicalMixerRenderer::new); bind(MECHANICAL_CRAFTER, MechanicalCrafterRenderer::new); bind(SPEEDOMETER, disp -> new GaugeRenderer(disp, GaugeBlock.Type.SPEED)); bind(STRESSOMETER, disp -> new GaugeRenderer(disp, GaugeBlock.Type.STRESS)); bind(BASIN, BasinRenderer::new); bind(DEPLOYER, DeployerRenderer::new); bind(FLYWHEEL, FlywheelRenderer::new); bind(FURNACE_ENGINE, EngineRenderer::new); bind(ROTATION_SPEED_CONTROLLER, SpeedControllerRenderer::new); bind(CREATIVE_CRATE, SmartTileEntityRenderer::new); bind(REDSTONE_LINK, SmartTileEntityRenderer::new); bind(EXTRACTOR, SmartTileEntityRenderer::new); bind(LINKED_EXTRACTOR, SmartTileEntityRenderer::new); bind(TRANSPOSER, SmartTileEntityRenderer::new); bind(LINKED_TRANSPOSER, SmartTileEntityRenderer::new); bind(FUNNEL, SmartTileEntityRenderer::new); bind(BELT_TUNNEL, BeltTunnelRenderer::new); bind(BELT_OBSERVER, BeltObserverRenderer::new); bind(ADJUSTABLE_REPEATER, AdjustableRepeaterRenderer::new); bind(ADJUSTABLE_PULSE_REPEATER, AdjustableRepeaterRenderer::new); } @OnlyIn(Dist.CLIENT) private static void bind(TileEntityEntry type, Function> renderer) { ClientRegistry.bindTileEntityRenderer(type.get(), renderer); } public static void register() {} }