MaterialGroups and massive refactors

- Move material stuff to its own package
 - The various render functions in the material tree now bind to specific render layers
 - Instancers can choose which layer to use
 - The layers are SOLID, CUTOUT, and TRANSPARENT
 - More layers are likely unnecessary, but we'll see
 - Deprecate functions in MaterialManager in favor of more builderesque ones using MaterialGroups
 - Catching up with Flywheel
 - Remove MatrixStacker in favor of Flywheel's TransformStack (thread safety too)
This commit is contained in:
Jozufozu 2021-07-21 20:30:35 -07:00
parent 4bdd802170
commit a52b6d766f
112 changed files with 347 additions and 439 deletions

View file

@ -1,5 +1,6 @@
package com.simibubi.create;
import com.simibubi.create.content.contraptions.base.CutoutRotatingInstance;
import com.simibubi.create.content.contraptions.base.HalfShaftInstance;
import com.simibubi.create.content.contraptions.base.HorizontalHalfShaftInstance;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
@ -489,7 +490,7 @@ public class AllTileEntities {
public static final TileEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
.tileEntity("crushing_wheel", CrushingWheelTileEntity::new)
.instance(() -> SingleRotatingInstance::new)
.instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
@ -503,7 +504,7 @@ public class AllTileEntities {
public static final TileEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
.tileEntity("water_wheel", WaterWheelTileEntity::new)
.instance(() -> SingleRotatingInstance::new)
.instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new)
.register();

View file

@ -1,9 +1,9 @@
package com.simibubi.create.compat.jei.category.animations;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.utility.MatrixStacker;
public class AnimatedCrafter extends AnimatedKinetics {
@ -14,7 +14,7 @@ public class AnimatedCrafter extends AnimatedKinetics {
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
matrixStack.translate(3, 16, 0);
MatrixStacker.of(matrixStack)
MatrixTransformStack.of(matrixStack)
.rotateX(-12.5f)
.rotateY(-22.5f);
int scale = 22;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;

View file

@ -0,0 +1,17 @@
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.MaterialManager;
import com.simibubi.create.foundation.render.AllMaterialSpecs;
public class CutoutRotatingInstance extends SingleRotatingInstance {
public CutoutRotatingInstance(MaterialManager<?> modelManager, KineticTileEntity tile) {
super(modelManager, tile);
}
protected InstanceMaterial<RotatingData> getRotatingMaterial() {
return materialManager.defaultCutout()
.material(AllMaterialSpecs.ROTATING);
}
}

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import net.minecraft.state.properties.BlockStateProperties;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
@ -84,8 +84,9 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends T
return shaft(getRotationAxis());
}
protected final InstanceMaterial<RotatingData> getRotatingMaterial() {
return materialManager.getMaterial(AllMaterialSpecs.ROTATING);
protected InstanceMaterial<RotatingData> getRotatingMaterial() {
return materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING);
}
public static BlockState shaft(Direction.Axis axis) {

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.AllMaterialSpecs;
@ -13,6 +13,8 @@ public class ShaftlessCogInstance extends SingleRotatingInstance {
@Override
protected Instancer<RotatingData> getModel() {
return materialManager.getMaterial(AllMaterialSpecs.ROTATING).getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, tile.getBlockState());
return materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, tile.getBlockState());
}
}

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import net.minecraft.block.BlockState;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
@ -22,7 +22,8 @@ public class DrillActorInstance extends ActorInstance {
public DrillActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld contraption, MovementContext context) {
super(materialManager, contraption, context);
InstanceMaterial<ActorData> instanceMaterial = materialManager.getMaterial(AllMaterialSpecs.ACTORS);
InstanceMaterial<ActorData> instanceMaterial = materialManager.defaultSolid()
.material(AllMaterialSpecs.ACTORS);
BlockState state = context.state;

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.actors;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.actors;
import javax.annotation.Nullable;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;

View file

@ -1,5 +1,6 @@
package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -11,7 +12,6 @@ import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
@ -46,7 +46,7 @@ public class DrillRenderer extends KineticTileEntityRenderer {
MatrixStack m = matrices.contraptionStack;
m.pushPose();
MatrixStacker.of(m)
MatrixTransformStack.of(m)
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing))

View file

@ -2,16 +2,17 @@ package com.simibubi.create.content.contraptions.components.actors;
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
@ -36,7 +37,8 @@ public class HarvesterActorInstance extends ActorInstance {
public HarvesterActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
super(materialManager, simulationWorld, context);
InstanceMaterial<ModelData> instanceMaterial = materialManager.getTransformMaterial();
InstanceMaterial<ModelData> instanceMaterial = materialManager.defaultCutout()
.material(Materials.TRANSFORMED);
BlockState state = context.state;
@ -74,7 +76,7 @@ public class HarvesterActorInstance extends ActorInstance {
@Override
public void beginFrame() {
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(context.localPos)
.centre()

View file

@ -7,7 +7,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.mutable.MutableBoolean;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
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.render.ActorInstance;

View file

@ -3,13 +3,14 @@ package com.simibubi.create.content.contraptions.components.crafter;
import java.util.function.Supplier;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.Direction;
@ -23,18 +24,20 @@ public class MechanicalCrafterInstance extends SingleRotatingInstance {
protected Instancer<RotatingData> getModel() {
Direction facing = blockState.getValue(MechanicalCrafterBlock.HORIZONTAL_FACING);
Supplier<MatrixStack> ms = () -> {
MatrixStack stack = new MatrixStack();
MatrixStacker stacker = MatrixStacker.of(stack).centre();
if (facing.getAxis() == Direction.Axis.X)
stacker.rotateZ(90);
else if (facing.getAxis() == Direction.Axis.Z)
stacker.rotateX(90);
stacker.unCentre();
return stack;
};
return getRotatingMaterial().getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState, facing, ms);
return getRotatingMaterial().getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState, facing, rotateToFace(facing));
}
private Supplier<MatrixStack> rotateToFace(Direction facing) {
return () -> {
MatrixStack stack = new MatrixStack();
TransformStack stacker = MatrixTransformStack.of(stack)
.centre();
if (facing.getAxis() == Direction.Axis.X) stacker.rotateZ(90);
else if (facing.getAxis() == Direction.Axis.Z) stacker.rotateX(90);
stacker.unCentre();
return stack;
};
}
}

View file

@ -5,6 +5,7 @@ import static com.simibubi.create.content.contraptions.base.KineticTileEntityRen
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -16,7 +17,6 @@ import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
@ -112,7 +112,7 @@ public class MechanicalCrafterRenderer extends SafeTileEntityRenderer<Mechanical
Integer x = pair.getKey();
Integer y = pair.getValue();
ms.translate(x * spacing, y * spacing, 0);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.nudge(x * 13 + y + te.getBlockPos()
.hashCode());
Minecraft.getInstance()

View file

@ -2,13 +2,13 @@ package com.simibubi.create.content.contraptions.components.crank;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.Block;
import net.minecraft.state.properties.BlockStateProperties;
@ -51,7 +51,7 @@ public class HandCrankInstance extends SingleRotatingInstance implements IDynami
float angle = (tile.independentAngle + AnimationTickHolder.getPartialTicks() * tile.chasingVelocity) / 360;
MatrixStack ms = new MatrixStack();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(getInstancePosition())
.centre()
.rotate(Direction.get(Direction.AxisDirection.POSITIVE, axis), angle)

View file

@ -3,10 +3,12 @@ package com.simibubi.create.content.contraptions.components.deployer;
import static com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE;
import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.IRotate;
@ -17,7 +19,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.ren
import com.simibubi.create.foundation.render.AllMaterialSpecs;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
@ -44,7 +45,8 @@ public class DeployerActorInstance extends ActorInstance {
public DeployerActorInstance(MaterialManager<?> materialManager, PlacementSimulationWorld simulationWorld, MovementContext context) {
super(materialManager, simulationWorld, context);
InstanceMaterial<ModelData> mat = materialManager.getTransformMaterial();
InstanceMaterial<ModelData> mat = materialManager.defaultSolid()
.material(Materials.TRANSFORMED);
BlockState state = context.state;
DeployerTileEntity.Mode mode = NBTHelper.readEnum(context.tileData, "Mode", DeployerTileEntity.Mode.class);
@ -62,7 +64,8 @@ public class DeployerActorInstance extends ActorInstance {
hand = mat.getModel(handPose, state).createInstance();
Direction.Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state);
shaft = materialManager.getMaterial(AllMaterialSpecs.ROTATING)
shaft = materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING)
.getModel(KineticTileInstance.shaft(axis))
.createInstance();
@ -92,7 +95,7 @@ public class DeployerActorInstance extends ActorInstance {
Vector3d offset = Vector3d.atLowerCornerOf(facing.getNormal()).scale(factor);
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(context.localPos)
.translate(offset);
@ -100,7 +103,7 @@ public class DeployerActorInstance extends ActorInstance {
transformModel(msr, pole, hand, yRot, zRot, zRotPole);
}
static void transformModel(MatrixStacker msr, ModelData pole, ModelData hand, float yRot, float zRot, float zRotPole) {
static void transformModel(MatrixTransformStack msr, ModelData pole, ModelData hand, float yRot, float zRot, float zRotPole) {
msr.centre();
msr.rotate(Direction.SOUTH, (float) ((zRot) / 180 * Math.PI));

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.contraptions.components.deployer;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -31,7 +31,7 @@ public class DeployerFilterSlot extends ValueBoxTransform {
Direction facing = state.getValue(DeployerBlock.FACING);
float xRot = facing == Direction.UP ? 90 : facing == Direction.DOWN ? 270 : 0;
float yRot = AngleHelper.horizontalAngle(facing) + 180;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(xRot);
}

View file

@ -5,7 +5,7 @@ import static com.simibubi.create.content.contraptions.base.DirectionalKineticBl
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.ITickableInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;

View file

@ -8,7 +8,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllTags.AllBlockTags;

View file

@ -2,10 +2,11 @@ package com.simibubi.create.content.contraptions.components.fan;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
import com.simibubi.create.content.contraptions.base.RotatingData;
import com.simibubi.create.foundation.render.AllMaterialSpecs;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
@ -25,7 +26,10 @@ public class FanInstance extends KineticTileInstance<EncasedFanTileEntity> {
opposite = direction.getOpposite();
shaft = getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, opposite).createInstance();
fan = getRotatingMaterial().getModel(AllBlockPartials.ENCASED_FAN_INNER, blockState, opposite).createInstance();
fan = modelManager.defaultCutout()
.material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.ENCASED_FAN_INNER, blockState, opposite)
.createInstance();
setup(shaft);
setup(fan, getFanSpeed());

View file

@ -8,17 +8,17 @@ import java.util.List;
import com.google.common.collect.Lists;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
import com.simibubi.create.content.contraptions.base.RotatingData;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
@ -95,7 +95,7 @@ public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> im
private void animate(float angle) {
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(getInstancePosition());
@ -163,7 +163,7 @@ public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> im
return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, opposite);
}
protected void transformConnector(MatrixStacker ms, boolean upper, boolean rotating, float angle, boolean flip) {
protected void transformConnector(MatrixTransformStack ms, boolean upper, boolean rotating, float angle, boolean flip) {
float shift = upper ? 1 / 4f : -1 / 8f;
float offset = upper ? 1 / 4f : 1 / 4f;
float radians = (float) (angle / 180 * Math.PI);
@ -189,7 +189,7 @@ public class FlyWheelInstance extends KineticTileInstance<FlywheelTileEntity> im
ms.translate(9 / 16f, 0, 0);
}
protected void rotateToFacing(MatrixStacker buffer, Direction facing) {
protected void rotateToFacing(MatrixTransformStack buffer, Direction facing) {
buffer.centre()
.rotate(Direction.UP, AngleHelper.rad(AngleHelper.horizontalAngle(facing)))
.unCentre();

View file

@ -1,12 +1,12 @@
package com.simibubi.create.content.contraptions.components.flywheel.engine;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.Block;
import net.minecraft.state.properties.BlockStateProperties;
@ -34,7 +34,7 @@ public class EngineInstance extends TileEntityInstance<EngineTileEntity> {
float angle = AngleHelper.rad(AngleHelper.horizontalAngle(facing));
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(getInstancePosition())
.nudge(tile.hashCode())

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.millstone;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.mixer;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -1,7 +1,8 @@
package com.simibubi.create.content.contraptions.components.press;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
@ -20,7 +21,8 @@ public class PressInstance extends ShaftInstance implements IDynamicInstance {
super(dispatcher, tile);
press = tile;
pressHead = dispatcher.getOrientedMaterial()
pressHead = dispatcher.defaultSolid()
.material(Materials.ORIENTED)
.getModel(AllBlockPartials.MECHANICAL_PRESS_HEAD, blockState)
.createInstance();

View file

@ -1,8 +1,8 @@
package com.simibubi.create.content.contraptions.components.saw;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -23,7 +23,7 @@ public class SawFilterSlot extends ValueBoxTransform {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
int yRot = state.getValue(SawBlock.AXIS_ALONG_FIRST_COORDINATE) ? 270 : 180;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(90);
}

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.saw;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -4,6 +4,7 @@ import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.CreateClient;
@ -17,7 +18,6 @@ import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
@ -194,14 +194,14 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
MatrixStack m = matrices.contraptionStack;
m.pushPose();
MatrixStacker.of(m)
MatrixTransformStack.of(m)
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing));
if (!SawBlock.isHorizontal(state))
MatrixStacker.of(m)
MatrixTransformStack.of(m)
.rotateZ(state.getValue(SawBlock.AXIS_ALONG_FIRST_COORDINATE) ? 0 : 90);
MatrixStacker.of(m)
MatrixTransformStack.of(m)
.unCentre();
superBuffer.transform(m)

View file

@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
import static com.simibubi.create.foundation.utility.AngleHelper.angleLerp;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllEntityTypes;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.BearingContraption;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.VecHelper;
@ -231,7 +231,7 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity {
Axis axis = getRotationAxis();
for (MatrixStack stack : matrixStacks)
MatrixStacker.of(stack)
MatrixTransformStack.of(stack)
.nudge(getId())
.centre()
.rotate(angle, axis)

View file

@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
import java.util.function.BiPredicate;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.state.properties.BlockStateProperties;
@ -27,7 +27,7 @@ public class DirectionalExtenderScrollOptionSlot extends CenteredSideValueBoxTra
@Override
protected void rotate(BlockState state, MatrixStack ms) {
if (!getSide().getAxis().isHorizontal())
MatrixStacker.of(ms).rotateY(AngleHelper.horizontalAngle(state.getValue(BlockStateProperties.FACING)) - 90);
MatrixTransformStack.of(ms).rotateY(AngleHelper.horizontalAngle(state.getValue(BlockStateProperties.FACING)) - 90);
super.rotate(state, ms);
}
}

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
import javax.annotation.Nullable;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;

View file

@ -7,6 +7,7 @@ import java.util.UUID;
import javax.annotation.Nullable;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllEntityTypes;
import com.simibubi.create.content.contraptions.components.structureMovement.bearing.StabilizedContraption;
@ -18,7 +19,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra
import com.simibubi.create.foundation.item.ItemHelper;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.VecHelper;
@ -536,7 +536,7 @@ public class OrientedContraptionEntity extends AbstractContraptionEntity {
}
for (MatrixStack stack : matrixStacks)
MatrixStacker.of(stack)
MatrixTransformStack.of(stack)
.nudge(getId())
.centre()
.rotateY(angleYaw)

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
@ -32,7 +33,9 @@ public class StabilizedBearingInstance extends ActorInstance {
blockOrientation = BearingInstance.getBlockStateOrientation(facing);
topInstance = materialManager.getOrientedMaterial().getModel(AllBlockPartials.BEARING_TOP, blockState).createInstance();
topInstance = materialManager.defaultSolid()
.material(Materials.ORIENTED)
.getModel(AllBlockPartials.BEARING_TOP, blockState).createInstance();
topInstance.setPosition(context.localPos)
.setRotation(blockOrientation)

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be
import javax.annotation.Nullable;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;

View file

@ -1,14 +1,14 @@
package com.simibubi.create.content.contraptions.components.structureMovement.chassis;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.util.Direction;
@ -52,7 +52,7 @@ public class StickerInstance extends TileEntityInstance<StickerTileEntity> imple
private void animateHead(float offset) {
MatrixStack stack = new MatrixStack();
MatrixStacker.of(stack)
MatrixTransformStack.of(stack)
.translate(getInstancePosition())
.nudge(tile.hashCode())
.centre()

View file

@ -1,8 +1,9 @@
package com.simibubi.create.content.contraptions.components.structureMovement.gantry;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -10,7 +11,6 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
@ -64,7 +64,7 @@ public class GantryCarriageInstance extends ShaftInstance implements IDynamicIns
private void animateCogs(float cogAngle) {
MatrixStack ms = new MatrixStack();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(getInstancePosition())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))

View file

@ -2,12 +2,13 @@ package com.simibubi.create.content.contraptions.components.structureMovement.gl
import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer;
import com.jozufozu.flywheel.backend.instancing.ITickableInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance;
import com.jozufozu.flywheel.backend.material.MaterialGroup;
import com.jozufozu.flywheel.backend.model.BufferedModel;
import com.jozufozu.flywheel.backend.model.IndexedModel;
import com.jozufozu.flywheel.backend.state.TextureRenderState;
import com.jozufozu.flywheel.core.Formats;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
@ -51,14 +52,9 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
}
private Instancer<OrientedData> getInstancer(MaterialManager<?> materialManager, SuperGlueEntity entity) {
InstanceMaterial<OrientedData> material;
MaterialGroup<?> group = USE_ATLAS ? materialManager.defaultSolid() : materialManager.solid(TextureRenderState.get(TEXTURE));
if (USE_ATLAS)
material = materialManager.getMaterial(Materials.ORIENTED);
else
material = materialManager.getMaterial(Materials.ORIENTED, TEXTURE);
return material.get(entity.getType(), GlueInstance::supplyModel);
return group.material(Materials.ORIENTED).model(entity.getType(), GlueInstance::supplyModel);
}
@Override

View file

@ -1,12 +1,12 @@
package com.simibubi.create.content.contraptions.components.structureMovement.glue;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.matrix.MatrixStack.Entry;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.Minecraft;
@ -69,7 +69,7 @@ public class SuperGlueRenderer extends EntityRenderer<SuperGlueEntity> {
Direction face = entity.getFacingDirection();
ms.pushPose();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(AngleHelper.horizontalAngleNew(face))
.rotateX(AngleHelper.verticalAngle(face));
Entry peek = ms.last();

View file

@ -4,7 +4,7 @@ import java.util.Arrays;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.instancing.ConditionalInstance;
import com.jozufozu.flywheel.core.instancing.GroupInstance;
import com.jozufozu.flywheel.core.instancing.SelectInstance;

View file

@ -1,7 +1,8 @@
package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyTileEntity;
@ -20,11 +21,15 @@ public class HosePulleyInstance extends AbstractPulleyInstance {
}
protected Instancer<OrientedData> getMagnetModel() {
return getOrientedMaterial().getModel(AllBlockPartials.HOSE_MAGNET, blockState);
return materialManager.defaultCutout()
.material(Materials.ORIENTED)
.getModel(AllBlockPartials.HOSE_MAGNET, blockState);
}
protected Instancer<OrientedData> getHalfMagnetModel() {
return getOrientedMaterial().getModel(AllBlockPartials.HOSE_HALF_MAGNET, blockState);
return materialManager.defaultCutout()
.material(Materials.ORIENTED)
.getModel(AllBlockPartials.HOSE_HALF_MAGNET, blockState);
}
protected Instancer<OrientedData> getCoilModel() {

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.OrientedData;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.components.structureMovement.render;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;

View file

@ -7,7 +7,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager;
import com.simibubi.create.AllMovementBehaviours;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;

View file

@ -1,22 +0,0 @@
package com.simibubi.create.content.contraptions.components.structureMovement.render;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.MaterialRenderer;
import com.jozufozu.flywheel.core.WorldContext;
import com.jozufozu.flywheel.core.shader.IProgramCallback;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.math.vector.Matrix4f;
public class ContraptionMaterialManager extends MaterialManager<ContraptionProgram> {
public ContraptionMaterialManager(WorldContext<ContraptionProgram> context) {
super(context);
}
@Override
public void render(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ, IProgramCallback<ContraptionProgram> callback) {
for (MaterialRenderer<ContraptionProgram> material : atlasRenderers) {
material.render(layer, viewProjection, camX, camY, camZ, callback);
}
}
}

View file

@ -16,10 +16,12 @@ import java.util.Random;
import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.state.RenderLayer;
import com.jozufozu.flywheel.event.BeginFrameEvent;
import com.jozufozu.flywheel.event.GatherContextEvent;
import com.jozufozu.flywheel.event.ReloadRenderersEvent;
import com.jozufozu.flywheel.event.RenderLayerEvent;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllMovementBehaviours;
import com.simibubi.create.CreateClient;
@ -35,7 +37,6 @@ import com.simibubi.create.foundation.render.CreateContexts;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.SuperByteBufferCache;
import com.simibubi.create.foundation.render.TileEntityRenderHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@ -130,8 +131,11 @@ public class ContraptionRenderDispatcher {
}
if (Backend.getInstance().canUseInstancing()) {
for (RenderedContraption renderer : RENDERERS.values()) {
renderer.materialManager.render(layer, event.viewProjection, event.camX, event.camY, event.camZ, renderer::setup);
RenderLayer renderLayer = RenderLayer.fromRenderType(layer);
if (renderLayer != null) {
for (RenderedContraption renderer : RENDERERS.values()) {
renderer.materialManager.render(renderLayer, event.viewProjection, event.camX, event.camY, event.camZ, renderer::setup);
}
}
}
@ -236,7 +240,7 @@ public class ContraptionRenderDispatcher {
MatrixStack m = matrices.contraptionStack;
m.pushPose();
MatrixStacker.of(m)
MatrixTransformStack.of(m)
.translate(blockInfo.pos);
MovementBehaviour movementBehaviour = AllMovementBehaviours.of(blockInfo.state);

View file

@ -13,7 +13,7 @@ import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.gl.attrib.CommonAttributes;
import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat;
import com.jozufozu.flywheel.backend.instancing.IInstanceRendered;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.model.ArrayModelRenderer;
import com.jozufozu.flywheel.backend.model.BufferedModel;
import com.jozufozu.flywheel.backend.model.IndexedModel;
@ -60,7 +60,7 @@ public class RenderedContraption extends ContraptionWorldHolder {
public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) {
super(contraption, renderWorld);
this.lighter = contraption.makeLighter();
this.materialManager = new ContraptionMaterialManager(CreateContexts.CWORLD);
this.materialManager = new MaterialManager<>(CreateContexts.CWORLD).setIgnoreOriginCoordinate(true);
this.kinetics = new ContraptionInstanceManager(this, materialManager);
buildLayers();

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.tr
import static net.minecraft.util.math.MathHelper.lerp;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -13,7 +14,6 @@ import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -80,7 +80,7 @@ public class CouplingRenderer {
double connectorPitch = Math.atan2(endPointDiff.y, endPointDiff.multiply(1, 0, 1)
.length()) * 180 / Math.PI;
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
carts.forEachWithContext((cart, isFirst) -> {
CartEndpoint cartTransform = transforms.get(isFirst);

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.fluids;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -1,5 +1,6 @@
package com.simibubi.create.content.contraptions.fluids;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -7,7 +8,6 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -37,7 +37,7 @@ public class PumpRenderer extends KineticTileEntityRenderer {
ms.pushPose();
SuperByteBuffer arrow = PartialBufferer.get(AllBlockPartials.MECHANICAL_PUMP_ARROW, blockState);
Direction direction = blockState.getValue(PumpBlock.FACING);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.centre()
.rotateY(AngleHelper.horizontalAngle(direction) + 180)
.rotateX(-AngleHelper.verticalAngle(direction) - 90)

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.fluids.actors;
import java.util.Random;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.processing.EmptyingByBasin;
import com.simibubi.create.content.contraptions.relays.belt.BeltHelper;
@ -10,7 +11,6 @@ import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.Minecraft;
@ -48,7 +48,7 @@ public class ItemDrainRenderer extends SmartTileEntityRenderer<ItemDrainTileEnti
if (transported == null)
return;
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
Vector3d itemPosition = VecHelper.getCenterOf(te.getBlockPos());
Direction insertedFrom = transported.insertedFrom;

View file

@ -1,8 +1,10 @@
package com.simibubi.create.content.contraptions.fluids.pipes;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -10,7 +12,6 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.Direction;
import net.minecraft.util.math.MathHelper;
@ -37,7 +38,9 @@ public class FluidValveInstance extends ShaftInstance implements IDynamicInstanc
boolean twist = pipeAxis.isHorizontal() && shaftAxis == Direction.Axis.Z || pipeAxis.isVertical();
pointerRotationOffset = twist ? 90 : 0;
pointer = materialManager.getTransformMaterial().getModel(AllBlockPartials.FLUID_VALVE_POINTER, blockState).createInstance();
pointer = materialManager.defaultSolid()
.material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.FLUID_VALVE_POINTER, blockState).createInstance();
transformPointer((FluidValveTileEntity) tile);
}
@ -56,7 +59,7 @@ public class FluidValveInstance extends ShaftInstance implements IDynamicInstanc
float pointerRotation = MathHelper.lerp(valve.pointer.getValue(AnimationTickHolder.getPartialTicks()), 0, -90);
MatrixStack ms = new MatrixStack();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(getInstancePosition())
.centre()
.rotateY(yRot)

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.contraptions.fluids.pipes;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -8,7 +9,6 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -46,7 +46,7 @@ public class FluidValveRenderer extends KineticTileEntityRenderer {
if (pipeAxis.isHorizontal() && shaftAxis == Axis.Z || pipeAxis.isVertical())
pointerRotationOffset = 90;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.fluids.pipes;
import java.util.List;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.fluids.FluidPropagator;
import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity.StraightPipeFluidTransportBehaviour;
@ -10,7 +11,6 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -77,7 +77,7 @@ public class SmartFluidPipeTileEntity extends SmartTileEntity {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
AttachFace face = state.getValue(SmartFluidPipeBlock.FACE);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(angleY(state))
.rotateX(face == AttachFace.CEILING ? -45 : 45);
}

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.processing;
import java.util.Random;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
@ -10,7 +11,6 @@ import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRendere
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.IntAttached;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -46,7 +46,7 @@ public class BasinRenderer extends SmartTileEntityRenderer<BasinTileEntity> {
BlockPos pos = basin.getBlockPos();
ms.translate(.5, .2f, .5);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(basin.ingredientRotation.getValue(partialTicks));
Random r = new Random(pos.hashCode());
@ -80,7 +80,7 @@ public class BasinRenderer extends SmartTileEntityRenderer<BasinTileEntity> {
Vector3d itemPosition = VecHelper.rotate(baseVector, anglePartition * itemCount, Axis.Y);
ms.translate(itemPosition.x, itemPosition.y, itemPosition.z);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(anglePartition * itemCount + 35)
.rotateX(65);
@ -122,7 +122,7 @@ public class BasinRenderer extends SmartTileEntityRenderer<BasinTileEntity> {
continue;
ms.pushPose();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(outVec)
.translate(new Vector3d(0, Math.max(-.55f, -(progress * progress * 2)), 0))
.translate(directionVec.scale(progress * .5f))

View file

@ -5,8 +5,9 @@ import java.util.function.Supplier;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
@ -15,7 +16,6 @@ import com.simibubi.create.content.contraptions.base.RotatingData;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.render.AllMaterialSpecs;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.item.DyeColor;
import net.minecraft.util.Direction;
@ -61,7 +61,9 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
PartialModel beltPartial = BeltRenderer.getBeltPartial(diagonal, start, end, bottom);
SpriteShiftEntry spriteShift = BeltRenderer.getSpriteShiftEntry(color, diagonal, bottom);
Instancer<BeltData> beltModel = materialManager.getMaterial(AllMaterialSpecs.BELTS).getModel(beltPartial, blockState);
Instancer<BeltData> beltModel = materialManager.defaultSolid()
.material(AllMaterialSpecs.BELTS)
.getModel(beltPartial, blockState);
keys.add(setup(beltModel.createInstance(), bottom, spriteShift));
@ -128,7 +130,7 @@ public class BeltInstance extends KineticTileInstance<BeltTileEntity> {
Supplier<MatrixStack> ms = () -> {
MatrixStack modelTransform = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(modelTransform);
MatrixTransformStack msr = MatrixTransformStack.of(modelTransform);
msr.centre();
if (axis == Direction.Axis.X)
msr.rotateY(90);

View file

@ -5,6 +5,7 @@ import java.util.function.Supplier;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -21,7 +22,6 @@ import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld;
import net.minecraft.block.BlockState;
@ -76,7 +76,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
boolean alongX = facing.getAxis() == Axis.X;
MatrixStack localTransforms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(localTransforms);
MatrixTransformStack msr = MatrixTransformStack.of(localTransforms);
IVertexBuilder vb = buffer.getBuffer(RenderType.solid());
float renderTick = AnimationTickHolder.getRenderTime(te.getLevel());
@ -134,7 +134,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
Supplier<MatrixStack> matrixStackSupplier = () -> {
MatrixStack stack = new MatrixStack();
MatrixStacker stacker = MatrixStacker.of(stack);
MatrixTransformStack stacker = MatrixTransformStack.of(stack);
stacker.centre();
if (dir.getAxis() == Axis.X) stacker.rotateY(90);
if (dir.getAxis() == Axis.Y) stacker.rotateX(90);
@ -202,7 +202,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
for (TransportedItemStack transported : te.getInventory()
.getTransportedItems()) {
ms.pushPose();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.nudge(transported.angle);
float offset = MathHelper.lerp(partialTicks, transported.prevBeltPosition, transported.beltPosition);
float sideOffset = MathHelper.lerp(partialTicks, transported.prevSideOffset, transported.sideOffset);

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.relays.encased;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;

View file

@ -3,9 +3,9 @@ package com.simibubi.create.content.contraptions.relays.encased;
import java.util.ArrayList;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticTileInstance;

View file

@ -4,8 +4,10 @@ import java.util.ArrayList;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -13,7 +15,6 @@ import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.Direction;
import net.minecraft.util.math.MathHelper;
@ -36,7 +37,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
Instancer<ModelData> headModel = getHeadModel();
ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(getInstancePosition());
float progress = MathHelper.lerp(AnimationTickHolder.getPartialTicks(), gaugeTile.prevDialState, gaugeTile.dialState);
@ -66,7 +67,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
float progress = MathHelper.lerp(AnimationTickHolder.getPartialTicks(), gaugeTile.prevDialState, gaugeTile.dialState);
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
for (DialFace faceEntry : faces) {
faceEntry.updateTransform(msr, progress);
@ -99,7 +100,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
this.face = face;
}
private void setupTransform(MatrixStacker msr, float progress) {
private void setupTransform(MatrixTransformStack msr, float progress) {
float dialPivot = 5.75f / 16;
ms.pushPose();
@ -116,7 +117,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
ms.popPose();
}
private void updateTransform(MatrixStacker msr, float progress) {
private void updateTransform(MatrixTransformStack msr, float progress) {
float dialPivot = 5.75f / 16;
ms.pushPose();
@ -131,7 +132,7 @@ public abstract class GaugeInstance extends ShaftInstance implements IDynamicIns
ms.popPose();
}
protected MatrixStacker rotateToFace(MatrixStacker msr) {
protected TransformStack rotateToFace(TransformStack msr) {
return msr.centre()
.rotate(Direction.UP, (float) ((-face.toYRot() - 90) / 180 * Math.PI))
.unCentre();

View file

@ -4,9 +4,9 @@ import java.util.EnumMap;
import java.util.Map;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.curiosities.armor;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.RotatingData;

View file

@ -6,10 +6,10 @@ import java.util.Map;
import com.google.common.collect.ImmutableList;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.util.IStringSerializable;
@ -94,7 +94,7 @@ public class CrossPlaneMirror extends SymmetryMirror {
@Override
public void applyModelTransform(MatrixStack ms) {
super.applyModelTransform(ms);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.centre()
.rotateY(((Align) orientation) == Align.Y ? 0 : 45)
.unCentre();

View file

@ -6,10 +6,10 @@ import java.util.Map;
import com.google.common.collect.ImmutableList;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.util.IStringSerializable;
@ -90,7 +90,7 @@ public class PlaneMirror extends SymmetryMirror {
@Override
public void applyModelTransform(MatrixStack ms) {
super.applyModelTransform(ms);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.centre()
.rotateY(((Align) orientation) == Align.XY ? 0 : 90)
.unCentre();

View file

@ -1,13 +1,13 @@
package com.simibubi.create.content.curiosities.tools;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.curiosities.tools.BlueprintEntity.BlueprintSection;
import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
@ -60,7 +60,7 @@ public class BlueprintRenderer extends EntityRenderer<BlueprintEntity> {
}
int itemLight = MathHelper.floor(sl + .5) << 20 | (MathHelper.floor(bl + .5) & 0xf) << 4;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(vertical ? 0 : -yaw)
.rotateX(fakeNormalXRotation);
Matrix3f copy = ms.last()
@ -70,7 +70,7 @@ public class BlueprintRenderer extends EntityRenderer<BlueprintEntity> {
ms.popPose();
ms.pushPose();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(-yaw)
.rotateX(entity.xRot)
.translate(0, 0, 1 / 32f + .001);

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.curiosities.tools;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.item.render.CustomRenderedItemModelRenderer;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
@ -21,7 +21,7 @@ public class ExtendoGripItemRenderer extends CustomRenderedItemModelRenderer<Ext
@Override
protected void render(ItemStack stack, ExtendoGripModel model, PartialItemModelRenderer renderer, TransformType transformType,
MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
MatrixStacker stacker = MatrixStacker.of(ms);
MatrixTransformStack stacker = MatrixTransformStack.of(ms);
float animation = 0.25f;
boolean leftHand = transformType == TransformType.FIRST_PERSON_LEFT_HAND;
boolean rightHand = transformType == TransformType.FIRST_PERSON_RIGHT_HAND;

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.curiosities.tools;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
@ -64,7 +64,7 @@ public class ExtendoGripRenderHandler {
return;
MatrixStack ms = event.getMatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
AbstractClientPlayerEntity abstractclientplayerentity = mc.player;
mc.getTextureManager()
.bind(abstractclientplayerentity.getSkinTextureLocation());

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.curiosities.weapons;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.item.render.CustomRenderedItemModelRenderer;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
@ -54,7 +54,7 @@ public class PotatoCannonItemRenderer extends CustomRenderedItemModelRenderer<Po
MatrixStack localMs = new MatrixStack();
localMs.translate(-1 / 4f, -1 / 4f, 1);
localMs.scale(.5f, .5f, .5f);
MatrixStacker.of(localMs)
MatrixTransformStack.of(localMs)
.rotateY(-34);
itemRenderer.renderStatic(ammo, TransformType.GUI, light, OverlayTexture.NO_OVERLAY, localMs, buffer);
});

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.curiosities.weapons;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.particle.AirParticleData;
import com.simibubi.create.content.curiosities.zapper.ShootableGadgetRenderHandler;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.Minecraft;
@ -50,14 +50,14 @@ public class PotatoCannonRenderHandler extends ShootableGadgetRenderHandler {
protected void transformTool(MatrixStack ms, float flip, float equipProgress, float recoil, float pt) {
ms.translate(flip * -.1f, 0, .14f);
ms.scale(.75f, .75f, .75f);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateX(recoil * 80);
}
@Override
protected void transformHand(MatrixStack ms, float flip, float equipProgress, float recoil, float pt) {
ms.translate(flip * -.09, -.275, -.25);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateZ(flip * -10);
}

View file

@ -2,9 +2,9 @@ package com.simibubi.create.content.curiosities.weapons;
import static com.simibubi.create.content.curiosities.weapons.PotatoProjectileRenderMode.entityRandom;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@ -30,7 +30,7 @@ public interface PotatoProjectileRenderMode {
.getCenter()
.subtract(p1);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(AngleHelper.deg(MathHelper.atan2(diff.x, diff.z)))
.rotateX(180
+ AngleHelper.deg(MathHelper.atan2(diff.y, -MathHelper.sqrt(diff.x * diff.x + diff.z * diff.z))));
@ -43,7 +43,7 @@ public interface PotatoProjectileRenderMode {
@OnlyIn(Dist.CLIENT)
public void transform(MatrixStack ms, PotatoProjectileEntity entity, float pt) {
super.transform(ms, entity, pt);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateZ((entity.tickCount + pt) * 2 * entityRandom(entity, 16))
.rotateX((entity.tickCount + pt) * entityRandom(entity, 32));
}
@ -63,11 +63,11 @@ public interface PotatoProjectileRenderMode {
@OnlyIn(Dist.CLIENT)
public void transform(MatrixStack ms, PotatoProjectileEntity entity, float pt) {
Vector3d diff = entity.getDeltaMovement();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(AngleHelper.deg(MathHelper.atan2(diff.x, diff.z)))
.rotateX(270
+ AngleHelper.deg(MathHelper.atan2(diff.y, -MathHelper.sqrt(diff.x * diff.x + diff.z * diff.z))));
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY((entity.tickCount + pt) * 20 * spin + entityRandom(entity, 360))
.rotateZ(-spriteAngleOffset);
}
@ -85,7 +85,7 @@ public interface PotatoProjectileRenderMode {
@Override
@OnlyIn(Dist.CLIENT)
public void transform(MatrixStack ms, PotatoProjectileEntity entity, float pt) {
MatrixStacker.of(ms).rotateY(AngleHelper.deg(MathHelper.atan2(offset.x, offset.z)));
MatrixTransformStack.of(ms).rotateY(AngleHelper.deg(MathHelper.atan2(offset.x, offset.z)));
}
}

View file

@ -8,7 +8,7 @@ import java.util.Map;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.logistics.block.FlapData;
@ -28,7 +28,8 @@ public class BeltTunnelInstance extends TileEntityInstance<BeltTunnelTileEntity>
tunnelFlaps = new EnumMap<>(Direction.class);
Instancer<FlapData> model = modelManager.getMaterial(AllMaterialSpecs.FLAPS)
Instancer<FlapData> model = modelManager.defaultSolid()
.material(AllMaterialSpecs.FLAPS)
.getModel(AllBlockPartials.BELT_TUNNEL_FLAP, blockState);
int blockLight = world.getBrightness(LightType.BLOCK, pos);

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.logistics.block.belts.tunnel;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -9,7 +10,6 @@ import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -36,7 +36,7 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer<BeltTunnelTileEn
SuperByteBuffer flapBuffer = PartialBufferer.get(AllBlockPartials.BELT_TUNNEL_FLAP, te.getBlockState());
IVertexBuilder vb = buffer.getBuffer(RenderType.solid());
Vector3d pivot = VecHelper.voxelSpace(0, 10, 1f);
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
for (Direction direction : Iterate.directions) {
if (!te.flaps.containsKey(direction))

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.logistics.block.chute;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.logistics.block.chute.ChuteBlock.Shape;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
@ -38,7 +38,7 @@ public class ChuteRenderer extends SafeTileEntityRenderer<ChuteTileEntity> {
int light, int overlay) {
ItemRenderer itemRenderer = Minecraft.getInstance()
.getItemRenderer();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
ms.pushPose();
msr.centre();
float itemScale = .5f;

View file

@ -2,12 +2,12 @@ package com.simibubi.create.content.logistics.block.depot;
import java.util.Random;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.relays.belt.BeltHelper;
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.Minecraft;
@ -38,7 +38,7 @@ public class DepotRenderer extends SafeTileEntityRenderer<DepotTileEntity> {
int light, int overlay, DepotBehaviour depotBehaviour) {
TransportedItemStack transported = depotBehaviour.heldItem;
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
Vector3d itemPosition = VecHelper.getCenterOf(te.getBlockPos());
ms.pushPose();
@ -102,7 +102,7 @@ public class DepotRenderer extends SafeTileEntityRenderer<DepotTileEntity> {
int angle, Random r, Vector3d itemPosition) {
ItemRenderer itemRenderer = Minecraft.getInstance()
.getItemRenderer();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
int count = (int) (MathHelper.log2((int) (itemStack.getCount()))) / 2;
boolean renderUpright = BeltHelper.isItemUpright(itemStack);
boolean blockItem = itemRenderer.getModel(itemStack, null, null)

View file

@ -1,13 +1,13 @@
package com.simibubi.create.content.logistics.block.depot;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.math.MathHelper;
@ -63,7 +63,7 @@ public class EjectorInstance extends ShaftInstance implements IDynamicInstance {
MatrixStack ms = new MatrixStack();
EjectorRenderer.applyLidAngle(tile, angle, MatrixStacker.of(ms).translate(getInstancePosition()));
EjectorRenderer.applyLidAngle(tile, angle, MatrixTransformStack.of(ms).translate(getInstancePosition()));
plate.setTransform(ms);
}

View file

@ -1,6 +1,8 @@
package com.simibubi.create.content.logistics.block.depot;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -10,7 +12,6 @@ import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.IntAttached;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -52,7 +53,7 @@ public class EjectorRenderer extends KineticTileEntityRenderer {
.renderInto(ms, vertexBuilder);
}
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
float maxTime =
(float) (ejector.earlyTarget != null ? ejector.earlyTargetTime : ejector.launcher.getTotalFlyingTicks());
@ -89,11 +90,11 @@ public class EjectorRenderer extends KineticTileEntityRenderer {
ms.popPose();
}
static void applyLidAngle(KineticTileEntity te, float angle, MatrixStacker matrixStacker) {
static void applyLidAngle(KineticTileEntity te, float angle, TransformStack matrixStacker) {
applyLidAngle(te, pivot, angle, matrixStacker);
}
static void applyLidAngle(KineticTileEntity te, Vector3d rotationOffset, float angle, MatrixStacker matrixStacker) {
static void applyLidAngle(KineticTileEntity te, Vector3d rotationOffset, float angle, TransformStack matrixStacker) {
matrixStacker.centre()
.rotateY(180 + AngleHelper.horizontalAngle(te.getBlockState()
.getValue(EjectorBlock.HORIZONTAL_FACING)))

View file

@ -6,6 +6,7 @@ import java.util.List;
import javax.annotation.Nullable;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
@ -21,7 +22,6 @@ import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.IntAttached;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.Pair;
import com.simibubi.create.foundation.utility.VecHelper;
@ -604,7 +604,7 @@ public class EjectorTileEntity extends KineticTileEntity {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(angle(state))
.rotateX(90);
}

View file

@ -1,13 +1,14 @@
package com.simibubi.create.content.logistics.block.diodes;
import com.jozufozu.flywheel.backend.instancing.ITickableInstance;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
public class AdjustableRepeaterInstance extends TileEntityInstance<AdjustableRepeaterTileEntity> implements ITickableInstance {
@ -18,10 +19,12 @@ public class AdjustableRepeaterInstance extends TileEntityInstance<AdjustableRep
public AdjustableRepeaterInstance(MaterialManager<?> modelManager, AdjustableRepeaterTileEntity tile) {
super(modelManager, tile);
indicator = modelManager.getTransformMaterial().getModel(AllBlockPartials.FLEXPEATER_INDICATOR, blockState).createInstance();
indicator = modelManager.defaultSolid()
.material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.FLEXPEATER_INDICATOR, blockState).createInstance();
MatrixStack ms = new MatrixStack();
MatrixStacker.of(ms).translate(getInstancePosition());
MatrixTransformStack.of(ms).translate(getInstancePosition());
indicator
.setTransform(ms)

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.logistics.block.diodes;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -20,7 +20,7 @@ public class AdjustableRepeaterScrollSlot extends ValueBoxTransform {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
float yRot = AngleHelper.horizontalAngle(state.getValue(BlockStateProperties.HORIZONTAL_FACING)) + 180;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(90);
}

View file

@ -1,10 +1,10 @@
package com.simibubi.create.content.logistics.block.funnel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.logistics.block.funnel.BeltFunnelBlock.Shape;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -59,21 +59,21 @@ public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided {
Shape shape = state.getValue(BeltFunnelBlock.SHAPE);
super.rotate(state, ms);
if (shape == Shape.PULLING || shape == Shape.PUSHING)
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateX(-22.5f);
return;
}
if (state.getBlock() instanceof FunnelBlock) {
super.rotate(state, ms);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateX(-22.5f);
return;
}
float yRot = AngleHelper.horizontalAngle(AbstractFunnelBlock.getFunnelFacing(state))
+ (facing == Direction.DOWN ? 180 : 0);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(facing == Direction.DOWN ? -90 : 90);
}

View file

@ -5,7 +5,7 @@ import java.util.ArrayList;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
@ -29,7 +29,8 @@ public class FunnelInstance extends TileEntityInstance<FunnelTileEntity> impleme
PartialModel flapPartial = (blockState.getBlock() instanceof FunnelBlock ? AllBlockPartials.FUNNEL_FLAP
: AllBlockPartials.BELT_FUNNEL_FLAP);
Instancer<FlapData> model = modelManager.getMaterial(AllMaterialSpecs.FLAPS)
Instancer<FlapData> model = modelManager.defaultSolid()
.material(AllMaterialSpecs.FLAPS)
.getModel(flapPartial, blockState);
int blockLight = world.getBrightness(LightType.BLOCK, pos);

View file

@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.funnel;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -9,7 +10,6 @@ import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -39,7 +39,7 @@ public class FunnelRenderer extends SmartTileEntityRenderer<FunnelTileEntity> {
: AllBlockPartials.BELT_FUNNEL_FLAP);
SuperByteBuffer flapBuffer = PartialBufferer.get(partialModel, blockState);
Vector3d pivot = VecHelper.voxelSpace(0, 10, 9.5f);
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
float horizontalAngle = AngleHelper.horizontalAngle(FunnelBlock.getFunnelFacing(blockState)
.getOpposite());

View file

@ -2,12 +2,12 @@ package com.simibubi.create.content.logistics.block.inventories;
import java.util.List;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
@ -96,7 +96,7 @@ public class CreativeCrateTileEntity extends CrateTileEntity {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateX(90);
}

View file

@ -5,10 +5,11 @@ import java.util.ArrayList;
import com.google.common.collect.Lists;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceData;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.Instancer;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.RotatingData;
@ -16,7 +17,6 @@ import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
@ -122,7 +122,7 @@ public class ArmInstance extends SingleRotatingInstance implements IDynamicInsta
}
MatrixStack msLocal = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(msLocal);
MatrixTransformStack msr = MatrixTransformStack.of(msLocal);
msr.translate(getInstancePosition());
msr.centre();

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.logistics.block.mechanicalArm;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.simibubi.create.AllBlockPartials;
@ -12,7 +13,6 @@ import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
@ -59,7 +59,7 @@ public class ArmRenderer extends KineticTileEntityRenderer {
BlockState blockState = te.getBlockState();
MatrixStack msLocal = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(msLocal);
MatrixTransformStack msr = MatrixTransformStack.of(msLocal);
float baseAngle;
float lowerArmAngle;
@ -109,7 +109,7 @@ public class ArmRenderer extends KineticTileEntityRenderer {
}
private void renderArm(IVertexBuilder builder, MatrixStack ms, MatrixStack msLocal, MatrixStacker msr, BlockState blockState, int color, float baseAngle, float lowerArmAngle, float upperArmAngle, float headAngle, boolean hasItem, boolean isBlockItem, int light) {
private void renderArm(IVertexBuilder builder, MatrixStack ms, MatrixStack msLocal, MatrixTransformStack msr, BlockState blockState, int color, float baseAngle, float lowerArmAngle, float upperArmAngle, float headAngle, boolean hasItem, boolean isBlockItem, int light) {
SuperByteBuffer base = PartialBufferer.get(AllBlockPartials.ARM_BASE, blockState).light(light);
SuperByteBuffer lowerBody = PartialBufferer.get(AllBlockPartials.ARM_LOWER_BODY, blockState).light(light);
SuperByteBuffer upperBody = PartialBufferer.get(AllBlockPartials.ARM_UPPER_BODY, blockState).light(light);
@ -147,7 +147,7 @@ public class ArmRenderer extends KineticTileEntityRenderer {
}
}
private void doItemTransforms(MatrixStacker msr, float baseAngle, float lowerArmAngle, float upperArmAngle, float headAngle) {
private void doItemTransforms(MatrixTransformStack msr, float baseAngle, float lowerArmAngle, float upperArmAngle, float headAngle) {
transformBase(msr, baseAngle);
transformLowerArm(msr, lowerArmAngle);
@ -156,32 +156,32 @@ public class ArmRenderer extends KineticTileEntityRenderer {
transformClaw(msr);
}
public static void transformClawHalf(MatrixStacker msr, boolean hasItem, boolean isBlockItem, int flip) {
public static void transformClawHalf(MatrixTransformStack msr, boolean hasItem, boolean isBlockItem, int flip) {
msr.translate(0, flip * 3 / 16d, -1 / 16d);
msr.rotateX(flip * (hasItem ? isBlockItem ? 0 : -35 : 0));
}
public static void transformClaw(MatrixStacker msr) {
public static void transformClaw(MatrixTransformStack msr) {
msr.translate(0, 0, -4 / 16d);
}
public static void transformHead(MatrixStacker msr, float headAngle) {
public static void transformHead(MatrixTransformStack msr, float headAngle) {
msr.translate(0, 11 / 16d, -11 / 16d);
msr.rotateX(headAngle);
}
public static void transformUpperArm(MatrixStacker msr, float upperArmAngle) {
public static void transformUpperArm(MatrixTransformStack msr, float upperArmAngle) {
msr.translate(0, 12 / 16d, 12 / 16d);
msr.rotateX(upperArmAngle);
}
public static void transformLowerArm(MatrixStacker msr, float lowerArmAngle) {
public static void transformLowerArm(MatrixTransformStack msr, float lowerArmAngle) {
msr.translate(0, 1 / 16d, -2 / 16d);
msr.rotateX(lowerArmAngle);
msr.translate(0, -1 / 16d, 0);
}
public static void transformBase(MatrixStacker msr, float baseAngle) {
public static void transformBase(MatrixTransformStack msr, float baseAngle) {
msr.translate(0, 4 / 16d, 0);
msr.rotateY(baseAngle);
}

View file

@ -1,16 +1,16 @@
package com.simibubi.create.content.logistics.block.redstone;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.state.properties.AttachFace;
import net.minecraft.util.Direction;
@ -46,7 +46,7 @@ public class AnalogLeverInstance extends TileEntityInstance<AnalogLeverTileEntit
protected void animateLever() {
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(getInstancePosition());
transform(msr);
@ -76,7 +76,7 @@ public class AnalogLeverInstance extends TileEntityInstance<AnalogLeverTileEntit
relight(pos, handle, indicator);
}
private void transform(MatrixStacker msr) {
private void transform(MatrixTransformStack msr) {
msr.centre()
.rotate(Direction.UP, (float) (rY / 180 * Math.PI))
.rotate(Direction.EAST, (float) (rX / 180 * Math.PI))

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.logistics.block.redstone;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -21,7 +21,7 @@ public class FilteredDetectorFilterSlot extends ValueBoxTransform {
@Override
protected void rotate(BlockState state, MatrixStack ms) {
float yRot = AngleHelper.horizontalAngle(state.getValue(HorizontalBlock.FACING)) + 180;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(90);
}

View file

@ -4,12 +4,12 @@ import java.util.Map;
import java.util.Random;
import com.google.common.collect.ImmutableMap;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
@ -59,7 +59,7 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
int light, int overlay) {
ms.pushPose();
BlockState blockState = te.getBlockState();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.centre()
.rotateY(AngleHelper.horizontalAngle(blockState.getValue(NixieTubeBlock.FACING)));

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.logistics.block.redstone;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -45,7 +45,7 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual {
float yRot = facing.getAxis()
.isVertical() ? 0 : AngleHelper.horizontalAngle(facing) + 180;
float xRot = facing == Direction.UP ? 90 : facing == Direction.DOWN ? 270 : 0;
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateY(yRot)
.rotateX(xRot);
}

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.logistics.item;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -34,7 +34,7 @@ public class LecternControllerRenderer extends SafeTileEntityRenderer<LecternCon
boolean usedByMe = te.isUsedBy(Minecraft.getInstance().player);
Direction facing = te.getBlockState().getValue(LecternControllerBlock.FACING);
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
ms.pushPose();
msr.translate(0.5, 1.45, 0.5);

View file

@ -2,13 +2,13 @@ package com.simibubi.create.content.logistics.item;
import java.util.Vector;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllItems;
import com.simibubi.create.content.logistics.item.LinkedControllerClientHandler.Mode;
import com.simibubi.create.foundation.item.render.CustomRenderedItemModelRenderer;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.animation.LerpedFloat;
import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser;
@ -63,7 +63,7 @@ public class LinkedControllerItemRenderer extends CustomRenderedItemModelRendere
int light, Boolean active, Boolean usedByMe) {
float pt = AnimationTickHolder.getPartialTicks();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
ms.pushPose();

View file

@ -1,14 +1,14 @@
package com.simibubi.create.content.schematics.block;
import com.jozufozu.flywheel.backend.instancing.IDynamicInstance;
import com.jozufozu.flywheel.backend.instancing.InstanceMaterial;
import com.jozufozu.flywheel.backend.instancing.MaterialManager;
import com.jozufozu.flywheel.backend.material.InstanceMaterial;
import com.jozufozu.flywheel.backend.material.MaterialManager;
import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance;
import com.jozufozu.flywheel.core.materials.ModelData;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.util.Direction;
@ -40,7 +40,7 @@ public class SchematicannonInstance extends TileEntityInstance<SchematicannonTil
double recoil = SchematicannonRenderer.getRecoil(tile, partialTicks);
MatrixStack ms = new MatrixStack();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
msr.translate(getInstancePosition());

View file

@ -9,12 +9,12 @@ import java.util.Set;
import org.lwjgl.opengl.GL11;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.schematics.SchematicWorld;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.TileEntityRenderHelper;
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
@ -95,7 +95,7 @@ public class SchematicRenderer {
BlockPos.betweenClosedStream(blockAccess.getBounds())
.forEach(localPos -> {
ms.pushPose();
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(localPos);
BlockPos pos = localPos.offset(anchor);
BlockState state = blockAccess.getBlockState(pos);

View file

@ -2,11 +2,11 @@ package com.simibubi.create.content.schematics.client;
import static java.lang.Math.abs;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingAngle;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.util.Direction.Axis;
@ -63,7 +63,7 @@ public class SchematicTransformation {
float lr = getScaleLR().get(pt);
float rot = rotation.get(pt) + ((fb < 0 && lr < 0) ? 180 : 0);
ms.translate(xOrigin, 0, zOrigin);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(rotationOffset)
.rotateY(rot)
.translateBack(rotationOffset);

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.schematics.client.tools;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllKeys;
import com.simibubi.create.content.schematics.client.SchematicTransformation;
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.MatrixStacker;
import com.simibubi.create.foundation.utility.outliner.AABBOutline;
import net.minecraft.item.ItemStack;
@ -59,7 +59,7 @@ public class DeployTool extends PlacementToolBase {
Vector3d origin = new Vector3d(xOrigin, 0, zOrigin);
ms.translate(x - centerX, y, z - centerZ);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(origin)
.translate(rotationOffset)
.rotateY(transformation.getCurrentRotation())

View file

@ -2,6 +2,7 @@ package com.simibubi.create.foundation.fluid;
import java.util.function.Function;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.matrix.MatrixStack.Entry;
import com.mojang.blaze3d.vertex.IVertexBuilder;
@ -9,7 +10,6 @@ import com.simibubi.create.foundation.renderState.RenderTypes;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -58,7 +58,7 @@ public class FluidRenderer {
if (inbound)
direction = direction.getOpposite();
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
ms.pushPose();
msr.centre()
.rotateY(AngleHelper.horizontalAngle(direction))
@ -107,12 +107,12 @@ public class FluidRenderer {
light = (light & 0xF00000) | luminosity << 4;
Vector3d center = new Vector3d(xMin + (xMax - xMin) / 2, yMin + (yMax - yMin) / 2, zMin + (zMax - zMin) / 2);
MatrixStacker msr = MatrixStacker.of(ms);
MatrixTransformStack msr = MatrixTransformStack.of(ms);
ms.pushPose();
if (fluidStack.getFluid()
.getAttributes()
.isLighterThanAir())
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.translate(center)
.rotateX(180)
.translateBack(center);

View file

@ -2,6 +2,7 @@ package com.simibubi.create.foundation.gui.mainMenu;
import java.awt.Color;
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
@ -17,7 +18,6 @@ import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.ponder.content.PonderTagIndexScreen;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.MatrixStacker;
import net.minecraft.client.gui.screen.ConfirmOpenLinkScreen;
import net.minecraft.client.gui.screen.MainMenuScreen;
@ -87,7 +87,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen {
ms.translate(width / 2, 60, 200);
ms.scale(24 * side, 24 * side, 32);
ms.translate(-1.75 * ((alpha * alpha) / 2f + .5f), .25f, 0);
MatrixStacker.of(ms)
MatrixTransformStack.of(ms)
.rotateX(45);
GuiGameElement.of(AllBlocks.LARGE_COGWHEEL.getDefaultState())
.rotateBlock(0, Util.getMillis() / 32f * side, 0)

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