mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
Better config/backend to account for multiple engines
- Rename probably too many things - Needs to be tested with Optifine
This commit is contained in:
parent
97490e51ca
commit
748c25b3ec
38 changed files with 47 additions and 53 deletions
|
@ -38,7 +38,7 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
|
||||||
@Override
|
@Override
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
for (RenderType type : RenderType.chunkBufferLayers())
|
for (RenderType type : RenderType.chunkBufferLayers())
|
||||||
if (ItemBlockRenderTypes.canRenderInLayer(te.getBlockState(), type))
|
if (ItemBlockRenderTypes.canRenderInLayer(te.getBlockState(), type))
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class DrillMovementBehaviour extends BlockBreakingMovementBehaviour {
|
||||||
@OnlyIn(value = Dist.CLIENT)
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
||||||
ContraptionMatrices matrices, MultiBufferSource buffer) {
|
ContraptionMatrices matrices, MultiBufferSource buffer) {
|
||||||
if (!Backend.getInstance().canUseInstancing())
|
if (!Backend.isOn())
|
||||||
DrillRenderer.renderInContraption(context, renderWorld, matrices, buffer);
|
DrillRenderer.renderInContraption(context, renderWorld, matrices, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
||||||
@Override
|
@Override
|
||||||
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
||||||
ContraptionMatrices matrices, MultiBufferSource buffers) {
|
ContraptionMatrices matrices, MultiBufferSource buffers) {
|
||||||
if (!Backend.getInstance()
|
if (!Backend.isOn())
|
||||||
.canUseInstancing())
|
|
||||||
HarvesterRenderer.renderInContraption(context, renderWorld, matrices, buffers);
|
HarvesterRenderer.renderInContraption(context, renderWorld, matrices, buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,8 +169,7 @@ public class MechanicalCrafterRenderer extends SafeTileEntityRenderer<Mechanical
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||||
|
|
||||||
if (!Backend.getInstance()
|
if (!Backend.canUseInstancing(te.getLevel())) {
|
||||||
.canUseInstancing(te.getLevel())) {
|
|
||||||
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
|
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
|
||||||
standardKineticRotationTransform(superBuffer, te, light);
|
standardKineticRotationTransform(superBuffer, te, light);
|
||||||
superBuffer.rotateCentered(Direction.UP, (float) (blockState.getValue(HORIZONTAL_FACING)
|
superBuffer.rotateCentered(Direction.UP, (float) (blockState.getValue(HORIZONTAL_FACING)
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class HandCrankRenderer extends KineticTileEntityRenderer {
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState state = te.getBlockState();
|
BlockState state = te.getBlockState();
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
|
|
|
@ -257,7 +257,7 @@ public class DeployerMovementBehaviour extends MovementBehaviour {
|
||||||
@Override
|
@Override
|
||||||
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
||||||
ContraptionMatrices matrices, MultiBufferSource buffers) {
|
ContraptionMatrices matrices, MultiBufferSource buffers) {
|
||||||
if (!Backend.getInstance().canUseInstancing())
|
if (!Backend.isOn())
|
||||||
DeployerRenderer.renderInContraption(context, renderWorld, matrices, buffers);
|
DeployerRenderer.renderInContraption(context, renderWorld, matrices, buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer<DeployerTileEntity>
|
||||||
renderItem(te, partialTicks, ms, buffer, light, overlay);
|
renderItem(te, partialTicks, ms, buffer, light, overlay);
|
||||||
FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay);
|
FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
renderComponents(te, partialTicks, ms, buffer, light, overlay);
|
renderComponents(te, partialTicks, ms, buffer, light, overlay);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer<DeployerTileEntity>
|
||||||
protected void renderComponents(DeployerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderComponents(DeployerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
if (!Backend.canUseInstancing(te.getLevel())) {
|
||||||
KineticTileEntityRenderer.renderRotatingKineticBlock(te, getRenderedBlockState(te), ms, vb, light);
|
KineticTileEntityRenderer.renderRotatingKineticBlock(te, getRenderedBlockState(te), ms, vb, light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class EncasedFanRenderer extends KineticTileEntityRenderer {
|
||||||
@Override
|
@Override
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
Direction direction = te.getBlockState()
|
Direction direction = te.getBlockState()
|
||||||
.getValue(FACING);
|
.getValue(FACING);
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class FlywheelRenderer extends KineticTileEntityRenderer {
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
FlywheelTileEntity wte = (FlywheelTileEntity) te;
|
FlywheelTileEntity wte = (FlywheelTileEntity) te;
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class EngineRenderer<T extends EngineTileEntity> extends SafeTileEntityRe
|
||||||
protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light,
|
protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light,
|
||||||
int overlay) {
|
int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
Block block = te.getBlockState()
|
Block block = te.getBlockState()
|
||||||
.getBlock();
|
.getBlock();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class MechanicalMixerRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
MechanicalMixerTileEntity mixer = (MechanicalMixerTileEntity) te;
|
MechanicalMixerTileEntity mixer = (MechanicalMixerTileEntity) te;
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class MechanicalPressRenderer extends KineticTileEntityRenderer {
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
float renderedHeadOffset = ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks);
|
float renderedHeadOffset = ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks);
|
||||||
|
|
|
@ -46,8 +46,7 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
|
||||||
renderItems(te, partialTicks, ms, buffer, light, overlay);
|
renderItems(te, partialTicks, ms, buffer, light, overlay);
|
||||||
FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay);
|
FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance()
|
if (Backend.canUseInstancing(te.getLevel()))
|
||||||
.canUseInstancing(te.getLevel()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
renderShaft(te, ms, buffer, light, overlay);
|
renderShaft(te, ms, buffer, light, overlay);
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class BearingRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour {
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld,
|
||||||
ContraptionMatrices matrices, MultiBufferSource buffer) {
|
ContraptionMatrices matrices, MultiBufferSource buffer) {
|
||||||
if (Backend.getInstance().canUseInstancing()) return;
|
if (Backend.isOn()) return;
|
||||||
|
|
||||||
Direction facing = context.state.getValue(BlockStateProperties.FACING);
|
Direction facing = context.state.getValue(BlockStateProperties.FACING);
|
||||||
PartialModel top = AllBlockPartials.BEARING_TOP;
|
PartialModel top = AllBlockPartials.BEARING_TOP;
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class StickerRenderer extends SafeTileEntityRenderer<StickerTileEntity> {
|
||||||
protected void renderSafe(StickerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(StickerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState state = te.getBlockState();
|
BlockState state = te.getBlockState();
|
||||||
SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.STICKER_HEAD, state);
|
SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.STICKER_HEAD, state);
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class GantryCarriageRenderer extends KineticTileEntityRenderer {
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState state = te.getBlockState();
|
BlockState state = te.getBlockState();
|
||||||
Direction facing = state.getValue(GantryCarriageBlock.FACING);
|
Direction facing = state.getValue(GantryCarriageBlock.FACING);
|
||||||
|
|
|
@ -44,8 +44,7 @@ public abstract class AbstractPulleyRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance()
|
if (Backend.canUseInstancing(te.getLevel()))
|
||||||
.canUseInstancing(te.getLevel()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class ContraptionRenderDispatcher {
|
||||||
public static void reset() {
|
public static void reset() {
|
||||||
WORLDS.empty(ContraptionRenderManager::delete);
|
WORLDS.empty(ContraptionRenderManager::delete);
|
||||||
|
|
||||||
if (Backend.getInstance().available()) {
|
if (Backend.isOn()) {
|
||||||
WORLDS = new WorldAttached<>(FlwContraptionManager::new);
|
WORLDS = new WorldAttached<>(FlwContraptionManager::new);
|
||||||
} else {
|
} else {
|
||||||
WORLDS = new WorldAttached<>(SBBContraptionManager::new);
|
WORLDS = new WorldAttached<>(SBBContraptionManager::new);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class FlwContraptionManager extends ContraptionRenderManager<RenderedCont
|
||||||
|
|
||||||
GlVertexArray.unbind();
|
GlVertexArray.unbind();
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing()) {
|
if (Backend.isOn()) {
|
||||||
RenderLayer renderLayer = event.getLayer();
|
RenderLayer renderLayer = event.getLayer();
|
||||||
if (renderLayer != null) {
|
if (renderLayer != null) {
|
||||||
for (RenderedContraption renderer : visible) {
|
for (RenderedContraption renderer : visible) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class RenderedContraption extends ContraptionRenderInfo {
|
||||||
this.engine.addListener(this.kinetics);
|
this.engine.addListener(this.kinetics);
|
||||||
|
|
||||||
buildLayers();
|
buildLayers();
|
||||||
if (Backend.getInstance().canUseInstancing()) {
|
if (Backend.isOn()) {
|
||||||
buildInstancedTiles();
|
buildInstancedTiles();
|
||||||
buildActors();
|
buildActors();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class FluidValveRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
|
||||||
super.renderSafe(tileEntityIn, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(tileEntityIn, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
VertexConsumer builder = buffer.getBuffer(RenderType.solid());
|
VertexConsumer builder = buffer.getBuffer(RenderType.solid());
|
||||||
if (!Backend.getInstance().canUseInstancing(tileEntityIn.getLevel())) {
|
if (!Backend.canUseInstancing(tileEntityIn.getLevel())) {
|
||||||
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getRotatedModel(tileEntityIn), ms, builder, light);
|
KineticTileEntityRenderer.renderRotatingBuffer(tileEntityIn, getRotatedModel(tileEntityIn), ms, builder, light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
||||||
protected void renderSafe(BeltTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(BeltTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
if (!Backend.canUseInstancing(te.getLevel())) {
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
if (!AllBlocks.BELT.has(blockState)) return;
|
if (!AllBlocks.BELT.has(blockState)) return;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.relays.elementary;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.Instancer;
|
import com.jozufozu.flywheel.api.Instancer;
|
||||||
import com.jozufozu.flywheel.api.MaterialManager;
|
import com.jozufozu.flywheel.api.MaterialManager;
|
||||||
import com.jozufozu.flywheel.util.transform.MatrixTransformStack;
|
import com.jozufozu.flywheel.util.transform.TransformStack;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
|
@ -59,7 +59,8 @@ public class BracketedKineticTileInstance extends SingleRotatingInstance {
|
||||||
private PoseStack rotateToAxis(Axis axis) {
|
private PoseStack rotateToAxis(Axis axis) {
|
||||||
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
|
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
|
||||||
PoseStack poseStack = new PoseStack();
|
PoseStack poseStack = new PoseStack();
|
||||||
new MatrixTransformStack(poseStack).centre()
|
TransformStack.cast(poseStack)
|
||||||
|
.centre()
|
||||||
.rotateToFace(facing)
|
.rotateToFace(facing)
|
||||||
.multiply(Vector3f.XN.rotationDegrees(-90))
|
.multiply(Vector3f.XN.rotationDegrees(-90))
|
||||||
.unCentre();
|
.unCentre();
|
||||||
|
|
|
@ -28,8 +28,7 @@ public class BracketedKineticTileRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance()
|
if (Backend.canUseInstancing(te.getLevel()))
|
||||||
.canUseInstancing(te.getLevel()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AllBlocks.LARGE_COGWHEEL.has(te.getBlockState())) {
|
if (!AllBlocks.LARGE_COGWHEEL.has(te.getBlockState())) {
|
||||||
|
|
|
@ -39,8 +39,7 @@ public class EncasedCogRenderer extends KineticTileEntityRenderer {
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
if (Backend.getInstance()
|
if (Backend.canUseInstancing(te.getLevel()))
|
||||||
.canUseInstancing(te.getLevel()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SplitShaftRenderer extends KineticTileEntityRenderer {
|
||||||
@Override
|
@Override
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
Block block = te.getBlockState().getBlock();
|
Block block = te.getBlockState().getBlock();
|
||||||
final Axis boxAxis = ((IRotate) block).getRotationAxis(te.getBlockState());
|
final Axis boxAxis = ((IRotate) block).getRotationAxis(te.getBlockState());
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class GaugeRenderer extends KineticTileEntityRenderer {
|
||||||
@Override
|
@Override
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class GearboxRenderer extends KineticTileEntityRenderer {
|
||||||
@Override
|
@Override
|
||||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
final Axis boxAxis = te.getBlockState().getValue(BlockStateProperties.AXIS);
|
final Axis boxAxis = te.getBlockState().getValue(BlockStateProperties.AXIS);
|
||||||
final BlockPos pos = te.getBlockPos();
|
final BlockPos pos = te.getBlockPos();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer<BeltTunnelTileEn
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
SuperByteBuffer flapBuffer = CachedBufferer.partial(AllBlockPartials.BELT_TUNNEL_FLAP, te.getBlockState());
|
SuperByteBuffer flapBuffer = CachedBufferer.partial(AllBlockPartials.BELT_TUNNEL_FLAP, te.getBlockState());
|
||||||
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class EjectorRenderer extends KineticTileEntityRenderer {
|
||||||
float lidProgress = ((EjectorTileEntity) te).getLidProgress(partialTicks);
|
float lidProgress = ((EjectorTileEntity) te).getLidProgress(partialTicks);
|
||||||
float angle = lidProgress * 70;
|
float angle = lidProgress * 70;
|
||||||
|
|
||||||
if (!Backend.getInstance().canUseInstancing(te.getLevel())) {
|
if (!Backend.canUseInstancing(te.getLevel())) {
|
||||||
SuperByteBuffer model = CachedBufferer.partial(AllBlockPartials.EJECTOR_TOP, te.getBlockState());
|
SuperByteBuffer model = CachedBufferer.partial(AllBlockPartials.EJECTOR_TOP, te.getBlockState());
|
||||||
applyLidAngle(te, angle, model);
|
applyLidAngle(te, angle, model);
|
||||||
model.light(light)
|
model.light(light)
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class FunnelRenderer extends SmartTileEntityRenderer<FunnelTileEntity> {
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (!te.hasFlap() || Backend.getInstance().canUseInstancing(te.getLevel()))
|
if (!te.hasFlap() || Backend.canUseInstancing(te.getLevel()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ArmRenderer extends KineticTileEntityRenderer {
|
||||||
ArmTileEntity arm = (ArmTileEntity) te;
|
ArmTileEntity arm = (ArmTileEntity) te;
|
||||||
ItemStack item = arm.heldItem;
|
ItemStack item = arm.heldItem;
|
||||||
boolean hasItem = !item.isEmpty();
|
boolean hasItem = !item.isEmpty();
|
||||||
boolean usingFlywheel = Backend.getInstance().canUseInstancing(te.getLevel());
|
boolean usingFlywheel = Backend.canUseInstancing(te.getLevel());
|
||||||
|
|
||||||
if (usingFlywheel && !hasItem) return;
|
if (usingFlywheel && !hasItem) return;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class AnalogLeverRenderer extends SafeTileEntityRenderer<AnalogLeverTileE
|
||||||
protected void renderSafe(AnalogLeverTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(AnalogLeverTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
BlockState leverState = te.getBlockState();
|
BlockState leverState = te.getBlockState();
|
||||||
float state = te.clientState.get(partialTicks);
|
float state = te.clientState.get(partialTicks);
|
||||||
|
|
|
@ -43,8 +43,7 @@ public class SchematicannonRenderer extends SafeTileEntityRenderer<Schematicanno
|
||||||
if (blocksLaunching)
|
if (blocksLaunching)
|
||||||
renderLaunchedBlocks(tileEntity, partialTicks, ms, buffer, light, overlay);
|
renderLaunchedBlocks(tileEntity, partialTicks, ms, buffer, light, overlay);
|
||||||
|
|
||||||
if (Backend.getInstance()
|
if (Backend.canUseInstancing(tileEntity.getLevel()))
|
||||||
.canUseInstancing(tileEntity.getLevel()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BlockPos pos = tileEntity.getBlockPos();
|
BlockPos pos = tileEntity.getBlockPos();
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TileEntityRenderHelper {
|
||||||
Iterator<BlockEntity> iterator = customRenderTEs.iterator();
|
Iterator<BlockEntity> iterator = customRenderTEs.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
BlockEntity tileEntity = iterator.next();
|
BlockEntity tileEntity = iterator.next();
|
||||||
if (Backend.getInstance().canUseInstancing(renderWorld) && InstancedRenderRegistry.getInstance()
|
if (Backend.canUseInstancing(renderWorld) && InstancedRenderRegistry.getInstance()
|
||||||
.shouldSkipRender(tileEntity)) continue;
|
.shouldSkipRender(tileEntity)) continue;
|
||||||
|
|
||||||
BlockEntityRenderer<BlockEntity> renderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(tileEntity);
|
BlockEntityRenderer<BlockEntity> renderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(tileEntity);
|
||||||
|
|
|
@ -18,7 +18,7 @@ public abstract class ColoredOverlayTileEntityRenderer<T extends BlockEntity> ex
|
||||||
protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||||
int light, int overlay) {
|
int light, int overlay) {
|
||||||
|
|
||||||
if (Backend.getInstance().canUseInstancing(te.getLevel())) return;
|
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||||
|
|
||||||
SuperByteBuffer render = render(getOverlayBuffer(te), getColor(te, partialTicks), light);
|
SuperByteBuffer render = render(getOverlayBuffer(te), getColor(te, partialTicks), light);
|
||||||
render.renderInto(ms, buffer.getBuffer(RenderType.solid()));
|
render.renderInto(ms, buffer.getBuffer(RenderType.solid()));
|
||||||
|
|
Loading…
Reference in a new issue