Interfaces and less log lines

- MateralManager, MaterialGroup, and InstanceMaterial are all interfaces
 - Separate (T)EI facing API from implementation
 - Comment out debug log in ModelPool
This commit is contained in:
Jozufozu 2021-08-23 22:34:29 -07:00
parent 5cb2eef157
commit 6de4b92ad0
53 changed files with 68 additions and 73 deletions

View file

@ -6,7 +6,7 @@ import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
public class BackHalfShaftInstance extends HalfShaftInstance { public class BackHalfShaftInstance extends HalfShaftInstance {
public BackHalfShaftInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public BackHalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -1,12 +1,11 @@
package com.simibubi.create.content.contraptions.base; package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.foundation.render.AllMaterialSpecs; import com.simibubi.create.foundation.render.AllMaterialSpecs;
public class CutoutRotatingInstance extends SingleRotatingInstance { public class CutoutRotatingInstance extends SingleRotatingInstance {
public CutoutRotatingInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public CutoutRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
public class HalfShaftInstance extends SingleRotatingInstance { public class HalfShaftInstance extends SingleRotatingInstance {
public HalfShaftInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public HalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -7,7 +7,7 @@ import net.minecraft.util.Direction;
public class HorizontalHalfShaftInstance extends HalfShaftInstance { public class HorizontalHalfShaftInstance extends HalfShaftInstance {
public HorizontalHalfShaftInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public HorizontalHalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -15,7 +15,7 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends T
protected final Direction.Axis axis; protected final Direction.Axis axis;
public KineticTileInstance(MaterialManager<?> modelManager, T tile) { public KineticTileInstance(MaterialManager modelManager, T tile) {
super(modelManager, tile); super(modelManager, tile);
axis = ((IRotate) blockState.getBlock()).getRotationAxis(blockState); axis = ((IRotate) blockState.getBlock()).getRotationAxis(blockState);

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.render.AllMaterialSpecs;
public class ShaftlessCogInstance extends SingleRotatingInstance { public class ShaftlessCogInstance extends SingleRotatingInstance {
public ShaftlessCogInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public ShaftlessCogInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -9,7 +9,7 @@ public class SingleRotatingInstance extends KineticTileInstance<KineticTileEntit
protected final RotatingData rotatingModel; protected final RotatingData rotatingModel;
public SingleRotatingInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public SingleRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
rotatingModel = setup(getModel().createInstance()); rotatingModel = setup(getModel().createInstance());

View file

@ -19,7 +19,7 @@ public class DrillActorInstance extends ActorInstance {
ActorData drillHead; ActorData drillHead;
private final Direction facing; private final Direction facing;
public DrillActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld contraption, MovementContext context) { public DrillActorInstance(MaterialManager materialManager, PlacementSimulationWorld contraption, MovementContext context) {
super(materialManager, contraption, context); super(materialManager, contraption, context);
InstanceMaterial<ActorData> instanceMaterial = materialManager.defaultSolid() InstanceMaterial<ActorData> instanceMaterial = materialManager.defaultSolid()

View file

@ -14,7 +14,7 @@ import net.minecraft.util.Direction;
public class DrillInstance extends SingleRotatingInstance { public class DrillInstance extends SingleRotatingInstance {
public DrillInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public DrillInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -48,7 +48,7 @@ public class DrillMovementBehaviour extends BlockBreakingMovementBehaviour {
@Nullable @Nullable
@Override @Override
public ActorInstance createInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public ActorInstance createInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
return new DrillActorInstance(materialManager, simulationWorld, context); return new DrillActorInstance(materialManager, simulationWorld, context);
} }

View file

@ -34,7 +34,7 @@ public class HarvesterActorInstance extends ActorInstance {
private double rotation; private double rotation;
private double previousRotation; private double previousRotation;
public HarvesterActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public HarvesterActorInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
super(materialManager, simulationWorld, context); super(materialManager, simulationWorld, context);
InstanceMaterial<ModelData> instanceMaterial = materialManager.defaultCutout() InstanceMaterial<ModelData> instanceMaterial = materialManager.defaultCutout()

View file

@ -49,7 +49,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
@Nullable @Nullable
@Override @Override
public ActorInstance createInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public ActorInstance createInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
return new HarvesterActorInstance(materialManager, simulationWorld, context); return new HarvesterActorInstance(materialManager, simulationWorld, context);
} }

View file

@ -16,7 +16,7 @@ import net.minecraft.util.Direction;
public class MechanicalCrafterInstance extends SingleRotatingInstance { public class MechanicalCrafterInstance extends SingleRotatingInstance {
public MechanicalCrafterInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public MechanicalCrafterInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -20,7 +20,7 @@ public class HandCrankInstance extends SingleRotatingInstance implements IDynami
private ModelData crank; private ModelData crank;
private Direction facing; private Direction facing;
public HandCrankInstance(MaterialManager<?> modelManager, HandCrankTileEntity tile) { public HandCrankInstance(MaterialManager modelManager, HandCrankTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
this.tile = tile; this.tile = tile;

View file

@ -42,7 +42,7 @@ public class DeployerActorInstance extends ActorInstance {
ModelData hand; ModelData hand;
RotatingData shaft; RotatingData shaft;
public DeployerActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public DeployerActorInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
super(materialManager, simulationWorld, context); super(materialManager, simulationWorld, context);
InstanceMaterial<ModelData> mat = materialManager.defaultSolid() InstanceMaterial<ModelData> mat = materialManager.defaultSolid()

View file

@ -36,7 +36,7 @@ public class DeployerInstance extends ShaftInstance implements IDynamicInstance,
float progress; float progress;
private boolean newHand = false; private boolean newHand = false;
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.tile;

View file

@ -268,7 +268,7 @@ public class DeployerMovementBehaviour extends MovementBehaviour {
@Nullable @Nullable
@Override @Override
public ActorInstance createInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public ActorInstance createInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
return new DeployerActorInstance(materialManager, simulationWorld, context); return new DeployerActorInstance(materialManager, simulationWorld, context);
} }
} }

View file

@ -19,7 +19,7 @@ public class FanInstance extends KineticTileInstance<EncasedFanTileEntity> {
final Direction direction; final Direction direction;
private final Direction opposite; private final Direction opposite;
public FanInstance(MaterialManager<?> modelManager, EncasedFanTileEntity tile) { public FanInstance(MaterialManager modelManager, EncasedFanTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
direction = blockState.getValue(FACING); direction = blockState.getValue(FACING);

View file

@ -8,8 +8,8 @@ import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer; import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
@ -45,7 +45,7 @@ public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> im
protected float lastAngle = Float.NaN; protected float lastAngle = Float.NaN;
public FlyWheelInstance(MaterialManager<?> modelManager, FlywheelTileEntity tile) { public FlyWheelInstance(MaterialManager modelManager, FlywheelTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
facing = blockState.getValue(HORIZONTAL_FACING); facing = blockState.getValue(HORIZONTAL_FACING);

View file

@ -16,7 +16,7 @@ public class EngineInstance extends TileEntityInstance<EngineTileEntity> {
protected ModelData frame; protected ModelData frame;
public EngineInstance(MaterialManager<?> modelManager, EngineTileEntity tile) { public EngineInstance(MaterialManager modelManager, EngineTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
Block block = blockState Block block = blockState

View file

@ -9,7 +9,7 @@ import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
public class MillStoneCogInstance extends SingleRotatingInstance { public class MillStoneCogInstance extends SingleRotatingInstance {
public MillStoneCogInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public MillStoneCogInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -16,7 +16,7 @@ public class MixerInstance extends ShaftlessCogInstance implements IDynamicInsta
private final OrientedData mixerPole; private final OrientedData mixerPole;
private final MechanicalMixerTileEntity mixer; private final MechanicalMixerTileEntity mixer;
public MixerInstance(MaterialManager<?> dispatcher, MechanicalMixerTileEntity tile) { public MixerInstance(MaterialManager dispatcher, MechanicalMixerTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
this.mixer = tile; this.mixer = tile;

View file

@ -17,7 +17,7 @@ public class PressInstance extends ShaftInstance implements IDynamicInstance {
private final OrientedData pressHead; private final OrientedData pressHead;
private final MechanicalPressTileEntity press; private final MechanicalPressTileEntity press;
public PressInstance(MaterialManager<?> dispatcher, MechanicalPressTileEntity tile) { public PressInstance(MaterialManager dispatcher, MechanicalPressTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
press = tile; press = tile;

View file

@ -15,7 +15,7 @@ import net.minecraft.util.Rotation;
public class SawInstance extends SingleRotatingInstance { public class SawInstance extends SingleRotatingInstance {
public SawInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public SawInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -66,7 +66,7 @@ public abstract class MovementBehaviour {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@Nullable @Nullable
public ActorInstance createInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public ActorInstance createInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
return null; return null;
} }

View file

@ -23,7 +23,7 @@ public class BearingInstance<B extends KineticTileEntity & IBearingTileEntity> e
final Vector3f rotationAxis; final Vector3f rotationAxis;
final Quaternion blockOrientation; final Quaternion blockOrientation;
public BearingInstance(MaterialManager<?> modelManager, B tile) { public BearingInstance(MaterialManager modelManager, B tile) {
super(modelManager, tile); super(modelManager, tile);
this.bearing = tile; this.bearing = tile;

View file

@ -23,7 +23,7 @@ public class StabilizedBearingInstance extends ActorInstance {
final Vector3f rotationAxis; final Vector3f rotationAxis;
final Quaternion blockOrientation; final Quaternion blockOrientation;
public StabilizedBearingInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public StabilizedBearingInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
super(materialManager, simulationWorld, context); super(materialManager, simulationWorld, context);
BlockState blockState = context.state; BlockState blockState = context.state;

View file

@ -70,7 +70,7 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour {
@Nullable @Nullable
@Override @Override
public ActorInstance createInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) { public ActorInstance createInstance(MaterialManager materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
return new StabilizedBearingInstance(materialManager, simulationWorld, context); return new StabilizedBearingInstance(materialManager, simulationWorld, context);
} }

View file

@ -23,7 +23,7 @@ public class StickerInstance extends TileEntityInstance<StickerTileEntity> imple
private final ModelData head; private final ModelData head;
public StickerInstance(MaterialManager<?> modelManager, StickerTileEntity tile) { public StickerInstance(MaterialManager modelManager, StickerTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
head = getTransformMaterial().getModel(AllBlockPartials.STICKER_HEAD, blockState).createInstance(); head = getTransformMaterial().getModel(AllBlockPartials.STICKER_HEAD, blockState).createInstance();

View file

@ -29,7 +29,7 @@ public class GantryCarriageInstance extends ShaftInstance implements IDynamicIns
private float lastAngle = Float.NaN; private float lastAngle = Float.NaN;
public GantryCarriageInstance(MaterialManager<?> dispatcher, KineticTileEntity tile) { public GantryCarriageInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
gantryCogs = getTransformMaterial() gantryCogs = getTransformMaterial()

View file

@ -7,13 +7,9 @@ import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
import com.jozufozu.flywheel.backend.material.MaterialGroup; import com.jozufozu.flywheel.backend.material.MaterialGroup;
import com.jozufozu.flywheel.backend.model.BufferedModel;
import com.jozufozu.flywheel.backend.model.ElementBuffer;
import com.jozufozu.flywheel.backend.model.IndexedModel;
import com.jozufozu.flywheel.backend.state.TextureRenderState; import com.jozufozu.flywheel.backend.state.TextureRenderState;
import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Formats;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.QuadConverter;
import com.jozufozu.flywheel.core.instancing.ConditionalInstance; import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
import com.jozufozu.flywheel.core.materials.OrientedData; import com.jozufozu.flywheel.core.materials.OrientedData;
import com.jozufozu.flywheel.core.model.IModel; import com.jozufozu.flywheel.core.model.IModel;
@ -41,7 +37,7 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
private final Quaternion rotation; private final Quaternion rotation;
protected ConditionalInstance<OrientedData> model; protected ConditionalInstance<OrientedData> model;
public GlueInstance(MaterialManager<?> materialManager, SuperGlueEntity entity) { public GlueInstance(MaterialManager materialManager, SuperGlueEntity entity) {
super(materialManager, entity); super(materialManager, entity);
Instancer<OrientedData> instancer = getInstancer(materialManager, entity); Instancer<OrientedData> instancer = getInstancer(materialManager, entity);
@ -55,8 +51,8 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
.update(); .update();
} }
private Instancer<OrientedData> getInstancer(MaterialManager<?> materialManager, SuperGlueEntity entity) { private Instancer<OrientedData> getInstancer(MaterialManager materialManager, SuperGlueEntity entity) {
MaterialGroup<?> group = USE_ATLAS ? materialManager.defaultCutout() : materialManager.cutout(TextureRenderState.get(TEXTURE)); MaterialGroup group = USE_ATLAS ? materialManager.defaultCutout() : materialManager.cutout(TextureRenderState.get(TEXTURE));
return group.material(Materials.ORIENTED).model(entity.getType(), GlueModel::new); return group.material(Materials.ORIENTED).model(entity.getType(), GlueModel::new);
} }

View file

@ -37,7 +37,7 @@ public abstract class AbstractPulleyInstance extends ShaftInstance implements ID
private byte[] sLight = new byte[1]; private byte[] sLight = new byte[1];
private GridAlignedBB volume; private GridAlignedBB volume;
public AbstractPulleyInstance(MaterialManager<?> dispatcher, KineticTileEntity tile) { public AbstractPulleyInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
rotatingAbout = Direction.get(Direction.AxisDirection.POSITIVE, axis); rotatingAbout = Direction.get(Direction.AxisDirection.POSITIVE, axis);

View file

@ -11,7 +11,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
public class HosePulleyInstance extends AbstractPulleyInstance { public class HosePulleyInstance extends AbstractPulleyInstance {
final HosePulleyTileEntity tile = (HosePulleyTileEntity) super.tile; final HosePulleyTileEntity tile = (HosePulleyTileEntity) super.tile;
public HosePulleyInstance(MaterialManager<?> dispatcher, HosePulleyTileEntity tile) { public HosePulleyInstance(MaterialManager dispatcher, HosePulleyTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
beginFrame(); beginFrame();
} }

View file

@ -11,7 +11,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
public class RopePulleyInstance extends AbstractPulleyInstance { public class RopePulleyInstance extends AbstractPulleyInstance {
final PulleyTileEntity tile = (PulleyTileEntity) super.tile; final PulleyTileEntity tile = (PulleyTileEntity) super.tile;
public RopePulleyInstance(MaterialManager<?> dispatcher, PulleyTileEntity tile) { public RopePulleyInstance(MaterialManager dispatcher, PulleyTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
beginFrame(); beginFrame();
} }

View file

@ -7,11 +7,11 @@ import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationW
import net.minecraft.world.LightType; import net.minecraft.world.LightType;
public abstract class ActorInstance { public abstract class ActorInstance {
protected final MaterialManager<?> materialManager; protected final MaterialManager materialManager;
protected final PlacementSimulationWorld simulationWorld; protected final PlacementSimulationWorld simulationWorld;
protected final MovementContext context; protected final MovementContext context;
public ActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld world, MovementContext context) { public ActorInstance(MaterialManager materialManager, PlacementSimulationWorld world, MovementContext context) {
this.materialManager = materialManager; this.materialManager = materialManager;
this.simulationWorld = world; this.simulationWorld = world;
this.context = context; this.context = context;

View file

@ -1,14 +1,14 @@
package com.simibubi.create.content.contraptions.components.structureMovement.render; package com.simibubi.create.content.contraptions.components.structureMovement.render;
import com.jozufozu.flywheel.backend.material.MaterialGroup; import com.jozufozu.flywheel.backend.material.MaterialGroupImpl;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl;
import com.jozufozu.flywheel.backend.state.IRenderState; import com.jozufozu.flywheel.backend.state.IRenderState;
public class ContraptionGroup<P extends ContraptionProgram> extends MaterialGroup<P> { public class ContraptionGroup<P extends ContraptionProgram> extends MaterialGroupImpl<P> {
private final RenderedContraption contraption; private final RenderedContraption contraption;
public ContraptionGroup(RenderedContraption contraption, MaterialManager<P> owner, IRenderState state) { public ContraptionGroup(RenderedContraption contraption, MaterialManagerImpl<P> owner, IRenderState state) {
super(owner, state); super(owner, state);
this.contraption = contraption; this.contraption = contraption;
@ -19,7 +19,7 @@ public class ContraptionGroup<P extends ContraptionProgram> extends MaterialGrou
contraption.setup(program); contraption.setup(program);
} }
public static <P extends ContraptionProgram> MaterialManager.GroupFactory<P> forContraption(RenderedContraption c) { public static <P extends ContraptionProgram> MaterialManagerImpl.GroupFactory<P> forContraption(RenderedContraption c) {
return (materialManager, state) -> new ContraptionGroup<>(c, materialManager, state); return (materialManager, state) -> new ContraptionGroup<>(c, materialManager, state);
} }
} }

View file

@ -7,8 +7,8 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager;
import com.jozufozu.flywheel.backend.material.MaterialManagerImpl;
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;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
@ -23,7 +23,7 @@ public class ContraptionInstanceManager extends TileInstanceManager {
private final WeakReference<RenderedContraption> contraption; private final WeakReference<RenderedContraption> contraption;
ContraptionInstanceManager(RenderedContraption contraption, MaterialManager<?> materialManager) { ContraptionInstanceManager(RenderedContraption contraption, MaterialManagerImpl<?> materialManager) {
super(materialManager); super(materialManager);
this.contraption = new WeakReference<>(contraption); this.contraption = new WeakReference<>(contraption);
} }

View file

@ -8,7 +8,7 @@ import java.util.function.Supplier;
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManagerImpl;
import com.jozufozu.flywheel.backend.model.ArrayModelRenderer; import com.jozufozu.flywheel.backend.model.ArrayModelRenderer;
import com.jozufozu.flywheel.backend.model.ModelRenderer; import com.jozufozu.flywheel.backend.model.ModelRenderer;
import com.jozufozu.flywheel.core.model.IModel; import com.jozufozu.flywheel.core.model.IModel;
@ -36,7 +36,7 @@ public class RenderedContraption extends ContraptionRenderInfo {
private final ContraptionLighter<?> lighter; private final ContraptionLighter<?> lighter;
public final MaterialManager<ContraptionProgram> materialManager; public final MaterialManagerImpl<ContraptionProgram> materialManager;
public final ContraptionInstanceManager kinetics; public final ContraptionInstanceManager kinetics;
private final Map<RenderType, ModelRenderer> renderLayers = new HashMap<>(); private final Map<RenderType, ModelRenderer> renderLayers = new HashMap<>();
@ -48,7 +48,7 @@ public class RenderedContraption extends ContraptionRenderInfo {
public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) { public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) {
super(contraption, renderWorld); super(contraption, renderWorld);
this.lighter = contraption.makeLighter(); this.lighter = contraption.makeLighter();
this.materialManager = MaterialManager.builder(CreateContexts.CWORLD) this.materialManager = MaterialManagerImpl.builder(CreateContexts.CWORLD)
.setGroupFactory(ContraptionGroup.forContraption(this)) .setGroupFactory(ContraptionGroup.forContraption(this))
.setIgnoreOriginCoordinate(true) .setIgnoreOriginCoordinate(true)
.build(); .build();

View file

@ -14,7 +14,7 @@ import net.minecraft.util.Direction;
public class PumpCogInstance extends SingleRotatingInstance { public class PumpCogInstance extends SingleRotatingInstance {
public PumpCogInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public PumpCogInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -24,7 +24,7 @@ public class FluidValveInstance extends ShaftInstance implements IDynamicInstanc
protected final double yRot; protected final double yRot;
protected final int pointerRotationOffset; protected final int pointerRotationOffset;
public FluidValveInstance(MaterialManager<?> dispatcher, KineticTileEntity tile) { public FluidValveInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
Direction facing = blockState.getValue(FluidValveBlock.FACING); Direction facing = blockState.getValue(FluidValveBlock.FACING);

View file

@ -35,7 +35,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
protected ArrayList<BeltData> keys; protected ArrayList<BeltData> keys;
protected RotatingData pulleyKey; protected RotatingData pulleyKey;
public BeltInstance(MaterialManager<?> materialManager, BeltTileEntity tile) { public BeltInstance(MaterialManager materialManager, BeltTileEntity tile) {
super(materialManager, tile); super(materialManager, tile);
if (!AllBlocks.BELT.has(blockState)) if (!AllBlocks.BELT.has(blockState))

View file

@ -8,7 +8,7 @@ import net.minecraft.block.BlockState;
public class ShaftInstance extends SingleRotatingInstance { public class ShaftInstance extends SingleRotatingInstance {
public ShaftInstance(MaterialManager<?> dispatcher, KineticTileEntity tile) { public ShaftInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
} }

View file

@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.relays.encased;
import java.util.ArrayList; import java.util.ArrayList;
import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer; import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate;
@ -19,7 +19,7 @@ public class SplitShaftInstance extends KineticTileInstance<SplitShaftTileEntity
protected final ArrayList<RotatingData> keys; protected final ArrayList<RotatingData> keys;
public SplitShaftInstance(MaterialManager<?> modelManager, SplitShaftTileEntity tile) { public SplitShaftInstance(MaterialManager modelManager, SplitShaftTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
keys = new ArrayList<>(2); keys = new ArrayList<>(2);

View file

@ -25,7 +25,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
protected MatrixStack ms; protected MatrixStack ms;
protected GaugeInstance(MaterialManager<?> dispatcher, KineticTileEntity tile) { protected GaugeInstance(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
faces = new ArrayList<>(2); faces = new ArrayList<>(2);
@ -145,7 +145,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
} }
public static class Speed extends GaugeInstance { public static class Speed extends GaugeInstance {
public Speed(MaterialManager<?> dispatcher, KineticTileEntity tile) { public Speed(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
} }
@ -156,7 +156,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
} }
public static class Stress extends GaugeInstance { public static class Stress extends GaugeInstance {
public Stress(MaterialManager<?> dispatcher, KineticTileEntity tile) { public Stress(MaterialManager dispatcher, KineticTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
} }

View file

@ -4,8 +4,8 @@ import java.util.EnumMap;
import java.util.Map; import java.util.Map;
import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer; import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileInstance; import com.simibubi.create.content.contraptions.base.KineticTileInstance;
@ -22,7 +22,7 @@ public class GearboxInstance extends KineticTileInstance<GearboxTileEntity> {
protected final EnumMap<Direction, RotatingData> keys; protected final EnumMap<Direction, RotatingData> keys;
protected Direction sourceFacing; protected Direction sourceFacing;
public GearboxInstance(MaterialManager<?> modelManager, GearboxTileEntity tile) { public GearboxInstance(MaterialManager modelManager, GearboxTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
keys = new EnumMap<>(Direction.class); keys = new EnumMap<>(Direction.class);

View file

@ -9,7 +9,7 @@ import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
public class CopperBacktankInstance extends SingleRotatingInstance { public class CopperBacktankInstance extends SingleRotatingInstance {
public CopperBacktankInstance(MaterialManager<?> modelManager, KineticTileEntity tile) { public CopperBacktankInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
} }

View file

@ -23,7 +23,7 @@ public class BeltTunnelInstance extends TileEntityInstance<BeltTunnelTileEntity>
private final Map<Direction, ArrayList<FlapData>> tunnelFlaps; private final Map<Direction, ArrayList<FlapData>> tunnelFlaps;
public BeltTunnelInstance(MaterialManager<?> modelManager, BeltTunnelTileEntity tile) { public BeltTunnelInstance(MaterialManager modelManager, BeltTunnelTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
tunnelFlaps = new EnumMap<>(Direction.class); tunnelFlaps = new EnumMap<>(Direction.class);

View file

@ -19,7 +19,7 @@ public class EjectorInstance extends ShaftInstance implements IDynamicInstance {
private float lastProgress = Float.NaN; private float lastProgress = Float.NaN;
public EjectorInstance(MaterialManager<?> dispatcher, EjectorTileEntity tile) { public EjectorInstance(MaterialManager dispatcher, EjectorTileEntity tile) {
super(dispatcher, tile); super(dispatcher, tile);
this.tile = tile; this.tile = tile;

View file

@ -16,7 +16,7 @@ public class AdjustableRepeaterInstance extends TileEntityInstance<AdjustableRep
protected int previousState; protected int previousState;
public AdjustableRepeaterInstance(MaterialManager<?> modelManager, AdjustableRepeaterTileEntity tile) { public AdjustableRepeaterInstance(MaterialManager modelManager, AdjustableRepeaterTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
indicator = modelManager.defaultSolid() indicator = modelManager.defaultSolid()

View file

@ -20,7 +20,7 @@ public class FunnelInstance extends TileEntityInstance<FunnelTileEntity> impleme
private final ArrayList<FlapData> flaps; private final ArrayList<FlapData> flaps;
public FunnelInstance(MaterialManager<?> modelManager, FunnelTileEntity tile) { public FunnelInstance(MaterialManager modelManager, FunnelTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
flaps = new ArrayList<>(4); flaps = new ArrayList<>(4);

View file

@ -44,7 +44,7 @@ public class ArmInstance extends SingleRotatingInstance implements IDynamicInsta
private float upperArmAngle = Float.NaN; private float upperArmAngle = Float.NaN;
private float headAngle = Float.NaN; private float headAngle = Float.NaN;
public ArmInstance(MaterialManager<?> modelManager, ArmTileEntity tile) { public ArmInstance(MaterialManager modelManager, ArmTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
InstanceMaterial<ModelData> mat = getTransformMaterial(); InstanceMaterial<ModelData> mat = getTransformMaterial();

View file

@ -23,7 +23,7 @@ public class AnalogLeverInstance extends TileEntityInstance<AnalogLeverTileEntit
final float rX; final float rX;
final float rY; final float rY;
public AnalogLeverInstance(MaterialManager<?> modelManager, AnalogLeverTileEntity tile) { public AnalogLeverInstance(MaterialManager modelManager, AnalogLeverTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
InstanceMaterial<ModelData> mat = getTransformMaterial(); InstanceMaterial<ModelData> mat = getTransformMaterial();

View file

@ -17,7 +17,7 @@ public class SchematicannonInstance extends TileEntityInstance<SchematicannonTil
private final ModelData connector; private final ModelData connector;
private final ModelData pipe; private final ModelData pipe;
public SchematicannonInstance(MaterialManager<?> modelManager, SchematicannonTileEntity tile) { public SchematicannonInstance(MaterialManager modelManager, SchematicannonTileEntity tile) {
super(modelManager, tile); super(modelManager, tile);
InstanceMaterial<ModelData> mat = getTransformMaterial(); InstanceMaterial<ModelData> mat = getTransformMaterial();