Update to Flywheel 0.5.1

This commit is contained in:
PepperCode1 2022-01-03 23:52:36 -08:00
parent cf3dac6ad0
commit c8ba7b88cc
75 changed files with 199 additions and 284 deletions

View file

@ -19,7 +19,7 @@ parchment_version = 2021.12.19
# dependency versions # dependency versions
registrate_version = MC1.18-1.0.21 registrate_version = MC1.18-1.0.21
flywheel_version = 1.18-0.5.0.33 flywheel_version = 1.18-0.5.1.38
jei_minecraft_version = 1.18 jei_minecraft_version = 1.18
jei_version = 9.0.0.40 jei_version = 9.0.0.40

View file

@ -40,7 +40,7 @@ public class AllEntityTypes {
public static final EntityEntry<SuperGlueEntity> SUPER_GLUE = public static final EntityEntry<SuperGlueEntity> SUPER_GLUE =
register("super_glue", SuperGlueEntity::new, () -> SuperGlueRenderer::new, MobCategory.MISC, 10, register("super_glue", SuperGlueEntity::new, () -> SuperGlueRenderer::new, MobCategory.MISC, 10,
Integer.MAX_VALUE, false, true, SuperGlueEntity::build).instance(() -> GlueInstance::new) Integer.MAX_VALUE, false, true, SuperGlueEntity::build).instance(() -> GlueInstance::new, false)
.register(); .register();
public static final EntityEntry<BlueprintEntity> CRAFTING_BLUEPRINT = public static final EntityEntry<BlueprintEntity> CRAFTING_BLUEPRINT =

View file

@ -191,56 +191,56 @@ public class AllTileEntities {
// Kinetics // Kinetics
public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate() public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate()
.tileEntity("simple_kinetic", BracketedKineticTileEntity::new) .tileEntity("simple_kinetic", BracketedKineticTileEntity::new)
.instance(() -> BracketedKineticTileInstance::new) .instance(() -> BracketedKineticTileInstance::new, false)
.validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL) .validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL)
.renderer(() -> BracketedKineticTileRenderer::new) .renderer(() -> BracketedKineticTileRenderer::new)
.register(); .register();
public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate() public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate()
.tileEntity("motor", CreativeMotorTileEntity::new) .tileEntity("motor", CreativeMotorTileEntity::new)
.instance(() -> HalfShaftInstance::new) .instance(() -> HalfShaftInstance::new, false)
.validBlocks(AllBlocks.CREATIVE_MOTOR) .validBlocks(AllBlocks.CREATIVE_MOTOR)
.renderer(() -> CreativeMotorRenderer::new) .renderer(() -> CreativeMotorRenderer::new)
.register(); .register();
public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate() public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate()
.tileEntity("gearbox", GearboxTileEntity::new) .tileEntity("gearbox", GearboxTileEntity::new)
.instance(() -> GearboxInstance::new) .instance(() -> GearboxInstance::new, false)
.validBlocks(AllBlocks.GEARBOX) .validBlocks(AllBlocks.GEARBOX)
.renderer(() -> GearboxRenderer::new) .renderer(() -> GearboxRenderer::new)
.register(); .register();
public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate() public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate()
.tileEntity("encased_shaft", KineticTileEntity::new) .tileEntity("encased_shaft", KineticTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE) .validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE)
.renderer(() -> ShaftRenderer::new) .renderer(() -> ShaftRenderer::new)
.register(); .register();
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate() public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate()
.tileEntity("encased_cogwheel", SimpleKineticTileEntity::new) .tileEntity("encased_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::small) .instance(() -> EncasedCogInstance::small, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL) .validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL)
.renderer(() -> EncasedCogRenderer::small) .renderer(() -> EncasedCogRenderer::small)
.register(); .register();
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = Create.registrate() public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = Create.registrate()
.tileEntity("encased_large_cogwheel", SimpleKineticTileEntity::new) .tileEntity("encased_large_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::large) .instance(() -> EncasedCogInstance::large, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL) .validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL)
.renderer(() -> EncasedCogRenderer::large) .renderer(() -> EncasedCogRenderer::large)
.register(); .register();
public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate() public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate()
.tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new) .tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT) .validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.renderer(() -> ShaftRenderer::new) .renderer(() -> ShaftRenderer::new)
.register(); .register();
public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate() public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate()
.tileEntity("encased_fan", EncasedFanTileEntity::new) .tileEntity("encased_fan", EncasedFanTileEntity::new)
.instance(() -> FanInstance::new) .instance(() -> FanInstance::new, false)
.validBlocks(AllBlocks.ENCASED_FAN) .validBlocks(AllBlocks.ENCASED_FAN)
.renderer(() -> EncasedFanRenderer::new) .renderer(() -> EncasedFanRenderer::new)
.register(); .register();
@ -253,21 +253,21 @@ public class AllTileEntities {
public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate() public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate()
.tileEntity("clutch", ClutchTileEntity::new) .tileEntity("clutch", ClutchTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.CLUTCH) .validBlocks(AllBlocks.CLUTCH)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .register();
public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate() public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate()
.tileEntity("gearshift", GearshiftTileEntity::new) .tileEntity("gearshift", GearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.GEARSHIFT) .validBlocks(AllBlocks.GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .register();
public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate() public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate()
.tileEntity("turntable", TurntableTileEntity::new) .tileEntity("turntable", TurntableTileEntity::new)
.instance(() -> SingleRotatingInstance::new) .instance(() -> SingleRotatingInstance::new, false)
.validBlocks(AllBlocks.TURNTABLE) .validBlocks(AllBlocks.TURNTABLE)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
@ -289,7 +289,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate() public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate()
.tileEntity("gantry_shaft", GantryShaftTileEntity::new) .tileEntity("gantry_shaft", GantryShaftTileEntity::new)
.instance(() -> SingleRotatingInstance::new) .instance(() -> SingleRotatingInstance::new, false)
.validBlocks(AllBlocks.GANTRY_SHAFT) .validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
@ -370,7 +370,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<BeltTileEntity> BELT = Create.registrate() public static final BlockEntityEntry<BeltTileEntity> BELT = Create.registrate()
.tileEntity("belt", BeltTileEntity::new) .tileEntity("belt", BeltTileEntity::new)
.instance(() -> BeltInstance::new) .instance(() -> BeltInstance::new, BeltTileEntity::shouldRenderNormally)
.validBlocks(AllBlocks.BELT) .validBlocks(AllBlocks.BELT)
.renderer(() -> BeltRenderer::new) .renderer(() -> BeltRenderer::new)
.register(); .register();
@ -415,7 +415,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate() public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate()
.tileEntity("mechanical_piston", MechanicalPistonTileEntity::new) .tileEntity("mechanical_piston", MechanicalPistonTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON) .validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON)
.renderer(() -> MechanicalPistonRenderer::new) .renderer(() -> MechanicalPistonRenderer::new)
.register(); .register();
@ -443,7 +443,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate() public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate()
.tileEntity("rope_pulley", PulleyTileEntity::new) .tileEntity("rope_pulley", PulleyTileEntity::new)
.instance(() -> RopePulleyInstance::new) .instance(() -> RopePulleyInstance::new, false)
.validBlocks(AllBlocks.ROPE_PULLEY) .validBlocks(AllBlocks.ROPE_PULLEY)
.renderer(() -> PulleyRenderer::new) .renderer(() -> PulleyRenderer::new)
.register(); .register();
@ -456,14 +456,14 @@ public class AllTileEntities {
public static final BlockEntityEntry<StickerTileEntity> STICKER = Create.registrate() public static final BlockEntityEntry<StickerTileEntity> STICKER = Create.registrate()
.tileEntity("sticker", StickerTileEntity::new) .tileEntity("sticker", StickerTileEntity::new)
.instance(() -> StickerInstance::new) .instance(() -> StickerInstance::new, false)
.validBlocks(AllBlocks.STICKER) .validBlocks(AllBlocks.STICKER)
.renderer(() -> StickerRenderer::new) .renderer(() -> StickerRenderer::new)
.register(); .register();
public static final BlockEntityEntry<DrillTileEntity> DRILL = Create.registrate() public static final BlockEntityEntry<DrillTileEntity> DRILL = Create.registrate()
.tileEntity("drill", DrillTileEntity::new) .tileEntity("drill", DrillTileEntity::new)
.instance(() -> DrillInstance::new) .instance(() -> DrillInstance::new, false)
.validBlocks(AllBlocks.MECHANICAL_DRILL) .validBlocks(AllBlocks.MECHANICAL_DRILL)
.renderer(() -> DrillRenderer::new) .renderer(() -> DrillRenderer::new)
.register(); .register();
@ -496,28 +496,28 @@ public class AllTileEntities {
public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate() public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate()
.tileEntity("flywheel", FlywheelTileEntity::new) .tileEntity("flywheel", FlywheelTileEntity::new)
.instance(() -> FlyWheelInstance::new) .instance(() -> FlyWheelInstance::new, false)
.validBlocks(AllBlocks.FLYWHEEL) .validBlocks(AllBlocks.FLYWHEEL)
.renderer(() -> FlywheelRenderer::new) .renderer(() -> FlywheelRenderer::new)
.register(); .register();
public static final BlockEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate() public static final BlockEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate()
.tileEntity("furnace_engine", FurnaceEngineTileEntity::new) .tileEntity("furnace_engine", FurnaceEngineTileEntity::new)
.instance(() -> EngineInstance::new) .instance(() -> EngineInstance::new, false)
.validBlocks(AllBlocks.FURNACE_ENGINE) .validBlocks(AllBlocks.FURNACE_ENGINE)
.renderer(() -> EngineRenderer::new) .renderer(() -> EngineRenderer::new)
.register(); .register();
public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate() public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate()
.tileEntity("millstone", MillstoneTileEntity::new) .tileEntity("millstone", MillstoneTileEntity::new)
.instance(() -> MillStoneCogInstance::new) .instance(() -> MillStoneCogInstance::new, false)
.validBlocks(AllBlocks.MILLSTONE) .validBlocks(AllBlocks.MILLSTONE)
.renderer(() -> MillstoneRenderer::new) .renderer(() -> MillstoneRenderer::new)
.register(); .register();
public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate() public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
.tileEntity("crushing_wheel", CrushingWheelTileEntity::new) .tileEntity("crushing_wheel", CrushingWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new) .instance(() -> CutoutRotatingInstance::new, false)
.validBlocks(AllBlocks.CRUSHING_WHEEL) .validBlocks(AllBlocks.CRUSHING_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
@ -531,7 +531,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate() public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
.tileEntity("water_wheel", WaterWheelTileEntity::new) .tileEntity("water_wheel", WaterWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new) .instance(() -> CutoutRotatingInstance::new, false)
.validBlocks(AllBlocks.WATER_WHEEL) .validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
@ -578,7 +578,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate() public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate()
.tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new) .tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.SEQUENCED_GEARSHIFT) .validBlocks(AllBlocks.SEQUENCED_GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .register();
@ -606,7 +606,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate() public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate()
.tileEntity("analog_lever", AnalogLeverTileEntity::new) .tileEntity("analog_lever", AnalogLeverTileEntity::new)
.instance(() -> AnalogLeverInstance::new) .instance(() -> AnalogLeverInstance::new, false)
.validBlocks(AllBlocks.ANALOG_LEVER) .validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new) .renderer(() -> AnalogLeverRenderer::new)
.register(); .register();
@ -672,7 +672,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate() public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate()
.tileEntity("pulse_extender", PulseExtenderTileEntity::new) .tileEntity("pulse_extender", PulseExtenderTileEntity::new)
.instance(() -> BrassDiodeInstance::new) .instance(() -> BrassDiodeInstance::new, false)
.validBlocks(AllBlocks.PULSE_EXTENDER) .validBlocks(AllBlocks.PULSE_EXTENDER)
.renderer(() -> BrassDiodeRenderer::new) .renderer(() -> BrassDiodeRenderer::new)
.register(); .register();
@ -680,7 +680,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER = public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER =
Create.registrate() Create.registrate()
.tileEntity("pulse_repeater", PulseRepeaterTileEntity::new) .tileEntity("pulse_repeater", PulseRepeaterTileEntity::new)
.instance(() -> BrassDiodeInstance::new) .instance(() -> BrassDiodeInstance::new, false)
.validBlocks(AllBlocks.PULSE_REPEATER) .validBlocks(AllBlocks.PULSE_REPEATER)
.renderer(() -> BrassDiodeRenderer::new) .renderer(() -> BrassDiodeRenderer::new)
.register(); .register();
@ -714,7 +714,7 @@ public class AllTileEntities {
public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate() public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate()
.tileEntity("toolbox", ToolboxTileEntity::new) .tileEntity("toolbox", ToolboxTileEntity::new)
.instance(() -> ToolBoxInstance::new) .instance(() -> ToolBoxInstance::new, false)
.validBlocks(AllBlocks.TOOLBOXES.toArray()) .validBlocks(AllBlocks.TOOLBOXES.toArray())
.renderer(() -> ToolboxRenderer::new) .renderer(() -> ToolboxRenderer::new)
.register(); .register();

View file

@ -12,6 +12,6 @@ public class BackHalfShaftInstance extends HalfShaftInstance {
@Override @Override
protected Direction getShaftDirection() { protected Direction getShaftDirection() {
return tile.getBlockState().getValue(BlockStateProperties.FACING).getOpposite(); return blockEntity.getBlockState().getValue(BlockStateProperties.FACING).getOpposite();
} }
} }

View file

@ -7,7 +7,6 @@ import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.KineticNetwork; import com.simibubi.create.content.contraptions.KineticNetwork;
@ -49,7 +48,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
public class KineticTileEntity extends SmartTileEntity public class KineticTileEntity extends SmartTileEntity
implements IHaveGoggleInformation, IHaveHoveringInformation, FlywheelRendered { implements IHaveGoggleInformation, IHaveHoveringInformation {
public @Nullable Long network; public @Nullable Long network;
public @Nullable BlockPos source; public @Nullable BlockPos source;

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel; import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
@ -12,7 +12,7 @@ import com.simibubi.create.foundation.render.AllMaterialSpecs;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public abstract class KineticTileInstance<T extends KineticTileEntity> extends TileEntityInstance<T> { public abstract class KineticTileInstance<T extends KineticTileEntity> extends BlockEntityInstance<T> {
protected final Direction.Axis axis; protected final Direction.Axis axis;
@ -38,7 +38,7 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends T
instance.setRotationAxis(axis) instance.setRotationAxis(axis)
.setRotationOffset(getRotationOffset(axis)) .setRotationOffset(getRotationOffset(axis))
.setRotationalSpeed(speed) .setRotationalSpeed(speed)
.setColor(tile); .setColor(blockEntity);
} }
protected final RotatingData setup(RotatingData key) { protected final RotatingData setup(RotatingData key) {
@ -57,7 +57,7 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends T
key.setRotationAxis(axis) key.setRotationAxis(axis)
.setRotationalSpeed(speed) .setRotationalSpeed(speed)
.setRotationOffset(getRotationOffset(axis)) .setRotationOffset(getRotationOffset(axis))
.setColor(tile) .setColor(blockEntity)
.setPosition(getInstancePosition()); .setPosition(getInstancePosition());
return key; return key;
@ -78,7 +78,7 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends T
} }
protected float getTileSpeed() { protected float getTileSpeed() {
return tile.getSpeed(); return blockEntity.getSpeed();
} }
protected BlockState shaft() { protected BlockState shaft() {

View file

@ -19,7 +19,7 @@ public class DrillInstance extends SingleRotatingInstance {
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
BlockState referenceState = tile.getBlockState(); BlockState referenceState = blockEntity.getBlockState();
Direction facing = referenceState.getValue(BlockStateProperties.FACING); Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.DRILL_HEAD, referenceState, facing); return getRotatingMaterial().getModel(AllBlockPartials.DRILL_HEAD, referenceState, facing);
} }

View file

@ -187,9 +187,4 @@ public class CuckooClockTileEntity extends KineticTileEntity {
Vec3 vec = VecHelper.getCenterOf(worldPosition); Vec3 vec = VecHelper.getCenterOf(worldPosition);
level.playLocalSound(vec.x, vec.y, vec.z, sound, SoundSource.BLOCKS, volume, pitch, false); level.playLocalSound(vec.x, vec.y, vec.z, sound, SoundSource.BLOCKS, volume, pitch, false);
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -523,11 +523,6 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
return inventory; return inventory;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public void setScriptedResult(ItemStack scriptedResult) { public void setScriptedResult(ItemStack scriptedResult) {
this.scriptedResult = scriptedResult; this.scriptedResult = scriptedResult;
} }

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.crank;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
@ -12,7 +12,7 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
public class HandCrankInstance extends SingleRotatingInstance implements IDynamicInstance { public class HandCrankInstance extends SingleRotatingInstance implements DynamicInstance {
private final HandCrankTileEntity tile; private final HandCrankTileEntity tile;
private ModelData crank; private ModelData crank;

View file

@ -79,11 +79,6 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity {
return AllBlocks.HAND_CRANK.get(); return AllBlocks.HAND_CRANK.get();
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
@Override @Override
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void tickAudio() { public void tickAudio() {

View file

@ -4,8 +4,8 @@ import static com.simibubi.create.content.contraptions.base.DirectionalAxisKinet
import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING; import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.api.instance.TickableInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
@ -20,7 +20,7 @@ import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i; import net.minecraft.core.Vec3i;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public class DeployerInstance extends ShaftInstance implements IDynamicInstance, ITickableInstance { public class DeployerInstance extends ShaftInstance implements DynamicInstance, TickableInstance {
final DeployerTileEntity tile; final DeployerTileEntity tile;
final Direction facing; final Direction facing;
@ -39,7 +39,7 @@ public class DeployerInstance extends ShaftInstance implements IDynamicInstance,
public DeployerInstance(MaterialManager dispatcher, KineticTileEntity tile) { public DeployerInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
this.tile = (DeployerTileEntity) super.tile; this.tile = (DeployerTileEntity) super.blockEntity;
facing = blockState.getValue(FACING); facing = blockState.getValue(FACING);
boolean rotatePole = blockState.getValue(AXIS_ALONG_FIRST_COORDINATE) ^ facing.getAxis() == Direction.Axis.Z; boolean rotatePole = blockState.getValue(AXIS_ALONG_FIRST_COORDINATE) ^ facing.getAxis() == Direction.Axis.Z;

View file

@ -424,11 +424,6 @@ public class DeployerTileEntity extends KineticTileEntity {
return true; return true;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public float getHandOffset(float partialTicks) { public float getHandOffset(float partialTicks) {
if (isVirtual()) if (isVirtual())
return animatedOffset.getValue(partialTicks); return animatedOffset.getValue(partialTicks);

View file

@ -36,7 +36,7 @@ public class FanInstance extends KineticTileInstance<EncasedFanTileEntity> {
} }
private float getFanSpeed() { private float getFanSpeed() {
float speed = tile.getSpeed() * 5; float speed = blockEntity.getSpeed() * 5;
if (speed > 0) if (speed > 0)
speed = Mth.clamp(speed, 80, 64 * 20); speed = Mth.clamp(speed, 80, 64 * 20);
if (speed < 0) if (speed < 0)

View file

@ -10,7 +10,7 @@ import com.jozufozu.flywheel.api.InstanceData;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -25,7 +25,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> implements IDynamicInstance { public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> implements DynamicInstance {
protected final Direction facing; protected final Direction facing;
protected final Direction connection; protected final Direction connection;
@ -90,8 +90,8 @@ public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> im
float partialTicks = AnimationTickHolder.getPartialTicks(); float partialTicks = AnimationTickHolder.getPartialTicks();
float speed = tile.visualSpeed.get(partialTicks) * 3 / 10f; float speed = blockEntity.visualSpeed.get(partialTicks) * 3 / 10f;
float angle = tile.angle + speed * partialTicks; float angle = blockEntity.angle + speed * partialTicks;
if (Math.abs(angle - lastAngle) < 0.001) if (Math.abs(angle - lastAngle) < 0.001)
return; return;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.flywheel.engine; package com.simibubi.create.content.contraptions.components.flywheel.engine;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -10,7 +10,7 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
public class EngineInstance extends TileEntityInstance<EngineTileEntity> { public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
protected ModelData frame; protected ModelData frame;

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.flywheel.engine;
import java.util.List; import java.util.List;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock; import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity; import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
@ -18,7 +17,7 @@ import net.minecraft.world.phys.AABB;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
public class EngineTileEntity extends SmartTileEntity implements FlywheelRendered { public class EngineTileEntity extends SmartTileEntity {
public float appliedCapacity; public float appliedCapacity;
public float appliedSpeed; public float appliedSpeed;

View file

@ -15,6 +15,6 @@ public class MillStoneCogInstance extends SingleRotatingInstance {
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
return getRotatingMaterial().getModel(AllBlockPartials.MILLSTONE_COG, tile.getBlockState()); return getRotatingMaterial().getModel(AllBlockPartials.MILLSTONE_COG, blockEntity.getBlockState());
} }
} }

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.mixer;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -12,7 +12,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
public class MixerInstance extends EncasedCogInstance implements IDynamicInstance { public class MixerInstance extends EncasedCogInstance implements DynamicInstance {
private final RotatingData mixerHead; private final RotatingData mixerHead;
private final OrientedData mixerPole; private final OrientedData mixerPole;
@ -42,7 +42,7 @@ public class MixerInstance extends EncasedCogInstance implements IDynamicInstanc
protected Instancer<RotatingData> getCogModel() { protected Instancer<RotatingData> getCogModel() {
return materialManager.defaultSolid() return materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING) .material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, tile.getBlockState()); .getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, blockEntity.getBlockState());
} }
@Override @Override

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.press; package com.simibubi.create.content.contraptions.components.press;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
@ -11,7 +11,7 @@ import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
public class PressInstance extends ShaftInstance implements IDynamicInstance { public class PressInstance extends ShaftInstance implements DynamicInstance {
private final OrientedData pressHead; private final OrientedData pressHead;
private final MechanicalPressTileEntity press; private final MechanicalPressTileEntity press;

View file

@ -23,7 +23,7 @@ public class SawInstance extends SingleRotatingInstance {
if (blockState.getValue(BlockStateProperties.FACING) if (blockState.getValue(BlockStateProperties.FACING)
.getAxis() .getAxis()
.isHorizontal()) { .isHorizontal()) {
BlockState referenceState = blockState.rotate(tile.getLevel(), tile.getBlockPos(), Rotation.CLOCKWISE_180); BlockState referenceState = blockState.rotate(blockEntity.getLevel(), blockEntity.getBlockPos(), Rotation.CLOCKWISE_180);
Direction facing = referenceState.getValue(BlockStateProperties.FACING); Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, referenceState, facing); return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, referenceState, facing);
} else { } else {

View file

@ -499,9 +499,4 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
return false; return false;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement.bearing; package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
@ -15,7 +15,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
public class BearingInstance<B extends KineticTileEntity & IBearingTileEntity> extends BackHalfShaftInstance implements IDynamicInstance { public class BearingInstance<B extends KineticTileEntity & IBearingTileEntity> extends BackHalfShaftInstance implements DynamicInstance {
final B bearing; final B bearing;
final OrientedData topInstance; final OrientedData topInstance;

View file

@ -420,11 +420,6 @@ public class ClockworkBearingTileEntity extends KineticTileEntity
return worldPosition; return worldPosition;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public void setAngle(float forcedAngle) { public void setAngle(float forcedAngle) {
hourAngle = forcedAngle; hourAngle = forcedAngle;
} }

View file

@ -321,11 +321,6 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity
return true; return true;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public void setAngle(float forcedAngle) { public void setAngle(float forcedAngle) {
angle = forcedAngle; angle = forcedAngle;
} }

View file

@ -1,8 +1,8 @@
package com.simibubi.create.content.contraptions.components.structureMovement.chassis; package com.simibubi.create.content.contraptions.components.structureMovement.chassis;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -12,7 +12,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public class StickerInstance extends TileEntityInstance<StickerTileEntity> implements IDynamicInstance { public class StickerInstance extends BlockEntityInstance<StickerTileEntity> implements DynamicInstance {
float lastOffset = Float.NaN; float lastOffset = Float.NaN;
final Direction facing; final Direction facing;
@ -35,7 +35,7 @@ public class StickerInstance extends TileEntityInstance<StickerTileEntity> imple
@Override @Override
public void beginFrame() { public void beginFrame() {
float offset = tile.piston.getValue(AnimationTickHolder.getPartialTicks()); float offset = blockEntity.piston.getValue(AnimationTickHolder.getPartialTicks());
if (fakeWorld) if (fakeWorld)
offset = this.offset; offset = this.offset;
@ -51,7 +51,7 @@ public class StickerInstance extends TileEntityInstance<StickerTileEntity> imple
private void animateHead(float offset) { private void animateHead(float offset) {
head.loadIdentity() head.loadIdentity()
.translate(getInstancePosition()) .translate(getInstancePosition())
.nudge(tile.hashCode()) .nudge(blockEntity.hashCode())
.centre() .centre()
.rotateY(AngleHelper.horizontalAngle(facing)) .rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing) + 90) .rotateX(AngleHelper.verticalAngle(facing) + 90)

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ch
import java.util.List; import java.util.List;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents; import com.simibubi.create.AllSoundEvents;
@ -23,7 +22,7 @@ import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
public class StickerTileEntity extends SmartTileEntity implements FlywheelRendered { public class StickerTileEntity extends SmartTileEntity {
LerpedFloat piston; LerpedFloat piston;
boolean update; boolean update;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement.gantry; package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -14,7 +14,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public class GantryCarriageInstance extends ShaftInstance implements IDynamicInstance { public class GantryCarriageInstance extends ShaftInstance implements DynamicInstance {
private final ModelData gantryCogs; private final ModelData gantryCogs;
@ -56,7 +56,7 @@ public class GantryCarriageInstance extends ShaftInstance implements IDynamicIns
} }
private float getCogAngle() { private float getCogAngle() {
return GantryCarriageRenderer.getAngleForTe(tile, visualPos, rotationAxis) * rotationMult; return GantryCarriageRenderer.getAngleForTe(blockEntity, visualPos, rotationAxis) * rotationMult;
} }
private void animateCogs(float cogAngle) { private void animateCogs(float cogAngle) {

View file

@ -171,9 +171,4 @@ public class GantryCarriageTileEntity extends KineticTileEntity implements IDisp
BlockEntity te = level.getBlockEntity(worldPosition.relative(facing)); BlockEntity te = level.getBlockEntity(worldPosition.relative(facing));
return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn(); return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn();
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.gl
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialGroup; import com.jozufozu.flywheel.api.MaterialGroup;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.api.instance.TickableInstance;
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.instancing.ConditionalInstance; import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
@ -21,7 +21,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.LightLayer;
public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITickableInstance { public class GlueInstance extends EntityInstance<SuperGlueEntity> implements TickableInstance {
private static final ResourceLocation TEXTURE = Create.asResource("textures/entity/super_glue/slime.png"); private static final ResourceLocation TEXTURE = Create.asResource("textures/entity/super_glue/slime.png");

View file

@ -4,7 +4,6 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllEntityTypes; import com.simibubi.create.AllEntityTypes;
import com.simibubi.create.AllItems; import com.simibubi.create.AllItems;
@ -68,7 +67,7 @@ import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class SuperGlueEntity extends Entity public class SuperGlueEntity extends Entity
implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, FlywheelRendered { implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement {
private int validationTimer; private int validationTimer;
protected BlockPos hangingPosition; protected BlockPos hangingPosition;

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.instancing.ConditionalInstance; import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
import com.jozufozu.flywheel.core.instancing.GroupInstance; import com.jozufozu.flywheel.core.instancing.GroupInstance;
import com.jozufozu.flywheel.core.instancing.SelectInstance; import com.jozufozu.flywheel.core.instancing.SelectInstance;
@ -22,7 +22,7 @@ import net.minecraft.core.Direction;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.LightLayer;
public abstract class AbstractPulleyInstance extends ShaftInstance implements IDynamicInstance, MovingListener { public abstract class AbstractPulleyInstance extends ShaftInstance implements DynamicInstance, MovingListener {
final OrientedData coil; final OrientedData coil;
final SelectInstance<OrientedData> magnet; final SelectInstance<OrientedData> magnet;

View file

@ -39,7 +39,7 @@ public class HosePulleyInstance extends AbstractPulleyInstance {
} }
protected float getOffset() { protected float getOffset() {
return ((HosePulleyTileEntity) tile).getInterpolatedOffset(AnimationTickHolder.getPartialTicks()); return ((HosePulleyTileEntity) blockEntity).getInterpolatedOffset(AnimationTickHolder.getPartialTicks());
} }
protected boolean isRunning() { protected boolean isRunning() {

View file

@ -236,9 +236,4 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
public void animateOffset(float forcedOffset) { public void animateOffset(float forcedOffset) {
offset = forcedOffset; offset = forcedOffset;
} }
@Override
public boolean shouldRenderNormally() {
return false;
}
} }

View file

@ -35,10 +35,10 @@ public class RopePulleyInstance extends AbstractPulleyInstance {
protected float getOffset() { protected float getOffset() {
float partialTicks = AnimationTickHolder.getPartialTicks(); float partialTicks = AnimationTickHolder.getPartialTicks();
return PulleyRenderer.getTileOffset(partialTicks, (PulleyTileEntity) tile); return PulleyRenderer.getTileOffset(partialTicks, (PulleyTileEntity) blockEntity);
} }
protected boolean isRunning() { protected boolean isRunning() {
return ((PulleyTileEntity) tile).running || tile.isVirtual(); return ((PulleyTileEntity) blockEntity).running || blockEntity.isVirtual();
} }
} }

View file

@ -8,7 +8,7 @@ import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.TaskEngine; import com.jozufozu.flywheel.backend.instancing.TaskEngine;
import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstanceManager;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.simibubi.create.AllMovementBehaviours; import com.simibubi.create.AllMovementBehaviours;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
@ -18,7 +18,7 @@ import net.minecraft.client.Camera;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
public class ContraptionInstanceManager extends TileInstanceManager { public class ContraptionInstanceManager extends BlockEntityInstanceManager {
protected ArrayList<ActorInstance> actors = new ArrayList<>(); protected ArrayList<ActorInstance> actors = new ArrayList<>();

View file

@ -108,7 +108,7 @@ public class ContraptionRenderDispatcher {
ContraptionWorld contraptionWorld = c.getContraptionWorld(); ContraptionWorld contraptionWorld = c.getContraptionWorld();
VirtualRenderWorld renderWorld = new VirtualRenderWorld(world, contraptionWorld.getHeight(), contraptionWorld.getMinBuildHeight()); VirtualRenderWorld renderWorld = new VirtualRenderWorld(world, contraptionWorld.getHeight(), contraptionWorld.getMinBuildHeight());
renderWorld.setTileEntities(c.presentTileEntities.values()); renderWorld.setBlockEntities(c.presentTileEntities.values());
for (StructureTemplate.StructureBlockInfo info : c.getBlocks() for (StructureTemplate.StructureBlockInfo info : c.getBlocks()
.values()) .values())

View file

@ -147,8 +147,7 @@ public class FlwContraption extends ContraptionRenderInfo {
Collection<BlockEntity> tileEntities = contraption.maybeInstancedTileEntities; Collection<BlockEntity> tileEntities = contraption.maybeInstancedTileEntities;
if (!tileEntities.isEmpty()) { if (!tileEntities.isEmpty()) {
for (BlockEntity te : tileEntities) { for (BlockEntity te : tileEntities) {
if (InstancedRenderRegistry.getInstance() if (InstancedRenderRegistry.canInstance(te.getType())) {
.canInstance(te.getType())) {
Level world = te.getLevel(); Level world = te.getLevel();
te.setLevel(renderWorld); te.setLevel(renderWorld);
instanceWorld.tileInstanceManager.add(te); instanceWorld.tileInstanceManager.add(te);

View file

@ -19,7 +19,7 @@ public class PumpCogInstance extends SingleRotatingInstance {
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
BlockState referenceState = tile.getBlockState(); BlockState referenceState = blockEntity.getBlockState();
Direction facing = referenceState.getValue(BlockStateProperties.FACING); Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.MECHANICAL_PUMP_COG, referenceState, facing); return getRotatingMaterial().getModel(AllBlockPartials.MECHANICAL_PUMP_COG, referenceState, facing);
} }

View file

@ -389,9 +389,4 @@ public class PumpTileEntity extends KineticTileEntity {
} }
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -187,9 +187,4 @@ public class HosePulleyTileEntity extends KineticTileEntity {
return this.capability.cast(); return this.capability.cast();
return super.getCapability(cap, side); return super.getCapability(cap, side);
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.fluids.pipes; package com.simibubi.create.content.contraptions.fluids.pipes;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
@ -14,7 +14,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public class FluidValveInstance extends ShaftInstance implements IDynamicInstance { public class FluidValveInstance extends ShaftInstance implements DynamicInstance {
private final FluidValveTileEntity tile; private final FluidValveTileEntity tile;
protected ModelData pointer; protected ModelData pointer;

View file

@ -80,11 +80,6 @@ public class FluidValveTileEntity extends KineticTileEntity {
behaviours.add(new ValvePipeBehaviour(this)); behaviours.add(new ValvePipeBehaviour(this));
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
class ValvePipeBehaviour extends StraightPipeFluidTransportBehaviour { class ValvePipeBehaviour extends StraightPipeFluidTransportBehaviour {
public ValvePipeBehaviour(SmartTileEntity te) { public ValvePipeBehaviour(SmartTileEntity te) {

View file

@ -149,9 +149,4 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity {
protected abstract <C extends Container> boolean matchStaticFilters(Recipe<C> recipe); protected abstract <C extends Container> boolean matchStaticFilters(Recipe<C> recipe);
protected abstract Object getRecipeCacheKey(); protected abstract Object getRecipeCacheKey();
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -118,11 +118,6 @@ public class SpeedControllerTileEntity extends KineticTileEntity {
&& stateAbove.getValue(CogWheelBlock.AXIS).isHorizontal(); && stateAbove.getValue(CogWheelBlock.AXIS).isHorizontal();
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
private class ControllerValueBoxTransform extends ValueBoxTransform.Sided { private class ControllerValueBoxTransform extends ValueBoxTransform.Sided {
@Override @Override

View file

@ -80,14 +80,14 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
@Override @Override
public void update() { public void update() {
DyeColor color = tile.color.orElse(null); DyeColor color = blockEntity.color.orElse(null);
boolean bottom = true; boolean bottom = true;
for (BeltData key : keys) { for (BeltData key : keys) {
SpriteShiftEntry spriteShiftEntry = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom); SpriteShiftEntry spriteShiftEntry = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom);
key.setScrollTexture(spriteShiftEntry) key.setScrollTexture(spriteShiftEntry)
.setColor(tile) .setColor(blockEntity)
.setRotationalSpeed(getScrollSpeed()); .setRotationalSpeed(getScrollSpeed());
bottom = false; bottom = false;
} }
@ -113,7 +113,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
} }
private float getScrollSpeed() { private float getScrollSpeed() {
float speed = tile.getSpeed(); float speed = blockEntity.getSpeed();
if (((facing.getAxisDirection() == Direction.AxisDirection.NEGATIVE) ^ upward) ^ if (((facing.getAxisDirection() == Direction.AxisDirection.NEGATIVE) ^ upward) ^
((alongX && !diagonal) || (alongZ && diagonal))) { ((alongX && !diagonal) || (alongZ && diagonal))) {
speed = -speed; speed = -speed;
@ -168,7 +168,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
.setRotation(q) .setRotation(q)
.setRotationalSpeed(getScrollSpeed()) .setRotationalSpeed(getScrollSpeed())
.setRotationOffset(bottom ? 0.5f : 0f) .setRotationOffset(bottom ? 0.5f : 0f)
.setColor(tile) .setColor(blockEntity)
.setPosition(getInstancePosition()) .setPosition(getInstancePosition())
.setBlockLight(world.getBrightness(LightLayer.BLOCK, pos)) .setBlockLight(world.getBrightness(LightLayer.BLOCK, pos))
.setSkyLight(world.getBrightness(LightLayer.SKY, pos)); .setSkyLight(world.getBrightness(LightLayer.SKY, pos));

View file

@ -528,7 +528,6 @@ public class BeltTileEntity extends KineticTileEntity implements LightListener {
itemHandler.invalidate(); itemHandler.invalidate();
} }
@Override
public boolean shouldRenderNormally() { public boolean shouldRenderNormally() {
if (level == null) if (level == null)
return isController(); return isController();

View file

@ -27,15 +27,15 @@ public class BracketedKineticTileInstance extends SingleRotatingInstance {
@Override @Override
public void init() { public void init() {
super.init(); super.init();
if (!ICogWheel.isLargeCog(tile.getBlockState())) if (!ICogWheel.isLargeCog(blockEntity.getBlockState()))
return; return;
// Large cogs sometimes have to offset their teeth by 11.25 degrees in order to // Large cogs sometimes have to offset their teeth by 11.25 degrees in order to
// mesh properly // mesh properly
float speed = tile.getSpeed(); float speed = blockEntity.getSpeed();
Axis axis = KineticTileEntityRenderer.getRotationAxisOf(tile); Axis axis = KineticTileEntityRenderer.getRotationAxisOf(blockEntity);
BlockPos pos = tile.getBlockPos(); BlockPos pos = blockEntity.getBlockPos();
float offset = BracketedKineticTileRenderer.getShaftAngleOffset(axis, pos); float offset = BracketedKineticTileRenderer.getShaftAngleOffset(axis, pos);
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE); Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
Instancer<RotatingData> half = getRotatingMaterial().getModel(AllBlockPartials.COGWHEEL_SHAFT, blockState, Instancer<RotatingData> half = getRotatingMaterial().getModel(AllBlockPartials.COGWHEEL_SHAFT, blockState,
@ -47,10 +47,10 @@ public class BracketedKineticTileInstance extends SingleRotatingInstance {
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
if (!ICogWheel.isLargeCog(tile.getBlockState())) if (!ICogWheel.isLargeCog(blockEntity.getBlockState()))
return super.getModel(); return super.getModel();
Axis axis = KineticTileEntityRenderer.getRotationAxisOf(tile); Axis axis = KineticTileEntityRenderer.getRotationAxisOf(blockEntity);
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE); Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
return getRotatingMaterial().getModel(AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL, blockState, facing, return getRotatingMaterial().getModel(AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL, blockState, facing,
() -> this.rotateToAxis(axis)); () -> this.rotateToAxis(axis));

View file

@ -56,7 +56,7 @@ public class EncasedCogInstance extends KineticTileInstance<KineticTileEntity> {
rotatingBottomShaft = Optional.empty(); rotatingBottomShaft = Optional.empty();
for (Direction d : Iterate.directionsInAxis(axis)) { for (Direction d : Iterate.directionsInAxis(axis)) {
if (!def.hasShaftTowards(tile.getLevel(), tile.getBlockPos(), blockState, d)) if (!def.hasShaftTowards(blockEntity.getLevel(), blockEntity.getBlockPos(), blockState, d))
continue; continue;
RotatingData data = setup(getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, d) RotatingData data = setup(getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, d)
.createInstance()); .createInstance());
@ -89,7 +89,7 @@ public class EncasedCogInstance extends KineticTileInstance<KineticTileEntity> {
} }
protected Instancer<RotatingData> getCogModel() { protected Instancer<RotatingData> getCogModel() {
BlockState referenceState = tile.getBlockState(); BlockState referenceState = blockEntity.getBlockState();
Direction facing = Direction facing =
Direction.fromAxisAndDirection(referenceState.getValue(BlockStateProperties.AXIS), AxisDirection.POSITIVE); Direction.fromAxisAndDirection(referenceState.getValue(BlockStateProperties.AXIS), AxisDirection.POSITIVE);
PartialModel partial = large ? AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL : AllBlockPartials.SHAFTLESS_COGWHEEL; PartialModel partial = large ? AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL : AllBlockPartials.SHAFTLESS_COGWHEEL;

View file

@ -46,7 +46,7 @@ public class SplitShaftInstance extends KineticTileInstance<SplitShaftTileEntity
Direction[] directions = Iterate.directionsInAxis(boxAxis); Direction[] directions = Iterate.directionsInAxis(boxAxis);
for (int i : Iterate.zeroAndOne) { for (int i : Iterate.zeroAndOne) {
updateRotation(keys.get(i), tile.getSpeed() * tile.getRotationSpeedModifier(directions[i])); updateRotation(keys.get(i), blockEntity.getSpeed() * blockEntity.getRotationSpeedModifier(directions[i]));
} }
} }

View file

@ -4,7 +4,7 @@ import java.util.ArrayList;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -18,7 +18,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public abstract class GaugeInstance extends ShaftInstance implements IDynamicInstance { public abstract class GaugeInstance extends ShaftInstance implements DynamicInstance {
protected final ArrayList<DialFace> faces; protected final ArrayList<DialFace> faces;
@ -59,7 +59,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
@Override @Override
public void beginFrame() { public void beginFrame() {
GaugeTileEntity gaugeTile = (GaugeTileEntity) tile; GaugeTileEntity gaugeTile = (GaugeTileEntity) blockEntity;
if (Mth.equal(gaugeTile.prevDialState, gaugeTile.dialState)) if (Mth.equal(gaugeTile.prevDialState, gaugeTile.dialState))
return; return;

View file

@ -52,9 +52,4 @@ public class GaugeTileEntity extends KineticTileEntity implements IHaveGoggleInf
return true; return true;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -56,7 +56,7 @@ public class GearboxInstance extends KineticTileInstance<GearboxTileEntity> {
} }
private float getSpeed(Direction direction) { private float getSpeed(Direction direction) {
float speed = tile.getSpeed(); float speed = blockEntity.getSpeed();
if (speed != 0 && sourceFacing != null) { if (speed != 0 && sourceFacing != null) {
if (sourceFacing.getAxis() == direction.getAxis()) if (sourceFacing.getAxis() == direction.getAxis())
@ -68,8 +68,8 @@ public class GearboxInstance extends KineticTileInstance<GearboxTileEntity> {
} }
protected void updateSourceFacing() { protected void updateSourceFacing() {
if (tile.hasSource()) { if (blockEntity.hasSource()) {
BlockPos source = tile.source.subtract(pos); BlockPos source = blockEntity.source.subtract(pos);
sourceFacing = Direction.getNearest(source.getX(), source.getY(), source.getZ()); sourceFacing = Direction.getNearest(source.getX(), source.getY(), source.getZ());
} else { } else {
sourceFacing = null; sourceFacing = null;

View file

@ -128,11 +128,6 @@ public class CopperBacktankTileEntity extends KineticTileEntity implements Namea
.getDescriptionId()); .getDescriptionId());
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public int getAirLevel() { public int getAirLevel() {
return airLevel; return airLevel;
} }

View file

@ -2,8 +2,8 @@ package com.simibubi.create.content.curiosities.toolbox;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
@ -13,7 +13,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class ToolBoxInstance extends TileEntityInstance<ToolboxTileEntity> implements IDynamicInstance { public class ToolBoxInstance extends BlockEntityInstance<ToolboxTileEntity> implements DynamicInstance {
private final Direction facing; private final Direction facing;
private ModelData lid; private ModelData lid;
@ -28,7 +28,7 @@ public class ToolBoxInstance extends TileEntityInstance<ToolboxTileEntity> imple
@Override @Override
public void init() { public void init() {
BlockState blockState = tile.getBlockState(); BlockState blockState = blockEntity.getBlockState();
Instancer<ModelData> drawerModel = materialManager.defaultSolid() Instancer<ModelData> drawerModel = materialManager.defaultSolid()
.material(Materials.TRANSFORMED) .material(Materials.TRANSFORMED)
@ -37,7 +37,7 @@ public class ToolBoxInstance extends TileEntityInstance<ToolboxTileEntity> imple
drawers = new ModelData[]{drawerModel.createInstance(), drawerModel.createInstance()}; drawers = new ModelData[]{drawerModel.createInstance(), drawerModel.createInstance()};
lid = materialManager.defaultCutout() lid = materialManager.defaultCutout()
.material(Materials.TRANSFORMED) .material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.TOOLBOX_LIDS.get(tile.getColor()), blockState) .getModel(AllBlockPartials.TOOLBOX_LIDS.get(blockEntity.getColor()), blockState)
.createInstance(); .createInstance();
} }
@ -56,8 +56,8 @@ public class ToolBoxInstance extends TileEntityInstance<ToolboxTileEntity> imple
float partialTicks = AnimationTickHolder.getPartialTicks(); float partialTicks = AnimationTickHolder.getPartialTicks();
float lidAngle = tile.lid.getValue(partialTicks); float lidAngle = blockEntity.lid.getValue(partialTicks);
float drawerOffset = tile.drawers.getValue(partialTicks); float drawerOffset = blockEntity.drawers.getValue(partialTicks);
lid.loadIdentity() lid.loadIdentity()
.translate(instancePos) .translate(instancePos)

View file

@ -10,7 +10,6 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
@ -43,7 +42,7 @@ import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider, Nameable, FlywheelRendered { public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider, Nameable {
public LerpedFloat lid = LerpedFloat.linear() public LerpedFloat lid = LerpedFloat.linear()
.startWithValue(0); .startWithValue(0);

View file

@ -8,8 +8,8 @@ import java.util.Map;
import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.InstanceData;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.logistics.block.flap.FlapData; import com.simibubi.create.content.logistics.block.flap.FlapData;
import com.simibubi.create.foundation.render.AllMaterialSpecs; import com.simibubi.create.foundation.render.AllMaterialSpecs;
@ -19,7 +19,7 @@ import com.simibubi.create.foundation.utility.animation.InterpolatedValue;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.LightLayer;
public class BeltTunnelInstance extends TileEntityInstance<BeltTunnelTileEntity> implements IDynamicInstance { public class BeltTunnelInstance extends BlockEntityInstance<BeltTunnelTileEntity> implements DynamicInstance {
private final Map<Direction, ArrayList<FlapData>> tunnelFlaps; private final Map<Direction, ArrayList<FlapData>> tunnelFlaps;
@ -70,13 +70,13 @@ public class BeltTunnelInstance extends TileEntityInstance<BeltTunnelTileEntity>
@Override @Override
public boolean shouldReset() { public boolean shouldReset() {
return super.shouldReset() || tunnelFlaps.size() != tile.flaps.size(); return super.shouldReset() || tunnelFlaps.size() != blockEntity.flaps.size();
} }
@Override @Override
public void beginFrame() { public void beginFrame() {
tunnelFlaps.forEach((direction, keys) -> { tunnelFlaps.forEach((direction, keys) -> {
InterpolatedValue flapValue = tile.flaps.get(direction); InterpolatedValue flapValue = blockEntity.flaps.get(direction);
if (flapValue == null) { if (flapValue == null) {
return; return;
} }

View file

@ -9,7 +9,6 @@ import java.util.Set;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape;
@ -40,7 +39,7 @@ import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
public class BeltTunnelTileEntity extends SmartTileEntity implements FlywheelRendered { public class BeltTunnelTileEntity extends SmartTileEntity {
public Map<Direction, InterpolatedChasingValue> flaps; public Map<Direction, InterpolatedChasingValue> flaps;
public Set<Direction> sides; public Set<Direction> sides;
@ -175,11 +174,6 @@ public class BeltTunnelTileEntity extends SmartTileEntity implements FlywheelRen
flapsToSend.clear(); flapsToSend.clear();
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
@Override @Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {} public void addBehaviours(List<TileEntityBehaviour> behaviours) {}

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.logistics.block.depot; package com.simibubi.create.content.logistics.block.depot;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance; import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
@ -9,7 +9,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
public class EjectorInstance extends ShaftInstance implements IDynamicInstance { public class EjectorInstance extends ShaftInstance implements DynamicInstance {
protected final EjectorTileEntity tile; protected final EjectorTileEntity tile;

View file

@ -576,11 +576,6 @@ public class EjectorTileEntity extends KineticTileEntity {
return super.getCapability(cap, side); return super.getCapability(cap, side);
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public float getLidProgress(float pt) { public float getLidProgress(float pt) {
return lidProgress.getValue(pt); return lidProgress.getValue(pt);
} }

View file

@ -1,14 +1,14 @@
package com.simibubi.create.content.logistics.block.diodes; package com.simibubi.create.content.logistics.block.diodes;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.api.instance.TickableInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.Color; import com.simibubi.create.foundation.utility.Color;
public class BrassDiodeInstance extends TileEntityInstance<BrassDiodeTileEntity> implements ITickableInstance { public class BrassDiodeInstance extends BlockEntityInstance<BrassDiodeTileEntity> implements TickableInstance {
protected final ModelData indicator; protected final ModelData indicator;
@ -30,11 +30,11 @@ public class BrassDiodeInstance extends TileEntityInstance<BrassDiodeTileEntity>
@Override @Override
public void tick() { public void tick() {
if (previousState == tile.state) return; if (previousState == blockEntity.state) return;
indicator.setColor(getColor()); indicator.setColor(getColor());
previousState = tile.state; previousState = blockEntity.state;
} }
@Override @Override
@ -48,6 +48,6 @@ public class BrassDiodeInstance extends TileEntityInstance<BrassDiodeTileEntity>
} }
protected int getColor() { protected int getColor() {
return Color.mixColors(0x2c0300, 0xcd0000, tile.getProgress()); return Color.mixColors(0x2c0300, 0xcd0000, blockEntity.getProgress());
} }
} }

View file

@ -4,7 +4,6 @@ import static com.simibubi.create.content.logistics.block.diodes.BrassDiodeBlock
import java.util.List; import java.util.List;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour;
@ -19,7 +18,7 @@ import net.minecraft.world.level.block.DiodeBlock;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public abstract class BrassDiodeTileEntity extends SmartTileEntity implements FlywheelRendered { public abstract class BrassDiodeTileEntity extends SmartTileEntity {
protected int state; protected int state;
ScrollValueBehaviour maxState; ScrollValueBehaviour maxState;

View file

@ -5,8 +5,8 @@ import java.util.ArrayList;
import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.InstanceData;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.logistics.block.flap.FlapData; import com.simibubi.create.content.logistics.block.flap.FlapData;
@ -16,7 +16,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.LightLayer;
public class FunnelInstance extends TileEntityInstance<FunnelTileEntity> implements IDynamicInstance { public class FunnelInstance extends BlockEntityInstance<FunnelTileEntity> implements DynamicInstance {
private final ArrayList<FlapData> flaps; private final ArrayList<FlapData> flaps;
@ -65,7 +65,7 @@ public class FunnelInstance extends TileEntityInstance<FunnelTileEntity> impleme
public void beginFrame() { public void beginFrame() {
if (flaps == null) return; if (flaps == null) return;
float flapness = tile.flap.get(AnimationTickHolder.getPartialTicks()); float flapness = blockEntity.flap.get(AnimationTickHolder.getPartialTicks());
for (FlapData flap : flaps) { for (FlapData flap : flaps) {
flap.setFlapness(flapness); flap.setFlapness(flapness);

View file

@ -3,7 +3,6 @@ package com.simibubi.create.content.logistics.block.funnel;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.List; import java.util.List;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents; import com.simibubi.create.AllSoundEvents;
@ -37,7 +36,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringInformation, FlywheelRendered { public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringInformation {
private FilteringBehaviour filtering; private FilteringBehaviour filtering;
private InvManipulationBehaviour invManipulation; private InvManipulationBehaviour invManipulation;
@ -336,9 +335,4 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn
.onFunnelTransfer(level, worldPosition, stack); .onFunnelTransfer(level, worldPosition, stack);
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
} }

View file

@ -7,7 +7,7 @@ import com.jozufozu.flywheel.api.InstanceData;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -24,7 +24,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
public class ArmInstance extends SingleRotatingInstance implements IDynamicInstance { public class ArmInstance extends SingleRotatingInstance implements DynamicInstance {
final ModelData base; final ModelData base;
final ModelData lowerBody; final ModelData lowerBody;
@ -69,7 +69,7 @@ public class ArmInstance extends SingleRotatingInstance implements IDynamicInsta
@Override @Override
public void beginFrame() { public void beginFrame() {
if (arm.phase == ArmTileEntity.Phase.DANCING && tile.getSpeed() != 0) { if (arm.phase == ArmTileEntity.Phase.DANCING && blockEntity.getSpeed() != 0) {
animateArm(true); animateArm(true);
firstRender = true; firstRender = true;
return; return;
@ -107,7 +107,7 @@ public class ArmInstance extends SingleRotatingInstance implements IDynamicInsta
int color; int color;
if (rave) { if (rave) {
float renderTick = AnimationTickHolder.getRenderTime(this.arm.getLevel()) + (tile.hashCode() % 64); float renderTick = AnimationTickHolder.getRenderTime(this.arm.getLevel()) + (blockEntity.hashCode() % 64);
baseAngle = (renderTick * 10) % 360; baseAngle = (renderTick * 10) % 360;
lowerArmAngle = Mth.lerp((Mth.sin(renderTick / 4) + 1) / 2, -45, 15); lowerArmAngle = Mth.lerp((Mth.sin(renderTick / 4) + 1) / 2, -45, 15);
upperArmAngle = Mth.lerp((Mth.sin(renderTick / 8) + 1) / 4, -45, 95); upperArmAngle = Mth.lerp((Mth.sin(renderTick / 8) + 1) / 4, -45, 95);
@ -172,7 +172,7 @@ public class ArmInstance extends SingleRotatingInstance implements IDynamicInsta
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
return getRotatingMaterial().getModel(AllBlockPartials.ARM_COG, tile.getBlockState()); return getRotatingMaterial().getModel(AllBlockPartials.ARM_COG, blockEntity.getBlockState());
} }
@Override @Override

View file

@ -517,11 +517,6 @@ public class ArmTileEntity extends KineticTileEntity implements ITransformableTE
return true; return true;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
private class SelectionModeValueBox extends CenteredSideValueBoxTransform { private class SelectionModeValueBox extends CenteredSideValueBoxTransform {
public SelectionModeValueBox() { public SelectionModeValueBox() {

View file

@ -2,8 +2,8 @@ package com.simibubi.create.content.logistics.block.redstone;
import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.util.transform.Rotate; import com.jozufozu.flywheel.util.transform.Rotate;
import com.jozufozu.flywheel.util.transform.Translate; import com.jozufozu.flywheel.util.transform.Translate;
@ -15,7 +15,7 @@ import com.simibubi.create.foundation.utility.Color;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.properties.AttachFace; import net.minecraft.world.level.block.state.properties.AttachFace;
public class AnalogLeverInstance extends TileEntityInstance<AnalogLeverTileEntity> implements IDynamicInstance { public class AnalogLeverInstance extends BlockEntityInstance<AnalogLeverTileEntity> implements DynamicInstance {
protected final ModelData handle; protected final ModelData handle;
protected final ModelData indicator; protected final ModelData indicator;
@ -42,12 +42,12 @@ public class AnalogLeverInstance extends TileEntityInstance<AnalogLeverTileEntit
@Override @Override
public void beginFrame() { public void beginFrame() {
if (!tile.clientState.settled()) if (!blockEntity.clientState.settled())
animateLever(); animateLever();
} }
protected void animateLever() { protected void animateLever() {
float state = tile.clientState.get(AnimationTickHolder.getPartialTicks()); float state = blockEntity.clientState.get(AnimationTickHolder.getPartialTicks());
indicator.setColor(Color.mixColors(0x2C0300, 0xCD0000, state / 15f)); indicator.setColor(Color.mixColors(0x2C0300, 0xCD0000, state / 15f));

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.logistics.block.redstone;
import java.util.List; import java.util.List;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
@ -16,7 +15,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggleInformation, FlywheelRendered { public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggleInformation {
int state = 0; int state = 0;
int lastChange; int lastChange;

View file

@ -2,8 +2,8 @@ package com.simibubi.create.content.schematics.block;
import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -12,7 +12,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
public class SchematicannonInstance extends TileEntityInstance<SchematicannonTileEntity> implements IDynamicInstance { public class SchematicannonInstance extends BlockEntityInstance<SchematicannonTileEntity> implements DynamicInstance {
private final ModelData connector; private final ModelData connector;
private final ModelData pipe; private final ModelData pipe;
@ -30,12 +30,12 @@ public class SchematicannonInstance extends TileEntityInstance<SchematicannonTil
public void beginFrame() { public void beginFrame() {
float partialTicks = AnimationTickHolder.getPartialTicks(); float partialTicks = AnimationTickHolder.getPartialTicks();
double[] cannonAngles = SchematicannonRenderer.getCannonAngles(tile, pos, partialTicks); double[] cannonAngles = SchematicannonRenderer.getCannonAngles(blockEntity, pos, partialTicks);
double yaw = cannonAngles[0]; double yaw = cannonAngles[0];
double pitch = cannonAngles[1]; double pitch = cannonAngles[1];
double recoil = SchematicannonRenderer.getRecoil(tile, partialTicks); double recoil = SchematicannonRenderer.getRecoil(blockEntity, partialTicks);
PoseStack ms = new PoseStack(); PoseStack ms = new PoseStack();
TransformStack msr = TransformStack.cast(ms); TransformStack msr = TransformStack.cast(ms);

View file

@ -6,7 +6,6 @@ import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.jozufozu.flywheel.api.FlywheelRendered;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems; import com.simibubi.create.AllItems;
import com.simibubi.create.AllSoundEvents; import com.simibubi.create.AllSoundEvents;
@ -62,7 +61,7 @@ import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler; import net.minecraftforge.items.wrapper.EmptyHandler;
public class SchematicannonTileEntity extends SmartTileEntity implements MenuProvider, FlywheelRendered { public class SchematicannonTileEntity extends SmartTileEntity implements MenuProvider {
public static final int NEIGHBOUR_CHECKING = 100; public static final int NEIGHBOUR_CHECKING = 100;
public static final int MAX_ANCHOR_DISTANCE = 256; public static final int MAX_ANCHOR_DISTANCE = 256;
@ -817,11 +816,6 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
return INFINITE_EXTENT_AABB; return INFINITE_EXTENT_AABB;
} }
@Override
public boolean shouldRenderNormally() {
return true;
}
public enum State { public enum State {
STOPPED, PAUSED, RUNNING; STOPPED, PAUSED, RUNNING;
} }

View file

@ -1,10 +1,13 @@
package com.simibubi.create.foundation.data; package com.simibubi.create.foundation.data;
import java.util.function.BiFunction;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry;
import com.jozufozu.flywheel.backend.instancing.entity.IEntityInstanceFactory; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
import com.tterrag.registrate.AbstractRegistrate; import com.tterrag.registrate.AbstractRegistrate;
import com.tterrag.registrate.builders.BuilderCallback; import com.tterrag.registrate.builders.BuilderCallback;
import com.tterrag.registrate.builders.EntityBuilder; import com.tterrag.registrate.builders.EntityBuilder;
@ -15,6 +18,7 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.util.NonNullPredicate;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
@ -22,7 +26,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
public class CreateEntityBuilder<T extends Entity, P> extends EntityBuilder<T, P> { public class CreateEntityBuilder<T extends Entity, P> extends EntityBuilder<T, P> {
@Nullable @Nullable
private NonNullSupplier<IEntityInstanceFactory<? super T>> instanceFactory; private NonNullSupplier<BiFunction<MaterialManager, T, EntityInstance<? super T>>> instanceFactory;
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) { public static <T extends Entity, P> EntityBuilder<T, P> create(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback, EntityType.EntityFactory<T> factory, MobCategory classification) {
return (new CreateEntityBuilder<>(owner, parent, name, callback, factory, classification)).defaultLang(); return (new CreateEntityBuilder<>(owner, parent, name, callback, factory, classification)).defaultLang();
@ -32,23 +37,34 @@ public class CreateEntityBuilder<T extends Entity, P> extends EntityBuilder<T, P
super(owner, parent, name, callback, factory, classification); super(owner, parent, name, callback, factory, classification);
} }
public CreateEntityBuilder<T, P> instance(NonNullSupplier<IEntityInstanceFactory<? super T>> instanceFactory) { public CreateEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, EntityInstance<? super T>>> instanceFactory) {
return instance(instanceFactory, true);
}
public CreateEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, EntityInstance<? super T>>> instanceFactory, boolean renderNormally) {
return instance(instanceFactory, be -> true);
}
public CreateEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, EntityInstance<? super T>>> instanceFactory, NonNullPredicate<T> renderNormally) {
if (this.instanceFactory == null) { if (this.instanceFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance);
} }
this.instanceFactory = instanceFactory; this.instanceFactory = instanceFactory;
this.renderNormally = renderNormally;
return this; return this;
} }
protected void registerInstance() { protected void registerInstance() {
OneTimeEventReceiver.addModListener(FMLClientSetupEvent.class, $ -> { OneTimeEventReceiver.addModListener(FMLClientSetupEvent.class, $ -> {
NonNullSupplier<IEntityInstanceFactory<? super T>> instanceFactory = this.instanceFactory; NonNullSupplier<BiFunction<MaterialManager, T, EntityInstance<? super T>>> instanceFactory = this.instanceFactory;
if (instanceFactory != null) { if (instanceFactory != null) {
InstancedRenderRegistry.getInstance() NonNullPredicate<T> renderNormally = this.renderNormally;
.entity(getEntry()) InstancedRenderRegistry.configure(getEntry())
.factory(instanceFactory.get()); .factory(instanceFactory.get())
.skipRender(be -> !renderNormally.test(be))
.apply();
} }
}); });

View file

@ -1,9 +1,12 @@
package com.simibubi.create.foundation.data; package com.simibubi.create.foundation.data;
import java.util.function.BiFunction;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry;
import com.jozufozu.flywheel.backend.instancing.tile.ITileInstanceFactory; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.tterrag.registrate.AbstractRegistrate; import com.tterrag.registrate.AbstractRegistrate;
import com.tterrag.registrate.builders.BlockEntityBuilder; import com.tterrag.registrate.builders.BlockEntityBuilder;
import com.tterrag.registrate.builders.BuilderCallback; import com.tterrag.registrate.builders.BuilderCallback;
@ -12,13 +15,15 @@ import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.util.NonNullPredicate;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
public class CreateTileEntityBuilder<T extends BlockEntity, P> extends BlockEntityBuilder<T, P> { public class CreateTileEntityBuilder<T extends BlockEntity, P> extends BlockEntityBuilder<T, P> {
@Nullable @Nullable
private NonNullSupplier<ITileInstanceFactory<? super T>> instanceFactory; private NonNullSupplier<BiFunction<MaterialManager, T, BlockEntityInstance<? super T>>> instanceFactory;
private NonNullPredicate<T> renderNormally;
public static <T extends BlockEntity, P> BlockEntityBuilder<T, P> create(AbstractRegistrate<?> owner, P parent, public static <T extends BlockEntity, P> BlockEntityBuilder<T, P> create(AbstractRegistrate<?> owner, P parent,
String name, BuilderCallback callback, BlockEntityFactory<T> factory) { String name, BuilderCallback callback, BlockEntityFactory<T> factory) {
@ -30,23 +35,34 @@ public class CreateTileEntityBuilder<T extends BlockEntity, P> extends BlockEnti
super(owner, parent, name, callback, factory); super(owner, parent, name, callback, factory);
} }
public CreateTileEntityBuilder<T, P> instance(NonNullSupplier<ITileInstanceFactory<? super T>> instanceFactory) { public CreateTileEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, BlockEntityInstance<? super T>>> instanceFactory) {
return instance(instanceFactory, true);
}
public CreateTileEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, BlockEntityInstance<? super T>>> instanceFactory, boolean renderNormally) {
return instance(instanceFactory, be -> renderNormally);
}
public CreateTileEntityBuilder<T, P> instance(NonNullSupplier<BiFunction<MaterialManager, T, BlockEntityInstance<? super T>>> instanceFactory, NonNullPredicate<T> renderNormally) {
if (this.instanceFactory == null) { if (this.instanceFactory == null) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::registerInstance);
} }
this.instanceFactory = instanceFactory; this.instanceFactory = instanceFactory;
this.renderNormally = renderNormally;
return this; return this;
} }
protected void registerInstance() { protected void registerInstance() {
OneTimeEventReceiver.addModListener(FMLClientSetupEvent.class, $ -> { OneTimeEventReceiver.addModListener(FMLClientSetupEvent.class, $ -> {
NonNullSupplier<ITileInstanceFactory<? super T>> instanceFactory = this.instanceFactory; NonNullSupplier<BiFunction<MaterialManager, T, BlockEntityInstance<? super T>>> instanceFactory = this.instanceFactory;
if (instanceFactory != null) { if (instanceFactory != null) {
InstancedRenderRegistry.getInstance() NonNullPredicate<T> renderNormally = this.renderNormally;
.tile(getEntry()) InstancedRenderRegistry.configure(getEntry())
.factory(instanceFactory.get()); .factory(instanceFactory.get())
.skipRender(be -> !renderNormally.test(be))
.apply();
} }
}); });
} }

View file

@ -1,12 +1,12 @@
package com.simibubi.create.foundation.render; package com.simibubi.create.foundation.render;
import com.jozufozu.flywheel.core.shader.spec.IBooleanStateProvider; import com.jozufozu.flywheel.core.shader.spec.BooleanStateProvider;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.KineticDebugger; import com.simibubi.create.content.contraptions.KineticDebugger;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
public class RainbowDebugStateProvider implements IBooleanStateProvider { public class RainbowDebugStateProvider implements BooleanStateProvider {
public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider(); public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider();
public static final ResourceLocation NAME = Create.asResource("rainbow_debug"); public static final ResourceLocation NAME = Create.asResource("rainbow_debug");

View file

@ -48,8 +48,8 @@ public class TileEntityRenderHelper {
Iterator<BlockEntity> iterator = customRenderTEs.iterator(); Iterator<BlockEntity> iterator = customRenderTEs.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
BlockEntity tileEntity = iterator.next(); BlockEntity tileEntity = iterator.next();
if (Backend.canUseInstancing(renderWorld) && InstancedRenderRegistry.getInstance() if (Backend.canUseInstancing(renderWorld) && InstancedRenderRegistry.shouldSkipRender(tileEntity))
.shouldSkipRender(tileEntity)) continue; continue;
BlockEntityRenderer<BlockEntity> renderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(tileEntity); BlockEntityRenderer<BlockEntity> renderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(tileEntity);
if (renderer == null) { if (renderer == null) {

View file

@ -32,6 +32,6 @@ Technology that empowers the player.'''
[[dependencies.create]] [[dependencies.create]]
modId="flywheel" modId="flywheel"
mandatory=true mandatory=true
versionRange="[1.18-0.5.0,1.18-0.5.1)" versionRange="[1.18-0.5.1,1.18-0.5.2)"
ordering="AFTER" ordering="AFTER"
side="BOTH" side="BOTH"