mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:11:35 +01:00
everything is somewhere else
This commit is contained in:
parent
67408e0dff
commit
31a1fd71ce
130 changed files with 405 additions and 499 deletions
|
@ -1,11 +1,14 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.content.contraptions.base.KineticRenderMaterials;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.content.contraptions.fluids.FluidTransportBehaviour.AttachmentTypes;
|
||||
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.BeltData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
|
|
|
@ -12,10 +12,10 @@ import com.simibubi.create.foundation.block.render.SpriteShifter;
|
|||
import com.simibubi.create.foundation.item.CustomItemModels;
|
||||
import com.simibubi.create.foundation.item.CustomRenderedItems;
|
||||
import com.simibubi.create.foundation.render.KineticRenderer;
|
||||
import com.simibubi.create.foundation.render.gl.backend.OptifineHandler;
|
||||
import com.simibubi.create.foundation.render.backend.OptifineHandler;
|
||||
import com.simibubi.create.foundation.render.SuperByteBufferCache;
|
||||
import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import com.simibubi.create.foundation.utility.outliner.Outliner;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import net.minecraft.block.BlockState;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package com.simibubi.create.foundation.render.instancing;
|
||||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceData;
|
||||
import com.simibubi.create.foundation.utility.ColorHelper;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec.*;
|
||||
|
||||
public class KineticData<D extends KineticData<D>> extends InstanceData {
|
||||
private float x;
|
||||
private float y;
|
|
@ -0,0 +1,13 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.content.contraptions.relays.belt.BeltData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.MaterialType;
|
||||
import com.simibubi.create.content.contraptions.components.actors.ContraptionActorData;
|
||||
|
||||
public class KineticRenderMaterials {
|
||||
public static final MaterialType<InstancedModel<RotatingData>> ROTATING = new MaterialType<>();
|
||||
public static final MaterialType<InstancedModel<BeltData>> BELTS = new MaterialType<>();
|
||||
|
||||
public static final MaterialType<InstancedModel<ContraptionActorData>> ACTORS = new MaterialType<>();
|
||||
}
|
|
@ -11,8 +11,8 @@ import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation
|
|||
import com.simibubi.create.foundation.advancement.AllTriggers;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.instancing.IInstanceRendered;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered;
|
||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
|
|
|
@ -6,9 +6,7 @@ import com.simibubi.create.AllBlocks;
|
|||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.content.contraptions.KineticDebugger;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.config.ConfigBase;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.ColorHelper;
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.base;
|
|||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.LightType;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec;
|
||||
|
||||
public enum KineticVertexAttributes implements IVertexAttrib {
|
||||
INSTANCE_POSITION("aInstancePos", CommonAttributes.VEC3),
|
|
@ -1,15 +1,11 @@
|
|||
package com.simibubi.create.foundation.render.instancing;
|
||||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.KineticVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.RotatingVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.NORMAL;
|
||||
|
||||
public class RotatingData extends KineticData<RotatingData> {
|
||||
public static VertexFormat FORMAT = VertexFormat.builder()
|
||||
.addAttributes(KineticVertexAttributes.class)
|
|
@ -0,0 +1,22 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
|
||||
public class RotatingInstancedModel extends InstancedModel<RotatingData> {
|
||||
public RotatingInstancedModel(BufferBuilder buf) {
|
||||
super(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RotatingData newInstance() {
|
||||
return new RotatingData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VertexFormat getInstanceFormat() {
|
||||
return RotatingData.FORMAT;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec;
|
||||
|
||||
public enum RotatingVertexAttributes implements IVertexAttrib {
|
||||
AXIS("aAxis", CommonAttributes.NORMAL),
|
|
@ -1,10 +1,9 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
package com.simibubi.create.content.contraptions.components.actors;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec;
|
||||
|
||||
public enum ActorVertexAttributes implements IVertexAttrib {
|
||||
INSTANCE_POSITION("aInstancePos", CommonAttributes.VEC3),
|
|
@ -1,15 +1,13 @@
|
|||
package com.simibubi.create.foundation.render.instancing.actors;
|
||||
package com.simibubi.create.content.contraptions.components.actors;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.ActorVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.instancing.InstanceData;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceData;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class StaticRotatingActorData extends InstanceData {
|
||||
public class ContraptionActorData extends InstanceData {
|
||||
public static VertexFormat FORMAT = VertexFormat.builder()
|
||||
.addAttributes(ActorVertexAttributes.class)
|
||||
.build();
|
||||
|
@ -30,58 +28,58 @@ public class StaticRotatingActorData extends InstanceData {
|
|||
private byte rotationCenterY = 64;
|
||||
private byte rotationCenterZ = 64;
|
||||
|
||||
public StaticRotatingActorData setPosition(BlockPos pos) {
|
||||
public ContraptionActorData setPosition(BlockPos pos) {
|
||||
this.x = pos.getX();
|
||||
this.y = pos.getY();
|
||||
this.z = pos.getZ();
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setBlockLight(int blockLight) {
|
||||
public ContraptionActorData setBlockLight(int blockLight) {
|
||||
this.blockLight = (byte) ((blockLight & 0xF) << 4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setSkyLight(int skyLight) {
|
||||
public ContraptionActorData setSkyLight(int skyLight) {
|
||||
this.skyLight = (byte) ((skyLight & 0xF) << 4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setRotationOffset(float rotationOffset) {
|
||||
public ContraptionActorData setRotationOffset(float rotationOffset) {
|
||||
this.rotationOffset = rotationOffset;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setRotationAxis(Vector3f axis) {
|
||||
public ContraptionActorData setRotationAxis(Vector3f axis) {
|
||||
setRotationAxis(axis.getX(), axis.getY(), axis.getZ());
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) {
|
||||
public ContraptionActorData setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) {
|
||||
this.rotationAxisX = (byte) (rotationAxisX * 127);
|
||||
this.rotationAxisY = (byte) (rotationAxisY * 127);
|
||||
this.rotationAxisZ = (byte) (rotationAxisZ * 127);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setRotationCenter(Vector3f axis) {
|
||||
public ContraptionActorData setRotationCenter(Vector3f axis) {
|
||||
setRotationCenter(axis.getX(), axis.getY(), axis.getZ());
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setRotationCenter(float rotationCenterX, float rotationCenterY, float rotationCenterZ) {
|
||||
public ContraptionActorData setRotationCenter(float rotationCenterX, float rotationCenterY, float rotationCenterZ) {
|
||||
this.rotationCenterX = (byte) (rotationCenterX * 127);
|
||||
this.rotationCenterY = (byte) (rotationCenterY * 127);
|
||||
this.rotationCenterZ = (byte) (rotationCenterZ * 127);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setLocalRotation(Vector3f axis) {
|
||||
public ContraptionActorData setLocalRotation(Vector3f axis) {
|
||||
setLocalRotation(axis.getX(), axis.getY(), axis.getZ());
|
||||
return this;
|
||||
}
|
||||
|
||||
public StaticRotatingActorData setLocalRotation(float localRotationX, float localRotationY, float localRotationZ) {
|
||||
public ContraptionActorData setLocalRotation(float localRotationX, float localRotationY, float localRotationZ) {
|
||||
this.localRotationX = localRotationX;
|
||||
this.localRotationY = localRotationY;
|
||||
this.localRotationZ = localRotationZ;
|
|
@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.components.actors;
|
|||
|
||||
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.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
@ -25,10 +25,10 @@ public class DrillInstance extends SingleRotatingInstance {
|
|||
}
|
||||
|
||||
public static void addInstanceForContraption(RenderedContraption contraption, MovementContext context) {
|
||||
RenderMaterial<?, InstancedModel<StaticRotatingActorData>> renderMaterial = contraption.getActorMaterial();
|
||||
RenderMaterial<?, InstancedModel<ContraptionActorData>> renderMaterial = contraption.getActorMaterial();
|
||||
|
||||
BlockState state = context.state;
|
||||
InstancedModel<StaticRotatingActorData> model = renderMaterial.getModel(AllBlockPartials.DRILL_HEAD, state);
|
||||
InstancedModel<ContraptionActorData> model = renderMaterial.getModel(AllBlockPartials.DRILL_HEAD, state);
|
||||
|
||||
model.setupInstance(data -> {
|
||||
Direction facing = state.get(DrillBlock.FACING);
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors;
|
|||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors;
|
|||
|
||||
import static net.minecraft.block.HorizontalBlock.HORIZONTAL_FACING;
|
||||
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
|
|
@ -5,10 +5,9 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC
|
|||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.RenderMaterial;
|
||||
import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.RenderMaterial;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
@ -41,10 +40,10 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
|
|||
}
|
||||
|
||||
public static void addInstanceForContraption(RenderedContraption contraption, MovementContext context) {
|
||||
RenderMaterial<?, InstancedModel<StaticRotatingActorData>> renderMaterial = contraption.getActorMaterial();
|
||||
RenderMaterial<?, InstancedModel<ContraptionActorData>> renderMaterial = contraption.getActorMaterial();
|
||||
|
||||
BlockState state = context.state;
|
||||
InstancedModel<StaticRotatingActorData> model = renderMaterial.getModel(AllBlockPartials.HARVESTER_BLADE, state);
|
||||
InstancedModel<ContraptionActorData> model = renderMaterial.getModel(AllBlockPartials.HARVESTER_BLADE, state);
|
||||
|
||||
model.setupInstance(data -> {
|
||||
Direction facing = state.get(HORIZONTAL_FACING);
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.simibubi.create.content.contraptions.components.actors;
|
||||
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
|
||||
public class RotatingActorModel extends InstancedModel<ContraptionActorData> {
|
||||
public RotatingActorModel(BufferBuilder buf) {
|
||||
super(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VertexFormat getInstanceFormat() {
|
||||
return ContraptionActorData.FORMAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ContraptionActorData newInstance() {
|
||||
return new ContraptionActorData();
|
||||
}
|
||||
}
|
|
@ -4,10 +4,10 @@ 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.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.MatrixStacker;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.simibubi.create.AllBlockPartials;
|
|||
import com.simibubi.create.AllSpriteShifts;
|
||||
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity.Phase;
|
||||
import com.simibubi.create.content.contraptions.components.crafter.RecipeGridHandler.GroupedItems;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
|
|
|
@ -11,8 +11,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
|||
import com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity.Mode;
|
||||
import com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity.State;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
|
|
|
@ -7,8 +7,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ package com.simibubi.create.content.contraptions.components.fan;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.components.flywheel;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.simibubi.create.content.contraptions.components.millstone;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
|
|
@ -5,8 +5,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ import com.simibubi.create.AllBlockPartials;
|
|||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Rotation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
|
|
@ -8,8 +8,7 @@ import com.simibubi.create.CreateClient;
|
|||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.culling.ClippingHelperImpl;
|
||||
|
|
|
@ -24,8 +24,7 @@ import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateBl
|
|||
import com.simibubi.create.content.logistics.block.redstone.RedstoneContactBlock;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.fluid.CombinedTankWrapper;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.light.EmptyLighter;
|
||||
import com.simibubi.create.foundation.render.backend.light.EmptyLighter;
|
||||
import com.simibubi.create.foundation.utility.BlockFace;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.NBTHelper;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.light;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement;
|
||||
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
import com.simibubi.create.foundation.render.backend.light.LightVolume;
|
||||
|
||||
public abstract class ContraptionLighter<C extends Contraption> {
|
||||
protected final C contraption;
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import java.util.Random;
|
||||
|
||||
import com.simibubi.create.foundation.render.*;
|
||||
import net.minecraft.world.lighting.WorldLightManager;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement;
|
|||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement;
|
||||
|
||||
import com.simibubi.create.foundation.render.contraption.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.light.GridAlignedBB;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
|
||||
public class NonStationaryLighter<C extends Contraption> extends ContraptionLighter<C> {
|
||||
public NonStationaryLighter(C contraption) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
||||
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
||||
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.light.GridAlignedBB;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be
|
|||
import com.simibubi.create.content.contraptions.components.structureMovement.AllContraptionTypes;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.All
|
|||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity.CartMovementMode;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.NBTHelper;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Blo
|
|||
import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.CarpetBlock;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement.piston;
|
||||
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.light.GridAlignedBB;
|
||||
import net.minecraft.util.Direction;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
public class PistonLighter extends ContraptionLighter<PistonContraption> {
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu
|
|||
import com.simibubi.create.content.contraptions.components.structureMovement.AllContraptionTypes;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption;
|
||||
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.light.GridAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel;
|
||||
import com.simibubi.create.content.contraptions.base.KineticRenderMaterials;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.RenderMaterial;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingInstancedModel;
|
||||
import com.simibubi.create.content.contraptions.components.actors.RotatingActorModel;
|
||||
|
||||
public class ContraptionKineticRenderer extends InstancedTileRenderer<ContraptionProgram> {
|
||||
|
||||
@Override
|
||||
public void registerMaterials() {
|
||||
materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_BELT, BeltInstancedModel::new));
|
||||
materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ROTATING, RotatingInstancedModel::new));
|
||||
materials.put(KineticRenderMaterials.ACTORS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ACTOR, RotatingActorModel::new));
|
||||
}
|
||||
}
|
|
@ -1,17 +1,12 @@
|
|||
package com.simibubi.create.foundation.render.contraption;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.simibubi.create.foundation.render.BufferedModel;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.ContraptionVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.BufferedModel;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.LIGHT;
|
||||
import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.RGBA;
|
||||
|
||||
public class ContraptionModel extends BufferedModel {
|
||||
public static final VertexFormat FORMAT = VertexFormat.builder()
|
||||
.addAttributes(ContraptionVertexAttributes.class)
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.render.contraption;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.light.GridAlignedBB;
|
||||
import com.simibubi.create.foundation.render.backend.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.backend.light.GridAlignedBB;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL20;
|
|
@ -1,14 +1,13 @@
|
|||
package com.simibubi.create.foundation.render.contraption;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionHandler;
|
||||
import com.simibubi.create.foundation.render.AllProgramSpecs;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec;
|
||||
|
||||
public enum ContraptionVertexAttributes implements IVertexAttrib {
|
||||
VERTEX_POSITION("aPos", CommonAttributes.VEC3),
|
|
@ -1,13 +1,14 @@
|
|||
package com.simibubi.create.foundation.render.contraption;
|
||||
package com.simibubi.create.content.contraptions.components.structureMovement.render;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.AllMovementBehaviours;
|
||||
import com.simibubi.create.content.contraptions.base.KineticRenderMaterials;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData;
|
||||
import com.simibubi.create.foundation.render.light.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import com.simibubi.create.content.contraptions.components.actors.ContraptionActorData;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
|
||||
import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
|
@ -67,7 +68,7 @@ public class RenderedContraption {
|
|||
return lighter;
|
||||
}
|
||||
|
||||
public RenderMaterial<?, InstancedModel<StaticRotatingActorData>> getActorMaterial() {
|
||||
public RenderMaterial<?, InstancedModel<ContraptionActorData>> getActorMaterial() {
|
||||
return kinetics.getMaterial(KineticRenderMaterials.ACTORS);
|
||||
}
|
||||
|
|
@ -3,10 +3,10 @@ package com.simibubi.create.content.contraptions.fluids;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.relays.advanced;
|
|||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
package com.simibubi.create.foundation.render.instancing;
|
||||
package com.simibubi.create.content.contraptions.relays.belt;
|
||||
|
||||
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
||||
import com.simibubi.create.foundation.render.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.BeltVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.KineticVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.content.contraptions.base.KineticVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.base.KineticData;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec.*;
|
||||
|
||||
public class BeltData extends KineticData<BeltData> {
|
||||
public static VertexFormat FORMAT = VertexFormat.builder()
|
||||
.addAttributes(KineticVertexAttributes.class)
|
|
@ -4,9 +4,10 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.MatrixStacker;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.simibubi.create.content.contraptions.relays.belt;
|
||||
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
|
||||
public class BeltInstancedModel extends InstancedModel<BeltData> {
|
||||
public BeltInstancedModel(BufferBuilder buf) {
|
||||
super(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BeltData newInstance() {
|
||||
return new BeltData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VertexFormat getInstanceFormat() {
|
||||
return BeltData.FORMAT;
|
||||
}
|
||||
|
||||
}
|
|
@ -9,7 +9,7 @@ import com.simibubi.create.CreateClient;
|
|||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
||||
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.ShadowRenderHelper;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
package com.simibubi.create.content.contraptions.relays.belt;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
import com.simibubi.create.foundation.render.instancing.BeltData;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec;
|
||||
|
||||
public enum BeltVertexAttributes implements IVertexAttrib {
|
||||
INSTANCE_ROTATION("aInstanceRot", CommonAttributes.VEC3),
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.relays.encased;
|
|||
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
|
|
@ -3,11 +3,11 @@ package com.simibubi.create.content.contraptions.relays.encased;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.simibubi.create.AllBlockPartials;
|
|||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
|
@ -17,7 +17,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
|||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import sun.nio.cs.FastCharsetProvider;
|
||||
|
||||
public class SplitShaftRenderer extends KineticTileEntityRenderer {
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.relays.gearbox;
|
|||
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstanceKey;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
|
|
@ -4,7 +4,7 @@ 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.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.simibubi.create.content.logistics.block.mechanicalArm;
|
|||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.foundation.render.instancing.RotatingData;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingData;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
package com.simibubi.create.content.schematics.client;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.contraption.ContraptionKineticRenderer;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionKineticRenderer;
|
||||
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.loading.FMLClientLaunchProvider;
|
||||
|
||||
public class SchematicRendererWithInstancing extends SchematicRenderer {
|
||||
public final ContraptionKineticRenderer tiles;
|
||||
|
|
|
@ -24,9 +24,9 @@ import com.simibubi.create.foundation.gui.ScreenOpener;
|
|||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.networking.AllPackets;
|
||||
import com.simibubi.create.foundation.networking.LeftClickPacket;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.RenderWork;
|
||||
import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
|
||||
import com.simibubi.create.foundation.tileEntity.behaviour.edgeInteraction.EdgeInteractionRenderer;
|
||||
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
|
||||
|
|
|
@ -3,8 +3,7 @@ package com.simibubi.create.foundation.command;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import com.simibubi.create.content.contraptions.goggles.GoggleConfigScreen;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.config;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
|
||||
public class CClient extends ConfigBase {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.instancing.IInstanceRendered;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered;
|
||||
import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -11,7 +11,6 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import net.minecraft.client.multiplayer.ClientChunkProvider;
|
||||
import net.minecraft.util.math.SectionPos;
|
||||
import net.minecraft.world.LightType;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.simibubi.create.foundation.render.FastRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.mixin;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.backend.OptifineHandler;
|
||||
import com.simibubi.create.foundation.render.backend.OptifineHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.VideoSettingsScreen;
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.foundation.render.contraption.ContraptionProgram;
|
||||
import com.simibubi.create.foundation.render.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.impl.*;
|
||||
import com.simibubi.create.foundation.render.gl.shader.ProgramSpec;
|
||||
import com.simibubi.create.foundation.render.gl.shader.ShaderConstants;
|
||||
import com.simibubi.create.content.contraptions.base.KineticVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.components.actors.ActorVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.BeltVertexAttributes;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionProgram;
|
||||
import com.simibubi.create.foundation.render.backend.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.ModelVertexAttributes;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.ShaderConstants;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import static com.simibubi.create.foundation.render.gl.backend.Backend.register;
|
||||
import static com.simibubi.create.foundation.render.backend.Backend.register;
|
||||
|
||||
public class AllProgramSpecs {
|
||||
public static final ProgramSpec<BasicProgram> ROTATING = register(ProgramSpec.builder("rotating", BasicProgram::new)
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.instancing.*;
|
||||
import com.simibubi.create.content.contraptions.base.KineticRenderMaterials;
|
||||
import com.simibubi.create.content.contraptions.base.RotatingInstancedModel;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel;
|
||||
import com.simibubi.create.foundation.render.backend.gl.BasicProgram;
|
||||
import com.simibubi.create.foundation.render.backend.instancing.*;
|
||||
|
||||
public class KineticRenderer extends InstancedTileRenderer<BasicProgram> {
|
||||
@Override
|
||||
public void registerMaterials() {
|
||||
materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.BELT, BeltModel::new));
|
||||
materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.ROTATING, RotatingModel::new));
|
||||
materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.BELT, BeltInstancedModel::new));
|
||||
materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.ROTATING, RotatingInstancedModel::new));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.gl.GlBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.simibubi.create.foundation.render.gl.backend;
|
||||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.shader.GlProgram;
|
||||
import com.simibubi.create.foundation.render.gl.shader.GlShader;
|
||||
import com.simibubi.create.foundation.render.gl.shader.ProgramSpec;
|
||||
import com.simibubi.create.foundation.render.gl.shader.ShaderType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.GlProgram;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.GlShader;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.ShaderType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.versioned.GlVersioned;
|
||||
import com.simibubi.create.foundation.render.backend.gl.versioned.MapBuffer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureUtil;
|
||||
import net.minecraft.resources.IReloadableResourceManager;
|
||||
|
@ -16,6 +17,7 @@ import net.minecraftforge.resource.ISelectiveResourceReloadListener;
|
|||
import net.minecraftforge.resource.VanillaResourceType;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.opengl.ARBVertexProgram;
|
||||
import org.lwjgl.opengl.GL;
|
||||
import org.lwjgl.opengl.GLCapabilities;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
@ -54,10 +56,6 @@ public class Backend {
|
|||
mapBuffer.mapBuffer(target, offset, length, upload);
|
||||
}
|
||||
|
||||
public static void mapBuffer(int target, int size, Consumer<ByteBuffer> upload) {
|
||||
mapBuffer.mapBuffer(target, 0, size, upload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a shader program. TODO: replace with forge registry?
|
||||
*/
|
|
@ -1,9 +1,10 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.gl.GlBuffer;
|
||||
import com.simibubi.create.foundation.render.RenderWork;
|
||||
import com.simibubi.create.foundation.render.TemplateBuffer;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
@ -38,7 +39,7 @@ public abstract class BufferedModel extends TemplateBuffer {
|
|||
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, invariantSize, GL15.GL_STATIC_DRAW);
|
||||
|
||||
// mirror it in system memory so we can write to it
|
||||
Backend.mapBuffer(GL15.GL_ARRAY_BUFFER, invariantSize, buffer -> {
|
||||
modelVBO.map(invariantSize, buffer -> {
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
copyVertex(buffer, i);
|
||||
}
|
||||
|
@ -53,7 +54,7 @@ public abstract class BufferedModel extends TemplateBuffer {
|
|||
ebo.bind();
|
||||
|
||||
GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW);
|
||||
Backend.mapBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, indices -> {
|
||||
ebo.map(indicesSize, indices -> {
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
indices.putShort((short) i);
|
||||
}
|
||||
|
@ -106,7 +107,7 @@ public abstract class BufferedModel extends TemplateBuffer {
|
|||
GL20.glEnableVertexAttribArray(i);
|
||||
}
|
||||
|
||||
getModelFormat().informAttributes(0);
|
||||
getModelFormat().vertexAttribPointers(0);
|
||||
}
|
||||
|
||||
public void delete() {
|
|
@ -1,14 +1,15 @@
|
|||
package com.simibubi.create.foundation.render;
|
||||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.content.contraptions.KineticDebugger;
|
||||
import com.simibubi.create.content.schematics.SchematicWorld;
|
||||
import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.gl.backend.OptifineHandler;
|
||||
import com.simibubi.create.foundation.render.light.ILightListener;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||
import com.simibubi.create.foundation.render.RenderWork;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.OptifineHandler;
|
||||
import com.simibubi.create.foundation.render.backend.light.ILightListener;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.WorldAttached;
|
||||
import net.minecraft.client.Minecraft;
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.backend;
|
||||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.backend;
|
||||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
public enum SystemCapability {
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.gl.shader.GlProgram;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.gl.shader.GlProgram;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -33,6 +33,10 @@ public class GlBuffer extends GlObject {
|
|||
unbind();
|
||||
}
|
||||
|
||||
public void map(int length, Consumer<ByteBuffer> upload) {
|
||||
Backend.mapBuffer(bufferType, 0, length, upload);
|
||||
}
|
||||
|
||||
public void map(int offset, int length, Consumer<ByteBuffer> upload) {
|
||||
Backend.mapBuffer(bufferType, offset, length, upload);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
// Utility class for safely dealing with gl object handles.
|
||||
public abstract class GlObject {
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl;
|
||||
package com.simibubi.create.foundation.render.backend.gl;
|
||||
|
||||
import org.lwjgl.opengl.GL30;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib;
|
||||
package com.simibubi.create.foundation.render.backend.gl.attrib;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType;
|
||||
|
||||
public class CommonAttributes {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib;
|
||||
package com.simibubi.create.foundation.render.backend.gl.attrib;
|
||||
|
||||
public interface IVertexAttrib {
|
||||
|
|
@ -1,8 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib.impl;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec;
|
||||
package com.simibubi.create.foundation.render.backend.gl.attrib;
|
||||
|
||||
public enum ModelVertexAttributes implements IVertexAttrib {
|
||||
VERTEX_POSITION("aPos", CommonAttributes.VEC3),
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib;
|
||||
package com.simibubi.create.foundation.render.backend.gl.attrib;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
||||
public class VertexAttribSpec {
|
||||
|
@ -23,8 +23,8 @@ public class VertexAttribSpec {
|
|||
this.normalized = normalized;
|
||||
}
|
||||
|
||||
public void registerForBuffer(int stride, int indexAcc, int offsetAcc) {
|
||||
GL20.glVertexAttribPointer(indexAcc, count, type.getGlConstant(), normalized, stride, offsetAcc);
|
||||
public void vertexAttribPointer(int stride, int index, int pointer) {
|
||||
GL20.glVertexAttribPointer(index, count, type.getGlConstant(), normalized, stride, pointer);
|
||||
}
|
||||
|
||||
public int getSize() {
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.attrib;
|
||||
package com.simibubi.create.foundation.render.backend.gl.attrib;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -31,11 +31,11 @@ public class VertexFormat {
|
|||
return stride;
|
||||
}
|
||||
|
||||
public void informAttributes(int index) {
|
||||
public void vertexAttribPointers(int index) {
|
||||
int offset = 0;
|
||||
for (IVertexAttrib attrib : this.allAttributes) {
|
||||
VertexAttribSpec spec = attrib.attribSpec();
|
||||
spec.registerForBuffer(stride, index, offset);
|
||||
spec.vertexAttribPointer(stride, index, offset);
|
||||
index += spec.getAttributeCount();
|
||||
offset += spec.getSize();
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create.foundation.render.gl.shader;
|
||||
package com.simibubi.create.foundation.render.backend.gl.shader;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlPrimitiveType;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType;
|
||||
|
||||
public class GLSLType {
|
||||
public static final GLSLType FLOAT = new GLSLType("mat4", GlPrimitiveType.FLOAT, 16);
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.foundation.render.gl.shader;
|
||||
package com.simibubi.create.foundation.render.backend.gl.shader;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlObject;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlObject;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.render.gl.shader;
|
||||
package com.simibubi.create.foundation.render.backend.gl.shader;
|
||||
|
||||
import com.simibubi.create.foundation.render.gl.GlObject;
|
||||
import com.simibubi.create.foundation.render.gl.backend.Backend;
|
||||
import com.simibubi.create.foundation.render.backend.gl.GlObject;
|
||||
import com.simibubi.create.foundation.render.backend.Backend;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.foundation.render.gl.shader;
|
||||
package com.simibubi.create.foundation.render.backend.gl.shader;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib;
|
||||
import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
|
@ -1,4 +1,4 @@
|
|||
package com.simibubi.create.foundation.render.gl.shader;
|
||||
package com.simibubi.create.foundation.render.backend.gl.shader;
|
||||
|
||||
/**
|
||||
* A Callback for when a shader is called. Used to define shader uniforms.
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue