Rename instance to visual in builders

This commit is contained in:
PepperCode1 2024-05-16 16:35:18 -07:00
parent d28fd7e47b
commit 7d265eb2c1
10 changed files with 96 additions and 105 deletions

View file

@ -220,7 +220,7 @@ public class AllBlockEntityTypes {
// Schematics
public static final BlockEntityEntry<SchematicannonBlockEntity> SCHEMATICANNON = REGISTRATE
.blockEntity("schematicannon", SchematicannonBlockEntity::new)
.instance(() -> SchematicannonVisual::new)
.visual(() -> SchematicannonVisual::new)
.validBlocks(AllBlocks.SCHEMATICANNON)
.renderer(() -> SchematicannonRenderer::new)
.register();
@ -233,28 +233,28 @@ public class AllBlockEntityTypes {
// Kinetics
public static final BlockEntityEntry<BracketedKineticBlockEntity> BRACKETED_KINETIC = REGISTRATE
.blockEntity("simple_kinetic", BracketedKineticBlockEntity::new)
.instance(() -> BracketedKineticBlockEntityVisual::new, false)
.visual(() -> BracketedKineticBlockEntityVisual::new, false)
.validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL)
.renderer(() -> BracketedKineticBlockEntityRenderer::new)
.register();
public static final BlockEntityEntry<CreativeMotorBlockEntity> MOTOR = REGISTRATE
.blockEntity("motor", CreativeMotorBlockEntity::new)
.instance(() -> HalfShaftVisual::new, false)
.visual(() -> HalfShaftVisual::new, false)
.validBlocks(AllBlocks.CREATIVE_MOTOR)
.renderer(() -> CreativeMotorRenderer::new)
.register();
public static final BlockEntityEntry<GearboxBlockEntity> GEARBOX = REGISTRATE
.blockEntity("gearbox", GearboxBlockEntity::new)
.instance(() -> GearboxVisual::new, false)
.visual(() -> GearboxVisual::new, false)
.validBlocks(AllBlocks.GEARBOX)
.renderer(() -> GearboxRenderer::new)
.register();
public static final BlockEntityEntry<KineticBlockEntity> ENCASED_SHAFT = REGISTRATE
.blockEntity("encased_shaft", KineticBlockEntity::new)
.instance(() -> ShaftVisual::new, false)
.visual(() -> ShaftVisual::new, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE,
AllBlocks.METAL_GIRDER_ENCASED_SHAFT)
.renderer(() -> ShaftRenderer::new)
@ -262,28 +262,28 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<SimpleKineticBlockEntity> ENCASED_COGWHEEL = REGISTRATE
.blockEntity("encased_cogwheel", SimpleKineticBlockEntity::new)
.instance(() -> EncasedCogVisual::small, false)
.visual(() -> EncasedCogVisual::small, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL)
.renderer(() -> EncasedCogRenderer::small)
.register();
public static final BlockEntityEntry<SimpleKineticBlockEntity> ENCASED_LARGE_COGWHEEL = REGISTRATE
.blockEntity("encased_large_cogwheel", SimpleKineticBlockEntity::new)
.instance(() -> EncasedCogVisual::large, false)
.visual(() -> EncasedCogVisual::large, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL)
.renderer(() -> EncasedCogRenderer::large)
.register();
public static final BlockEntityEntry<ChainGearshiftBlockEntity> ADJUSTABLE_CHAIN_GEARSHIFT = REGISTRATE
.blockEntity("adjustable_chain_gearshift", ChainGearshiftBlockEntity::new)
.instance(() -> ShaftVisual::new, false)
.visual(() -> ShaftVisual::new, false)
.validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.renderer(() -> ShaftRenderer::new)
.register();
public static final BlockEntityEntry<EncasedFanBlockEntity> ENCASED_FAN = REGISTRATE
.blockEntity("encased_fan", EncasedFanBlockEntity::new)
.instance(() -> FanVisual::new, false)
.visual(() -> FanVisual::new, false)
.validBlocks(AllBlocks.ENCASED_FAN)
.renderer(() -> EncasedFanRenderer::new)
.register();
@ -296,35 +296,35 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<ClutchBlockEntity> CLUTCH = REGISTRATE
.blockEntity("clutch", ClutchBlockEntity::new)
.instance(() -> SplitShaftVisual::new, false)
.visual(() -> SplitShaftVisual::new, false)
.validBlocks(AllBlocks.CLUTCH)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<GearshiftBlockEntity> GEARSHIFT = REGISTRATE
.blockEntity("gearshift", GearshiftBlockEntity::new)
.instance(() -> SplitShaftVisual::new, false)
.visual(() -> SplitShaftVisual::new, false)
.validBlocks(AllBlocks.GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<TurntableBlockEntity> TURNTABLE = REGISTRATE
.blockEntity("turntable", TurntableBlockEntity::new)
.instance(() -> SingleRotatingVisual::new, false)
.visual(() -> SingleRotatingVisual::new, false)
.validBlocks(AllBlocks.TURNTABLE)
.renderer(() -> KineticBlockEntityRenderer::new)
.register();
public static final BlockEntityEntry<HandCrankBlockEntity> HAND_CRANK = REGISTRATE
.blockEntity("hand_crank", HandCrankBlockEntity::new)
.instance(() -> HandCrankVisual::new)
.visual(() -> HandCrankVisual::new)
.validBlocks(AllBlocks.HAND_CRANK)
.renderer(() -> HandCrankRenderer::new)
.register();
public static final BlockEntityEntry<ValveHandleBlockEntity> VALVE_HANDLE = REGISTRATE
.blockEntity("valve_handle", ValveHandleBlockEntity::new)
.instance(() -> HandCrankVisual::new)
.visual(() -> HandCrankVisual::new)
.validBlocks(AllBlocks.COPPER_VALVE_HANDLE)
.validBlocks(AllBlocks.DYED_VALVE_HANDLES.toArray())
.renderer(() -> HandCrankRenderer::new)
@ -332,28 +332,28 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<CuckooClockBlockEntity> CUCKOO_CLOCK = REGISTRATE
.blockEntity("cuckoo_clock", CuckooClockBlockEntity::new)
.instance(() -> HorizontalHalfShaftVisual::new)
.visual(() -> HorizontalHalfShaftVisual::new)
.validBlocks(AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK)
.renderer(() -> CuckooClockRenderer::new)
.register();
public static final BlockEntityEntry<GantryShaftBlockEntity> GANTRY_SHAFT = REGISTRATE
.blockEntity("gantry_shaft", GantryShaftBlockEntity::new)
.instance(() -> SingleRotatingVisual::new, false)
.visual(() -> SingleRotatingVisual::new, false)
.validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticBlockEntityRenderer::new)
.register();
public static final BlockEntityEntry<GantryCarriageBlockEntity> GANTRY_PINION = REGISTRATE
.blockEntity("gantry_pinion", GantryCarriageBlockEntity::new)
.instance(() -> GantryCarriageVisual::new)
.visual(() -> GantryCarriageVisual::new)
.validBlocks(AllBlocks.GANTRY_CARRIAGE)
.renderer(() -> GantryCarriageRenderer::new)
.register();
public static final BlockEntityEntry<PumpBlockEntity> MECHANICAL_PUMP = REGISTRATE
.blockEntity("mechanical_pump", PumpBlockEntity::new)
.instance(() -> PumpCogVisual::new)
.visual(() -> PumpCogVisual::new)
.validBlocks(AllBlocks.MECHANICAL_PUMP)
.renderer(() -> PumpRenderer::new)
.register();
@ -382,7 +382,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<FluidValveBlockEntity> FLUID_VALVE = REGISTRATE
.blockEntity("fluid_valve", FluidValveBlockEntity::new)
.instance(() -> FluidValveVisual::new)
.visual(() -> FluidValveVisual::new)
.validBlocks(AllBlocks.FLUID_VALVE)
.renderer(() -> FluidValveRenderer::new)
.register();
@ -401,7 +401,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<HosePulleyBlockEntity> HOSE_PULLEY = REGISTRATE
.blockEntity("hose_pulley", HosePulleyBlockEntity::new)
.instance(() -> HosePulleyVisual::new)
.visual(() -> HosePulleyVisual::new)
.validBlocks(AllBlocks.HOSE_PULLEY)
.renderer(() -> HosePulleyRenderer::new)
.register();
@ -420,7 +420,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<BeltBlockEntity> BELT = REGISTRATE
.blockEntity("belt", BeltBlockEntity::new)
.instance(() -> BeltVisual::new, BeltBlockEntity::shouldRenderNormally)
.visual(() -> BeltVisual::new, BeltBlockEntity::shouldRenderNormally)
.validBlocks(AllBlocks.BELT)
.renderer(() -> BeltRenderer::new)
.register();
@ -439,21 +439,21 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<BeltTunnelBlockEntity> ANDESITE_TUNNEL = REGISTRATE
.blockEntity("andesite_tunnel", BeltTunnelBlockEntity::new)
.instance(() -> BeltTunnelVisual::new)
.visual(() -> BeltTunnelVisual::new)
.validBlocks(AllBlocks.ANDESITE_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final BlockEntityEntry<BrassTunnelBlockEntity> BRASS_TUNNEL = REGISTRATE
.blockEntity("brass_tunnel", BrassTunnelBlockEntity::new)
.instance(() -> BeltTunnelVisual::new)
.visual(() -> BeltTunnelVisual::new)
.validBlocks(AllBlocks.BRASS_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final BlockEntityEntry<ArmBlockEntity> MECHANICAL_ARM = REGISTRATE
.blockEntity("mechanical_arm", ArmBlockEntity::new)
.instance(() -> ArmVisual::new)
.visual(() -> ArmVisual::new)
.validBlocks(AllBlocks.MECHANICAL_ARM)
.renderer(() -> ArmRenderer::new)
.register();
@ -465,35 +465,35 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<MechanicalPistonBlockEntity> MECHANICAL_PISTON = REGISTRATE
.blockEntity("mechanical_piston", MechanicalPistonBlockEntity::new)
.instance(() -> ShaftVisual::new, false)
.visual(() -> ShaftVisual::new, false)
.validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON)
.renderer(() -> MechanicalPistonRenderer::new)
.register();
public static final BlockEntityEntry<WindmillBearingBlockEntity> WINDMILL_BEARING = REGISTRATE
.blockEntity("windmill_bearing", WindmillBearingBlockEntity::new)
.instance(() -> BearingVisual::new)
.visual(() -> BearingVisual::new)
.validBlocks(AllBlocks.WINDMILL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalBearingBlockEntity> MECHANICAL_BEARING = REGISTRATE
.blockEntity("mechanical_bearing", MechanicalBearingBlockEntity::new)
.instance(() -> BearingVisual::new)
.visual(() -> BearingVisual::new)
.validBlocks(AllBlocks.MECHANICAL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<ClockworkBearingBlockEntity> CLOCKWORK_BEARING = REGISTRATE
.blockEntity("clockwork_bearing", ClockworkBearingBlockEntity::new)
.instance(() -> BearingVisual::new)
.visual(() -> BearingVisual::new)
.validBlocks(AllBlocks.CLOCKWORK_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<PulleyBlockEntity> ROPE_PULLEY = REGISTRATE
.blockEntity("rope_pulley", PulleyBlockEntity::new)
.instance(() -> RopePulleyVisual::new, false)
.visual(() -> RopePulleyVisual::new, false)
.validBlocks(AllBlocks.ROPE_PULLEY)
.renderer(() -> PulleyRenderer::new)
.register();
@ -518,7 +518,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<StickerBlockEntity> STICKER = REGISTRATE
.blockEntity("sticker", StickerBlockEntity::new)
.instance(() -> StickerVisual::new, false)
.visual(() -> StickerVisual::new, false)
.validBlocks(AllBlocks.STICKER)
.renderer(() -> StickerRenderer::new)
.register();
@ -531,14 +531,14 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<DrillBlockEntity> DRILL = REGISTRATE
.blockEntity("drill", DrillBlockEntity::new)
.instance(() -> DrillVisual::new, false)
.visual(() -> DrillVisual::new, false)
.validBlocks(AllBlocks.MECHANICAL_DRILL)
.renderer(() -> DrillRenderer::new)
.register();
public static final BlockEntityEntry<SawBlockEntity> SAW = REGISTRATE
.blockEntity("saw", SawBlockEntity::new)
.instance(() -> SawVisual::new)
.visual(() -> SawVisual::new)
.validBlocks(AllBlocks.MECHANICAL_SAW)
.renderer(() -> SawRenderer::new)
.register();
@ -558,7 +558,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<PortableItemInterfaceBlockEntity> PORTABLE_STORAGE_INTERFACE =
REGISTRATE
.blockEntity("portable_storage_interface", PortableItemInterfaceBlockEntity::new)
.instance(() -> PSIVisual::new)
.visual(() -> PSIVisual::new)
.validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new)
.register();
@ -566,14 +566,14 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<PortableFluidInterfaceBlockEntity> PORTABLE_FLUID_INTERFACE =
REGISTRATE
.blockEntity("portable_fluid_interface", PortableFluidInterfaceBlockEntity::new)
.instance(() -> PSIVisual::new)
.visual(() -> PSIVisual::new)
.validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new)
.register();
public static final BlockEntityEntry<SteamEngineBlockEntity> STEAM_ENGINE = REGISTRATE
.blockEntity("steam_engine", SteamEngineBlockEntity::new)
.instance(() -> SteamEngineVisual::new, false)
.visual(() -> SteamEngineVisual::new, false)
.validBlocks(AllBlocks.STEAM_ENGINE)
.renderer(() -> SteamEngineRenderer::new)
.register();
@ -586,28 +586,28 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<PoweredShaftBlockEntity> POWERED_SHAFT = REGISTRATE
.blockEntity("powered_shaft", PoweredShaftBlockEntity::new)
.instance(() -> SingleRotatingVisual::new, false)
.visual(() -> SingleRotatingVisual::new, false)
.validBlocks(AllBlocks.POWERED_SHAFT)
.renderer(() -> KineticBlockEntityRenderer::new)
.register();
public static final BlockEntityEntry<FlywheelBlockEntity> FLYWHEEL = REGISTRATE
.blockEntity("flywheel", FlywheelBlockEntity::new)
.instance(() -> FlywheelVisual::new, false)
.visual(() -> FlywheelVisual::new, false)
.validBlocks(AllBlocks.FLYWHEEL)
.renderer(() -> FlywheelRenderer::new)
.register();
public static final BlockEntityEntry<MillstoneBlockEntity> MILLSTONE = REGISTRATE
.blockEntity("millstone", MillstoneBlockEntity::new)
.instance(() -> MillstoneCogVisual::new, false)
.visual(() -> MillstoneCogVisual::new, false)
.validBlocks(AllBlocks.MILLSTONE)
.renderer(() -> MillstoneRenderer::new)
.register();
public static final BlockEntityEntry<CrushingWheelBlockEntity> CRUSHING_WHEEL = REGISTRATE
.blockEntity("crushing_wheel", CrushingWheelBlockEntity::new)
.instance(() -> SingleRotatingVisual::new, false)
.visual(() -> SingleRotatingVisual::new, false)
.validBlocks(AllBlocks.CRUSHING_WHEEL)
.renderer(() -> KineticBlockEntityRenderer::new)
.register();
@ -621,35 +621,35 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<WaterWheelBlockEntity> WATER_WHEEL = REGISTRATE
.blockEntity("water_wheel", WaterWheelBlockEntity::new)
.instance(() -> WaterWheelVisual::standard, false)
.visual(() -> WaterWheelVisual::standard, false)
.validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> WaterWheelRenderer::standard)
.register();
public static final BlockEntityEntry<LargeWaterWheelBlockEntity> LARGE_WATER_WHEEL = REGISTRATE
.blockEntity("large_water_wheel", LargeWaterWheelBlockEntity::new)
.instance(() -> WaterWheelVisual::large, false)
.visual(() -> WaterWheelVisual::large, false)
.validBlocks(AllBlocks.LARGE_WATER_WHEEL)
.renderer(() -> WaterWheelRenderer::large)
.register();
public static final BlockEntityEntry<MechanicalPressBlockEntity> MECHANICAL_PRESS = REGISTRATE
.blockEntity("mechanical_press", MechanicalPressBlockEntity::new)
.instance(() -> PressVisual::new)
.visual(() -> PressVisual::new)
.validBlocks(AllBlocks.MECHANICAL_PRESS)
.renderer(() -> MechanicalPressRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalMixerBlockEntity> MECHANICAL_MIXER = REGISTRATE
.blockEntity("mechanical_mixer", MechanicalMixerBlockEntity::new)
.instance(() -> MixerVisual::new)
.visual(() -> MixerVisual::new)
.validBlocks(AllBlocks.MECHANICAL_MIXER)
.renderer(() -> MechanicalMixerRenderer::new)
.register();
public static final BlockEntityEntry<DeployerBlockEntity> DEPLOYER = REGISTRATE
.blockEntity("deployer", DeployerBlockEntity::new)
.instance(() -> DeployerVisual::new)
.visual(() -> DeployerVisual::new)
.validBlocks(AllBlocks.DEPLOYER)
.renderer(() -> DeployerRenderer::new)
.register();
@ -668,42 +668,42 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<MechanicalCrafterBlockEntity> MECHANICAL_CRAFTER = REGISTRATE
.blockEntity("mechanical_crafter", MechanicalCrafterBlockEntity::new)
.instance(() -> ShaftlessCogwheelVisual::new)
.visual(() -> ShaftlessCogwheelVisual::new)
.validBlocks(AllBlocks.MECHANICAL_CRAFTER)
.renderer(() -> MechanicalCrafterRenderer::new)
.register();
public static final BlockEntityEntry<SequencedGearshiftBlockEntity> SEQUENCED_GEARSHIFT = REGISTRATE
.blockEntity("sequenced_gearshift", SequencedGearshiftBlockEntity::new)
.instance(() -> SplitShaftVisual::new, false)
.visual(() -> SplitShaftVisual::new, false)
.validBlocks(AllBlocks.SEQUENCED_GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<SpeedControllerBlockEntity> ROTATION_SPEED_CONTROLLER = REGISTRATE
.blockEntity("rotation_speed_controller", SpeedControllerBlockEntity::new)
.instance(() -> ShaftVisual::new)
.visual(() -> ShaftVisual::new)
.validBlocks(AllBlocks.ROTATION_SPEED_CONTROLLER)
.renderer(() -> SpeedControllerRenderer::new)
.register();
public static final BlockEntityEntry<SpeedGaugeBlockEntity> SPEEDOMETER = REGISTRATE
.blockEntity("speedometer", SpeedGaugeBlockEntity::new)
.instance(() -> GaugeVisual.Speed::new)
.visual(() -> GaugeVisual.Speed::new)
.validBlocks(AllBlocks.SPEEDOMETER)
.renderer(() -> GaugeRenderer::speed)
.register();
public static final BlockEntityEntry<StressGaugeBlockEntity> STRESSOMETER = REGISTRATE
.blockEntity("stressometer", StressGaugeBlockEntity::new)
.instance(() -> GaugeVisual.Stress::new)
.visual(() -> GaugeVisual.Stress::new)
.validBlocks(AllBlocks.STRESSOMETER)
.renderer(() -> GaugeRenderer::stress)
.register();
public static final BlockEntityEntry<AnalogLeverBlockEntity> ANALOG_LEVER = REGISTRATE
.blockEntity("analog_lever", AnalogLeverBlockEntity::new)
.instance(() -> AnalogLeverVisual::new, false)
.visual(() -> AnalogLeverVisual::new, false)
.validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new)
.register();
@ -762,14 +762,14 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<EjectorBlockEntity> WEIGHTED_EJECTOR = REGISTRATE
.blockEntity("weighted_ejector", EjectorBlockEntity::new)
.instance(() -> EjectorVisual::new)
.visual(() -> EjectorVisual::new)
.validBlocks(AllBlocks.WEIGHTED_EJECTOR)
.renderer(() -> EjectorRenderer::new)
.register();
public static final BlockEntityEntry<FunnelBlockEntity> FUNNEL = REGISTRATE
.blockEntity("funnel", FunnelBlockEntity::new)
.instance(() -> FunnelVisual::new)
.visual(() -> FunnelVisual::new)
.validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL,
AllBlocks.ANDESITE_BELT_FUNNEL)
.renderer(() -> FunnelRenderer::new)
@ -783,14 +783,14 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<PulseExtenderBlockEntity> PULSE_EXTENDER = REGISTRATE
.blockEntity("pulse_extender", PulseExtenderBlockEntity::new)
.instance(() -> BrassDiodeVisual::new, false)
.visual(() -> BrassDiodeVisual::new, false)
.validBlocks(AllBlocks.PULSE_EXTENDER)
.renderer(() -> BrassDiodeRenderer::new)
.register();
public static final BlockEntityEntry<PulseRepeaterBlockEntity> PULSE_REPEATER = REGISTRATE
.blockEntity("pulse_repeater", PulseRepeaterBlockEntity::new)
.instance(() -> BrassDiodeVisual::new, false)
.visual(() -> BrassDiodeVisual::new, false)
.validBlocks(AllBlocks.PULSE_REPEATER)
.renderer(() -> BrassDiodeRenderer::new)
.register();
@ -804,7 +804,7 @@ public class AllBlockEntityTypes {
// Curiosities
public static final BlockEntityEntry<BacktankBlockEntity> BACKTANK = REGISTRATE
.blockEntity("backtank", BacktankBlockEntity::new)
.instance(() -> BacktankVisual::new)
.visual(() -> BacktankVisual::new)
.validBlocks(AllBlocks.COPPER_BACKTANK, AllBlocks.NETHERITE_BACKTANK)
.renderer(() -> BacktankRenderer::new)
.register();
@ -823,14 +823,14 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<ToolboxBlockEntity> TOOLBOX = REGISTRATE
.blockEntity("toolbox", ToolboxBlockEntity::new)
.instance(() -> ToolBoxVisual::new, false)
.visual(() -> ToolBoxVisual::new, false)
.validBlocks(AllBlocks.TOOLBOXES.toArray())
.renderer(() -> ToolboxRenderer::new)
.register();
public static final BlockEntityEntry<TrackBlockEntity> TRACK = REGISTRATE
.blockEntity("track", TrackBlockEntity::new)
.instance(() -> TrackVisual::new)
.visual(() -> TrackVisual::new)
.validBlocksDeferred(TrackMaterial::allBlocks)
.renderer(() -> TrackRenderer::new)
.register();
@ -866,7 +866,7 @@ public class AllBlockEntityTypes {
public static final BlockEntityEntry<FlapDisplayBlockEntity> FLAP_DISPLAY = REGISTRATE
.blockEntity("flap_display", FlapDisplayBlockEntity::new)
.instance(() -> ShaftlessCogwheelVisual::new)
.visual(() -> ShaftlessCogwheelVisual::new)
.renderer(() -> FlapDisplayRenderer::new)
.validBlocks(AllBlocks.DISPLAY_BOARD)
.register();

View file

@ -35,21 +35,21 @@ public class AllEntityTypes {
public static final EntityEntry<OrientedContraptionEntity> ORIENTED_CONTRAPTION = contraption("contraption",
OrientedContraptionEntity::new, () -> OrientedContraptionEntityRenderer::new, 5, 3, true)
.instance(() -> ContraptionVisual::new)
.visual(() -> ContraptionVisual::new)
.register();
public static final EntityEntry<ControlledContraptionEntity> CONTROLLED_CONTRAPTION =
contraption("stationary_contraption", ControlledContraptionEntity::new, () -> ContraptionEntityRenderer::new,
20, 40, false)
.instance(() -> ContraptionVisual::new)
.visual(() -> ContraptionVisual::new)
.register();
public static final EntityEntry<GantryContraptionEntity> GANTRY_CONTRAPTION = contraption("gantry_contraption",
GantryContraptionEntity::new, () -> ContraptionEntityRenderer::new, 10, 40, false)
.instance(() -> ContraptionVisual::new)
.visual(() -> ContraptionVisual::new)
.register();
public static final EntityEntry<CarriageContraptionEntity> CARRIAGE_CONTRAPTION =
contraption("carriage_contraption", CarriageContraptionEntity::new,
() -> CarriageContraptionEntityRenderer::new, 15, 3, true)
.instance(() -> CarriageContraptionVisual::new)
.visual(() -> CarriageContraptionVisual::new)
.register();
public static final EntityEntry<SuperGlueEntity> SUPER_GLUE =

View file

@ -18,7 +18,6 @@ import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.client.renderer.Rect2i;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.accesstransformer.Target;
@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault

View file

@ -1,8 +1,8 @@
package com.simibubi.create.content.contraptions.elevator;
import com.jozufozu.flywheel.lib.visual.SimpleDynamicVisual;
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
import com.jozufozu.flywheel.lib.visual.SimpleDynamicVisual;
import com.simibubi.create.content.kinetics.base.ShaftVisual;
// TODO

View file

@ -3,12 +3,12 @@ package com.simibubi.create.content.contraptions.gantry;
import java.util.function.Consumer;
import com.jozufozu.flywheel.api.instance.Instance;
import com.jozufozu.flywheel.lib.visual.SimpleDynamicVisual;
import com.jozufozu.flywheel.api.visual.VisualFrameContext;
import com.jozufozu.flywheel.api.visualization.VisualizationContext;
import com.jozufozu.flywheel.lib.instance.InstanceTypes;
import com.jozufozu.flywheel.lib.instance.TransformedInstance;
import com.jozufozu.flywheel.lib.model.Models;
import com.jozufozu.flywheel.lib.visual.SimpleDynamicVisual;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.kinetics.base.ShaftVisual;

View file

@ -1,11 +1,5 @@
package com.simibubi.create.content.contraptions.render;
import org.joml.Matrix4f;
import org.lwjgl.opengl.GL20;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.phys.AABB;
public class ContraptionProgram {
// protected final int uLightBoxSize;
// protected final int uLightBoxMin;

View file

@ -11,8 +11,8 @@ import com.simibubi.create.content.schematics.cannon.LaunchedItem.ForBlockState;
import com.simibubi.create.content.schematics.cannon.LaunchedItem.ForEntity;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.VirtualRenderHelper;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.VirtualRenderHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;

View file

@ -25,7 +25,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
public class CreateBlockEntityBuilder<T extends BlockEntity, P> extends BlockEntityBuilder<T, P> {
@Nullable
private NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> instanceFactory;
private NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> visualFactory;
private NonNullPredicate<T> renderNormally;
private Collection<NonNullSupplier<? extends Collection<NonNullSupplier<? extends Block>>>> deferredValidBlocks =
@ -56,37 +56,37 @@ public class CreateBlockEntityBuilder<T extends BlockEntity, P> extends BlockEnt
return super.createEntry();
}
public CreateBlockEntityBuilder<T, P> instance(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> instanceFactory) {
return instance(instanceFactory, true);
public CreateBlockEntityBuilder<T, P> visual(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> visualFactory) {
return visual(visualFactory, true);
}
public CreateBlockEntityBuilder<T, P> instance(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> instanceFactory,
public CreateBlockEntityBuilder<T, P> visual(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> visualFactory,
boolean renderNormally) {
return instance(instanceFactory, be -> renderNormally);
return visual(visualFactory, be -> renderNormally);
}
public CreateBlockEntityBuilder<T, P> instance(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> instanceFactory,
public CreateBlockEntityBuilder<T, P> visual(
NonNullSupplier<SimpleBlockEntityVisualizer.Factory<T>> visualFactory,
NonNullPredicate<T> renderNormally) {
if (this.instanceFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance);
if (this.visualFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerVisualizer);
}
this.instanceFactory = instanceFactory;
this.visualFactory = visualFactory;
this.renderNormally = renderNormally;
return this;
}
protected void registerInstance() {
protected void registerVisualizer() {
OneTimeEventReceiver.addModListener(Create.REGISTRATE, FMLClientSetupEvent.class, $ -> {
var instanceFactory = this.instanceFactory;
if (instanceFactory != null) {
var visualFactory = this.visualFactory;
if (visualFactory != null) {
NonNullPredicate<T> renderNormally = this.renderNormally;
SimpleBlockEntityVisualizer.builder(getEntry())
.factory(instanceFactory.get())
.factory(visualFactory.get())
.skipVanillaRender(be -> !renderNormally.test(be))
.apply();
}

View file

@ -23,7 +23,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
public class CreateEntityBuilder<T extends Entity, P> extends EntityBuilder<T, P> {
@Nullable
private NonNullSupplier<SimpleEntityVisualizer.Factory<T>> instanceFactory;
private NonNullSupplier<SimpleEntityVisualizer.Factory<T>> visualFactory;
private NonNullPredicate<T> renderNormally;
public static <T extends Entity, P> EntityBuilder<T, P> create(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback, EntityType.EntityFactory<T> factory, MobCategory classification) {
@ -34,37 +34,35 @@ public class CreateEntityBuilder<T extends Entity, P> extends EntityBuilder<T, P
super(owner, parent, name, callback, factory, classification);
}
public CreateEntityBuilder<T, P> instance(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> instanceFactory) {
return instance(instanceFactory, true);
public CreateEntityBuilder<T, P> visual(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> visualFactory) {
return visual(visualFactory, true);
}
public CreateEntityBuilder<T, P> instance(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> instanceFactory, boolean renderNormally) {
return instance(instanceFactory, be -> renderNormally);
public CreateEntityBuilder<T, P> visual(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> visualFactory, boolean renderNormally) {
return visual(visualFactory, entity -> renderNormally);
}
public CreateEntityBuilder<T, P> instance(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> instanceFactory, NonNullPredicate<T> renderNormally) {
if (this.instanceFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance);
public CreateEntityBuilder<T, P> visual(NonNullSupplier<SimpleEntityVisualizer.Factory<T>> visualFactory, NonNullPredicate<T> renderNormally) {
if (this.visualFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerVisualizer);
}
this.instanceFactory = instanceFactory;
this.visualFactory = visualFactory;
this.renderNormally = renderNormally;
return this;
}
protected void registerInstance() {
protected void registerVisualizer() {
OneTimeEventReceiver.addModListener(Create.REGISTRATE, FMLClientSetupEvent.class, $ -> {
var instanceFactory = this.instanceFactory;
if (instanceFactory != null) {
var visualFactory = this.visualFactory;
if (visualFactory != null) {
NonNullPredicate<T> renderNormally = this.renderNormally;
SimpleEntityVisualizer.builder(getEntry())
.factory(instanceFactory.get())
.skipVanillaRender(be -> !renderNormally.test(be))
.factory(visualFactory.get())
.skipVanillaRender(entity -> !renderNormally.test(entity))
.apply();
}
});
}
}

View file

@ -7,8 +7,8 @@ import javax.annotation.Nullable;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.foundation.placement.PlacementHelpers;
import com.simibubi.create.foundation.render.VirtualRenderHelper;
import com.simibubi.create.foundation.render.SuperRenderTypeBuffer;
import com.simibubi.create.foundation.render.VirtualRenderHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LevelRenderer;