Pondering Alone, Part III

- move SuperByteBuffer and its caching to catnip
- move sprite shifter to catnip
- no longer use StitchedSprites for (ct) sprite shifts
- fix ponder fluid rendering by using SBB for WorldSectionElement again
- allow catnip-forge to load without being present on the server
This commit is contained in:
zelophed 2022-09-19 12:57:31 +02:00
parent 63979193a9
commit b2fe04a3c8
123 changed files with 652 additions and 734 deletions

View file

@ -9,9 +9,9 @@ import com.simibubi.create.foundation.block.connected.AllCTTypes;
import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry;
import com.simibubi.create.foundation.block.connected.CTSpriteShifter;
import com.simibubi.create.foundation.block.connected.CTType;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.block.render.SpriteShifter;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.createmod.catnip.render.SpriteShifter;
import net.createmod.catnip.utility.Couple;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.state.properties.WoodType;

View file

@ -22,12 +22,14 @@ import com.simibubi.create.foundation.ClientResourceReloadListener;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.ponder.CreatePonderPlugin;
import com.simibubi.create.foundation.ponder.CreateSharedPonderText;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.CreateContexts;
import com.simibubi.create.foundation.render.SuperByteBufferCache;
import com.simibubi.create.foundation.render.FlwSuperBufferFactory;
import com.simibubi.create.foundation.utility.ModelSwapper;
import com.simibubi.create.foundation.utility.ShippedResourcePacks;
import net.createmod.catnip.render.SuperBufferFactory;
import net.createmod.catnip.render.SuperByteBufferCache;
import net.createmod.ponder.foundation.PonderIndex;
import net.minecraft.ChatFormatting;
import net.minecraft.client.GraphicsStatus;
@ -45,8 +47,6 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
public class CreateClient {
public static final SuperByteBufferCache BUFFER_CACHE = new SuperByteBufferCache();
//public static final Outliner OUTLINER = new Outliner();
public static final ModelSwapper MODEL_SWAPPER = new ModelSwapper();
public static final CasingConnectivity CASING_CONNECTIVITY = new CasingConnectivity();
@ -77,11 +77,12 @@ public class CreateClient {
}
public static void clientInit(final FMLClientSetupEvent event) {
BUFFER_CACHE.registerCompartment(CachedBufferer.GENERIC_TILE);
BUFFER_CACHE.registerCompartment(CachedBufferer.PARTIAL);
BUFFER_CACHE.registerCompartment(CachedBufferer.DIRECTIONAL_PARTIAL);
BUFFER_CACHE.registerCompartment(KineticTileEntityRenderer.KINETIC_TILE);
BUFFER_CACHE.registerCompartment(SBBContraptionManager.CONTRAPTION, 20);
SuperBufferFactory.setInstance(new FlwSuperBufferFactory());
SuperByteBufferCache.getInstance().registerCompartment(CachedPartialBuffers.PARTIAL);
SuperByteBufferCache.getInstance().registerCompartment(CachedPartialBuffers.DIRECTIONAL_PARTIAL);
SuperByteBufferCache.getInstance().registerCompartment(KineticTileEntityRenderer.KINETIC_TILE);
SuperByteBufferCache.getInstance().registerCompartment(SBBContraptionManager.CONTRAPTION, 20);
ShippedResourcePacks.extractFiles("Copper Legacy Pack");
@ -107,8 +108,6 @@ public class CreateClient {
}
public static void invalidateRenderers() {
BUFFER_CACHE.invalidate();
SCHEMATIC_HANDLER.updateRenderers();
ContraptionRenderDispatcher.reset();
}

View file

@ -8,9 +8,9 @@ import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.Minecraft;
@ -87,7 +87,7 @@ public class AnimatedBlazeBurner extends AnimatedKinetics {
MultiBufferSource.BufferSource buffer = mc.renderBuffers()
.bufferSource();
VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped());
CachedBufferer.partial(AllBlockPartials.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState())
CachedPartialBuffers.partial(AllBlockPartials.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState())
.shiftUVScrolling(spriteShift, (float) uScroll, (float) vScroll)
.light(LightTexture.FULL_BRIGHT)
.renderInto(matrixStack, vb);

View file

@ -1,12 +1,12 @@
package com.simibubi.create.content.contraptions;
import com.simibubi.create.CreateClient;
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.config.AllConfigs;
import net.createmod.catnip.CatnipClient;
import net.createmod.catnip.render.SuperByteBufferCache;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.theme.Color;
import net.minecraft.client.Minecraft;
@ -29,7 +29,7 @@ public class KineticDebugger {
if (!isActive()) {
if (KineticTileEntityRenderer.rainbowMode) {
KineticTileEntityRenderer.rainbowMode = false;
CreateClient.BUFFER_CACHE.invalidate();
SuperByteBufferCache.getInstance().invalidate();
}
return;
}

View file

@ -8,11 +8,11 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.KineticDebugger;
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.SuperByteBufferCache;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.render.SuperByteBufferCache;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
@ -62,12 +62,12 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
}
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.block(KINETIC_TILE, state);
return CachedBlockBuffers.block(KINETIC_TILE, state);
}
public static void renderRotatingKineticBlock(KineticTileEntity te, BlockState renderedState, PoseStack ms,
VertexConsumer buffer, int light) {
SuperByteBuffer superByteBuffer = CachedBufferer.block(KINETIC_TILE, renderedState);
SuperByteBuffer superByteBuffer = CachedBlockBuffers.block(KINETIC_TILE, renderedState);
renderRotatingBuffer(te, superByteBuffer, ms, buffer, light);
}

View file

@ -1,8 +1,8 @@
package com.simibubi.create.content.contraptions.base.flwdata;
import com.mojang.math.Quaternion;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
public class BeltData extends KineticData {

View file

@ -7,9 +7,10 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
@ -27,13 +28,13 @@ public class DrillRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.DRILL_HEAD, state);
return CachedPartialBuffers.partialFacing(AllBlockPartials.DRILL_HEAD, state);
}
public static void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld,
ContraptionMatrices matrices, MultiBufferSource buffer) {
BlockState state = context.state;
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.DRILL_HEAD, state);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(AllBlockPartials.DRILL_HEAD, state);
Direction facing = state.getValue(DrillBlock.FACING);
float speed = (float) (context.contraption.stalled
@ -42,16 +43,19 @@ public class DrillRenderer extends KineticTileEntityRenderer {
float time = AnimationTickHolder.getRenderTime() / 20;
float angle = (float) (((time * speed) % 360));
superBuffer
.transform(matrices.getModel())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing))
.rotateZ(angle)
.unCentre()
.light(matrices.getWorld(),
ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld))
.renderInto(matrices.getViewProjection(), buffer.getBuffer(RenderType.solid()));
FlwSuperByteBuffer.cast(superBuffer).ifPresent(superByteBuffer -> {
superByteBuffer
.transform(matrices.getModel())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing))
.rotateZ(angle)
.unCentre()
.light(matrices.getWorld(),
ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld))
.renderInto(matrices.getViewProjection(), buffer.getBuffer(RenderType.solid()));
});
}
}

View file

@ -8,10 +8,10 @@ import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
@ -33,7 +33,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
protected void renderSafe(HarvesterTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) {
BlockState blockState = te.getBlockState();
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.HARVESTER_BLADE, blockState);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(AllBlockPartials.HARVESTER_BLADE, blockState);
transform(te.getLevel(), blockState.getValue(HarvesterBlock.FACING), superBuffer,
te.getAnimatedSpeed());
superBuffer.light(light)
@ -44,7 +44,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
ContraptionMatrices matrices, MultiBufferSource buffers) {
BlockState blockState = context.state;
Direction facing = blockState.getValue(HORIZONTAL_FACING);
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.HARVESTER_BLADE, blockState);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(AllBlockPartials.HARVESTER_BLADE, blockState);
float speed = (float) (!VecHelper.isVecPointingTowards(context.relativeMotion, facing.getOpposite())
? context.getAnimationSpeed()
: 0);

View file

@ -12,10 +12,10 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.math.AngleHelper;
@ -62,8 +62,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer<Por
private static void render(BlockState blockState, boolean lit, float progress, PoseStack local,
Consumer<SuperByteBuffer> drawCallback) {
SuperByteBuffer middle = CachedBufferer.partial(getMiddleForState(blockState, lit), blockState);
SuperByteBuffer top = CachedBufferer.partial(getTopForState(blockState), blockState);
SuperByteBuffer middle = CachedPartialBuffers.partial(getMiddleForState(blockState, lit), blockState);
SuperByteBuffer top = CachedPartialBuffers.partial(getTopForState(blockState), blockState);
if (local != null) {
middle.transform(local);
@ -80,10 +80,10 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer<Por
}
private static void rotateToFacing(SuperByteBuffer buffer, Direction facing) {
buffer.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)
.unCentre();
buffer.translate(.5f, .5f, .5f)
.rotate(Direction.Axis.Y, AngleHelper.horizontalAngle(facing))
.rotate(Direction.Axis.X, facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)
.translate(-.5f, -.5f, -.5f);
}
static PortableStorageInterfaceTileEntity getTargetPSI(MovementContext context) {

View file

@ -7,9 +7,9 @@ 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.components.clock.CuckooClockTileEntity.Animation;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -38,8 +38,8 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer {
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
// Render Hands
SuperByteBuffer hourHand = CachedBufferer.partial(AllBlockPartials.CUCKOO_HOUR_HAND, blockState);
SuperByteBuffer minuteHand = CachedBufferer.partial(AllBlockPartials.CUCKOO_MINUTE_HAND, blockState);
SuperByteBuffer hourHand = CachedPartialBuffers.partial(AllBlockPartials.CUCKOO_HOUR_HAND, blockState);
SuperByteBuffer minuteHand = CachedPartialBuffers.partial(AllBlockPartials.CUCKOO_MINUTE_HAND, blockState);
float hourAngle = clock.hourHand.getValue(partialTicks);
float minuteAngle = clock.minuteHand.getValue(partialTicks);
rotateHand(hourHand, hourAngle, direction).light(light)
@ -48,8 +48,8 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer {
.renderInto(ms, vb);
// Doors
SuperByteBuffer leftDoor = CachedBufferer.partial(AllBlockPartials.CUCKOO_LEFT_DOOR, blockState);
SuperByteBuffer rightDoor = CachedBufferer.partial(AllBlockPartials.CUCKOO_RIGHT_DOOR, blockState);
SuperByteBuffer leftDoor = CachedPartialBuffers.partial(AllBlockPartials.CUCKOO_LEFT_DOOR, blockState);
SuperByteBuffer rightDoor = CachedPartialBuffers.partial(AllBlockPartials.CUCKOO_RIGHT_DOOR, blockState);
float angle = 0;
float offset = 0;
@ -80,7 +80,7 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer {
offset = -(angle / 135) * 1 / 2f + 10 / 16f;
PartialModel partialModel = (clock.animationType == Animation.PIG ? AllBlockPartials.CUCKOO_PIG : AllBlockPartials.CUCKOO_CREEPER);
SuperByteBuffer figure =
CachedBufferer.partial(partialModel, blockState);
CachedPartialBuffers.partial(partialModel, blockState);
figure.rotateCentered(Direction.UP, AngleHelper.rad(AngleHelper.horizontalAngle(direction.getCounterClockWise())));
figure.translate(offset, 0, 0);
figure.light(light)
@ -91,7 +91,7 @@ public class CuckooClockRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state, state
return CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, state, state
.getValue(CuckooClockBlock.HORIZONTAL_FACING)
.getOpposite());
}

View file

@ -13,10 +13,10 @@ 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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.Pointing;
import net.createmod.catnip.utility.math.AngleHelper;
@ -170,7 +170,7 @@ public class MechanicalCrafterRenderer extends SafeTileEntityRenderer<Mechanical
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
if (!Backend.canUseInstancing(te.getLevel())) {
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
standardKineticRotationTransform(superBuffer, te, light);
superBuffer.rotateCentered(Direction.UP, (float) (blockState.getValue(HORIZONTAL_FACING)
.getAxis() != Direction.Axis.X ? 0 : Math.PI / 2));
@ -211,7 +211,7 @@ public class MechanicalCrafterRenderer extends SafeTileEntityRenderer<Mechanical
}
private SuperByteBuffer renderAndTransform(PartialModel renderBlock, BlockState crafterState) {
SuperByteBuffer buffer = CachedBufferer.partial(renderBlock, crafterState);
SuperByteBuffer buffer = CachedPartialBuffers.partial(renderBlock, crafterState);
float xRot = crafterState.getValue(MechanicalCrafterBlock.POINTING)
.getXRotation();
float yRot = AngleHelper.horizontalAngle(crafterState.getValue(HORIZONTAL_FACING));

View file

@ -7,9 +7,9 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -39,7 +39,7 @@ public class HandCrankRenderer extends KineticTileEntityRenderer {
return;
Direction facing = state.getValue(FACING);
SuperByteBuffer handle = CachedBufferer.partialFacing(renderedHandle, state, facing.getOpposite());
SuperByteBuffer handle = CachedPartialBuffers.partialFacing(renderedHandle, state, facing.getOpposite());
HandCrankTileEntity crank = (HandCrankTileEntity) te;
kineticRotationTransform(handle, te, facing.getAxis(),
(crank.independentAngle + partialTicks * crank.chasingVelocity) / 360, light);

View file

@ -19,11 +19,12 @@ import com.simibubi.create.content.contraptions.components.deployer.DeployerTile
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.VecHelper;
@ -121,8 +122,8 @@ public class DeployerRenderer extends SafeTileEntityRenderer<DeployerTileEntity>
BlockState blockState = te.getBlockState();
Vec3 offset = getHandOffset(te, partialTicks, blockState);
SuperByteBuffer pole = CachedBufferer.partial(AllBlockPartials.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedBufferer.partial(te.getHandPose(), blockState);
SuperByteBuffer pole = CachedPartialBuffers.partial(AllBlockPartials.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedPartialBuffers.partial(te.getHandPose(), blockState);
transform(pole.translate(offset.x, offset.y, offset.z), blockState, true)
.light(light)
@ -167,9 +168,9 @@ public class DeployerRenderer extends SafeTileEntityRenderer<DeployerTileEntity>
if (context.contraption.stalled)
speed = 0;
SuperByteBuffer shaft = CachedBufferer.block(AllBlocks.SHAFT.getDefaultState());
SuperByteBuffer pole = CachedBufferer.partial(AllBlockPartials.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedBufferer.partial(handPose, blockState);
SuperByteBuffer shaft = CachedBlockBuffers.block(AllBlocks.SHAFT.getDefaultState());
SuperByteBuffer pole = CachedPartialBuffers.partial(AllBlockPartials.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedPartialBuffers.partial(handPose, blockState);
double factor;
if (context.contraption.stalled || context.position == null || context.data.contains("StationaryTimer")) {

View file

@ -8,9 +8,9 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
@ -38,9 +38,9 @@ public class EncasedFanRenderer extends KineticTileEntityRenderer {
int lightInFront = LevelRenderer.getLightColor(te.getLevel(), te.getBlockPos().relative(direction));
SuperByteBuffer shaftHalf =
CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction.getOpposite());
CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction.getOpposite());
SuperByteBuffer fanInner =
CachedBufferer.partialFacing(AllBlockPartials.ENCASED_FAN_INNER, te.getBlockState(), direction.getOpposite());
CachedPartialBuffers.partialFacing(AllBlockPartials.ENCASED_FAN_INNER, te.getBlockState(), direction.getOpposite());
float time = WorldTickHolder.getRenderTime(te.getLevel());
float speed = te.getSpeed() * 5;

View file

@ -7,8 +7,8 @@ import java.util.List;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;

View file

@ -5,9 +5,9 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -40,7 +40,7 @@ public class FlywheelRenderer extends KineticTileEntityRenderer {
private void renderFlywheel(KineticTileEntity te, PoseStack ms, int light, BlockState blockState, float angle,
VertexConsumer vb) {
SuperByteBuffer wheel = CachedBufferer.block(blockState);
SuperByteBuffer wheel = CachedBlockBuffers.block(blockState);
kineticRotationTransform(wheel, te, getRotationAxisOf(te), AngleHelper.rad(angle), light);
wheel.renderInto(ms, vb);
}

View file

@ -3,9 +3,9 @@ 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.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.world.level.block.state.BlockState;
@ -17,7 +17,7 @@ public class MillstoneRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partial(AllBlockPartials.MILLSTONE_COG, state);
return CachedPartialBuffers.partial(AllBlockPartials.MILLSTONE_COG, state);
}
}

View file

@ -6,9 +6,9 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -38,7 +38,7 @@ public class MechanicalMixerRenderer extends KineticTileEntityRenderer {
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState);
standardKineticRotationTransform(superBuffer, te, light).renderInto(ms, vb);
float renderedHeadOffset = mixer.getRenderedHeadOffset(partialTicks);
@ -46,12 +46,12 @@ public class MechanicalMixerRenderer extends KineticTileEntityRenderer {
float time = WorldTickHolder.getRenderTime(te.getLevel());
float angle = ((time * speed * 6 / 10f) % 360) / 180 * (float) Math.PI;
SuperByteBuffer poleRender = CachedBufferer.partial(AllBlockPartials.MECHANICAL_MIXER_POLE, blockState);
SuperByteBuffer poleRender = CachedPartialBuffers.partial(AllBlockPartials.MECHANICAL_MIXER_POLE, blockState);
poleRender.translate(0, -renderedHeadOffset, 0)
.light(light)
.renderInto(ms, vb);
SuperByteBuffer headRender = CachedBufferer.partial(AllBlockPartials.MECHANICAL_MIXER_HEAD, blockState);
SuperByteBuffer headRender = CachedPartialBuffers.partial(AllBlockPartials.MECHANICAL_MIXER_HEAD, blockState);
headRender.rotateCentered(Direction.UP, angle)
.translate(0, -renderedHeadOffset, 0)
.light(light)

View file

@ -3,9 +3,9 @@ package com.simibubi.create.content.contraptions.components.motor;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.world.level.block.state.BlockState;
@ -17,7 +17,7 @@ public class CreativeMotorRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state);
return CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, state);
}
}

View file

@ -7,9 +7,9 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -39,7 +39,7 @@ public class MechanicalPressRenderer extends KineticTileEntityRenderer {
float renderedHeadOffset =
pressingBehaviour.getRenderedHeadOffset(partialTicks) * pressingBehaviour.mode.headOffset;
SuperByteBuffer headRender = CachedBufferer.partialFacing(AllBlockPartials.MECHANICAL_PRESS_HEAD, blockState,
SuperByteBuffer headRender = CachedPartialBuffers.partialFacing(AllBlockPartials.MECHANICAL_PRESS_HEAD, blockState,
blockState.getValue(HORIZONTAL_FACING));
headRender.translate(0, -renderedHeadOffset, 0)
.light(light)

View file

@ -2,6 +2,8 @@ package com.simibubi.create.content.contraptions.components.saw;
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.FACING;
import java.util.Optional;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
@ -13,11 +15,13 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.Minecraft;
@ -79,7 +83,7 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
rotate = true;
}
SuperByteBuffer superBuffer = CachedBufferer.partialFacing(partial, blockState);
SuperByteBuffer superBuffer = CachedPartialBuffers.partialFacing(partial, blockState);
if (rotate) {
superBuffer.rotateCentered(Direction.UP, AngleHelper.rad(90));
}
@ -147,9 +151,9 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
if (state.getValue(FACING)
.getAxis()
.isHorizontal())
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF,
return CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF,
state.rotate(te.getLevel(), te.getBlockPos(), Rotation.CLOCKWISE_180));
return CachedBufferer.block(KineticTileEntityRenderer.KINETIC_TILE,
return CachedBlockBuffers.block(KineticTileEntityRenderer.KINETIC_TILE,
getRenderedBlockState(te));
}
@ -175,19 +179,25 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
boolean shouldAnimate =
(context.contraption.stalled && horizontal) || (!context.contraption.stalled && !backwards && moving);
SuperByteBuffer superBuffer;
SuperByteBuffer sBuffer;
if (SawBlock.isHorizontal(state)) {
if (shouldAnimate)
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_ACTIVE, state);
sBuffer = CachedPartialBuffers.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_ACTIVE, state);
else
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_INACTIVE, state);
sBuffer = CachedPartialBuffers.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_INACTIVE, state);
} else {
if (shouldAnimate)
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE, state);
sBuffer = CachedPartialBuffers.partial(AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE, state);
else
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_VERTICAL_INACTIVE, state);
sBuffer = CachedPartialBuffers.partial(AllBlockPartials.SAW_BLADE_VERTICAL_INACTIVE, state);
}
Optional<FlwSuperByteBuffer> optional = FlwSuperByteBuffer.cast(sBuffer);
if (optional.isEmpty())
return;
FlwSuperByteBuffer superBuffer = optional.get();
superBuffer.transform(matrices.getModel())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))

View file

@ -5,8 +5,8 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.utility.math.AngleHelper;
@ -71,11 +71,12 @@ public class SteamEngineRenderer extends SafeTileEntityRenderer<SteamEngineTileE
.renderInto(ms, vb);
}
private SuperByteBuffer transformed(PartialModel model, BlockState blockState, Direction facing) {
return CachedBufferer.partial(model, blockState)
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing) + 90);
private FlwSuperByteBuffer transformed(PartialModel model, BlockState blockState, Direction facing) {
return FlwSuperByteBuffer.cast(CachedPartialBuffers.partial(model, blockState))
.orElseThrow()
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing) + 90);
}
@Override

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.utility.math.AngleHelper;
@ -39,10 +39,8 @@ public class WhistleRenderer extends SafeTileEntityRenderer<WhistleTileEntity> {
offset -= Math.sin(wiggleProgress * (2 * Mth.PI) * (4 - size.ordinal())) / 16f;
}
CachedBufferer.partial(mouth, blockState)
.centre()
.rotateY(AngleHelper.horizontalAngle(direction))
.unCentre()
CachedPartialBuffers.partial(mouth, blockState)
.rotateCentered(Direction.Axis.Y, Mth.DEG_TO_RAD * AngleHelper.horizontalAngle(direction))
.translate(0, offset * 4 / 16f, 0)
.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));

View file

@ -9,9 +9,9 @@ import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.BackHalfShaftInstance;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;

View file

@ -6,10 +6,10 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -36,7 +36,7 @@ public class BearingRenderer extends KineticTileEntityRenderer {
.getValue(BlockStateProperties.FACING);
PartialModel top =
bearingTe.isWoodenTop() ? AllBlockPartials.BEARING_TOP_WOODEN : AllBlockPartials.BEARING_TOP;
SuperByteBuffer superBuffer = CachedBufferer.partial(top, te.getBlockState());
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(top, te.getBlockState());
float interpolatedAngle = bearingTe.getInterpolatedAngle(partialTicks - 1);
kineticRotationTransform(superBuffer, te, facing.getAxis(), (float) (interpolatedAngle / 180 * Math.PI), light);
@ -51,7 +51,7 @@ public class BearingRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state, state
return CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, state, state
.getValue(BearingBlock.FACING)
.getOpposite());
}

View file

@ -15,9 +15,10 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Ori
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -38,7 +39,7 @@ public class StabilizedBearingMovementBehaviour implements MovementBehaviour {
Direction facing = context.state.getValue(BlockStateProperties.FACING);
PartialModel top = AllBlockPartials.BEARING_TOP;
SuperByteBuffer superBuffer = CachedBufferer.partial(top, context.state);
SuperByteBuffer superBuffer = CachedPartialBuffers.partial(top, context.state);
float renderPartialTicks = AnimationTickHolder.getPartialTicks();
// rotate to match blockstate
@ -53,10 +54,8 @@ public class StabilizedBearingMovementBehaviour implements MovementBehaviour {
rotation.mul(orientation);
orientation = rotation;
superBuffer.transform(matrices.getModel());
superBuffer.rotateCentered(orientation);
FlwSuperByteBuffer.cast(superBuffer).ifPresent(flwBuffer -> flwBuffer.rotateCentered(rotation));
// render
superBuffer

View file

@ -3,10 +3,11 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ch
import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.Minecraft;
@ -28,19 +29,23 @@ public class StickerRenderer extends SafeTileEntityRenderer<StickerTileEntity> {
if (Backend.canUseInstancing(te.getLevel())) return;
BlockState state = te.getBlockState();
SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.STICKER_HEAD, state);
float offset = te.piston.getValue(WorldTickHolder.getPartialTicks(te.getLevel()));
SuperByteBuffer head = CachedPartialBuffers.partial(AllBlockPartials.STICKER_HEAD, state);
float offset;
if (te.getLevel() != Minecraft.getInstance().level && !te.isVirtual())
offset = state.getValue(StickerBlock.EXTENDED) ? 1 : 0;
else
offset = te.piston.getValue(WorldTickHolder.getPartialTicks(te.getLevel()));
Direction facing = state.getValue(StickerBlock.FACING);
head.nudge(te.hashCode())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing) + 90)
.unCentre()
.translate(0, (offset * offset) * 4 / 16f, 0);
FlwSuperByteBuffer.cast(head).ifPresent(flwBuffer -> flwBuffer
.nudge(te.hashCode())
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(AngleHelper.verticalAngle(facing) + 90)
.unCentre()
.translate(0, (offset * offset) * 4 / 16f, 0));
head.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));

View file

@ -5,9 +5,10 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
@ -54,15 +55,18 @@ public class GantryCarriageRenderer extends KineticTileEntityRenderer {
if (facing == Direction.NORTH || facing == Direction.EAST)
angleForTe *= -1;
SuperByteBuffer cogs = CachedBufferer.partial(AllBlockPartials.GANTRY_COGS, state);
cogs.centre()
SuperByteBuffer cogs = CachedPartialBuffers.partial(AllBlockPartials.GANTRY_COGS, state);
float finalAngleForTe = angleForTe;
FlwSuperByteBuffer.cast(cogs).ifPresent(flwBuffer -> flwBuffer
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)
.rotateY(alongFirst ^ facing.getAxis() == Axis.X ? 0 : 90)
.translate(0, -9 / 16f, 0)
.rotateX(-angleForTe)
.rotateX(-finalAngleForTe)
.translate(0, 9 / 16f, 0)
.unCentre();
.unCentre()
);
cogs.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));

View file

@ -7,9 +7,9 @@ import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
@ -25,13 +25,11 @@ public class ControlsRenderer {
BlockState state = context.state;
Direction facing = state.getValue(ControlsBlock.FACING);
SuperByteBuffer cover = CachedBufferer.partial(AllBlockPartials.TRAIN_CONTROLS_COVER, state);
SuperByteBuffer cover = CachedPartialBuffers.partial(AllBlockPartials.TRAIN_CONTROLS_COVER, state);
float hAngle = 180 + AngleHelper.horizontalAngle(facing);
PoseStack ms = matrices.getModel();
cover.transform(ms)
.centre()
.rotateY(hAngle)
.unCentre()
.rotateCentered(Direction.Axis.Y, Mth.DEG_TO_RAD * hAngle)
.light(matrices.getWorld(), ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld))
.renderInto(matrices.getViewProjection(), buffer.getBuffer(RenderType.cutoutMipped()));
@ -39,7 +37,7 @@ public class ControlsRenderer {
for (boolean first : Iterate.trueAndFalse) {
float vAngle = (float) Mth.clamp(first ? firstLever * 70 - 25 : secondLever * 15, -45, 45);
SuperByteBuffer lever = CachedBufferer.partial(AllBlockPartials.TRAIN_CONTROLS_LEVER, state);
SuperByteBuffer lever = CachedPartialBuffers.partial(AllBlockPartials.TRAIN_CONTROLS_LEVER, state);
ms.pushPose();
TransformStack.cast(ms)
.centre()

View file

@ -7,9 +7,9 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
@ -60,8 +60,8 @@ public abstract class AbstractPulleyRenderer extends KineticTileEntityRenderer {
BlockState blockState = te.getBlockState();
BlockPos pos = te.getBlockPos();
SuperByteBuffer halfMagnet = CachedBufferer.partial(this.halfMagnet, blockState);
SuperByteBuffer halfRope = CachedBufferer.partial(this.halfRope, blockState);
SuperByteBuffer halfMagnet = CachedPartialBuffers.partial(this.halfMagnet, blockState);
SuperByteBuffer halfRope = CachedPartialBuffers.partial(this.halfRope, blockState);
SuperByteBuffer magnet = renderMagnet(te);
SuperByteBuffer rope = renderRope(te);
@ -108,7 +108,7 @@ public abstract class AbstractPulleyRenderer extends KineticTileEntityRenderer {
protected SuperByteBuffer getRotatedCoil(KineticTileEntity te) {
BlockState blockState = te.getBlockState();
return CachedBufferer.partialFacing(getCoil(), blockState,
return CachedPartialBuffers.partialFacing(getCoil(), blockState,
Direction.get(AxisDirection.POSITIVE, getShaftAxis(te)));
}

View file

@ -5,9 +5,9 @@ import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction.Axis;
import net.minecraft.util.Mth;
@ -31,12 +31,12 @@ public class PulleyRenderer extends AbstractPulleyRenderer {
@Override
protected SuperByteBuffer renderRope(KineticTileEntity te) {
return CachedBufferer.block(AllBlocks.ROPE.getDefaultState());
return CachedBlockBuffers.block(AllBlocks.ROPE.getDefaultState());
}
@Override
protected SuperByteBuffer renderMagnet(KineticTileEntity te) {
return CachedBufferer.block(AllBlocks.PULLEY_MAGNET.getDefaultState());
return CachedBlockBuffers.block(AllBlocks.PULLEY_MAGNET.getDefaultState());
}
@Override
@ -63,10 +63,10 @@ public class PulleyRenderer extends AbstractPulleyRenderer {
return offset;
}
@Override
public int getViewDistance() {
return 128;
}
}

View file

@ -8,8 +8,6 @@ import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.api.instance.TickableInstance;
import com.jozufozu.flywheel.backend.instancing.AbstractInstance;
import com.jozufozu.flywheel.backend.instancing.TaskEngine;
import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstanceManager;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;

View file

@ -23,9 +23,10 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Con
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionWorld;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.render.TileEntityRenderHelper;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.LightTexture;
@ -175,7 +176,7 @@ public class ContraptionRenderDispatcher {
.withBlocks(values)
.withModelData(c.modelData)
.build();
return new SuperByteBuffer(builder);
return new FlwSuperByteBuffer(builder);
}
public static int getLight(Level world, float lx, float ly, float lz) {

View file

@ -23,8 +23,8 @@ import com.mojang.math.Matrix4f;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
import com.simibubi.create.foundation.render.CreateContexts;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.Mth;
import net.minecraft.world.level.Level;

View file

@ -3,11 +3,10 @@ package com.simibubi.create.content.contraptions.components.structureMovement.re
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.jozufozu.flywheel.event.RenderLayerEvent;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.CreateClient;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.SuperByteBufferCache;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBufferCache;
import net.createmod.catnip.utility.Pair;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.level.LevelAccessor;
@ -33,7 +32,7 @@ public class SBBContraptionManager extends ContraptionRenderingWorld<Contraption
@Override
public boolean invalidate(Contraption contraption) {
for (RenderType chunkBufferLayer : RenderType.chunkBufferLayers()) {
CreateClient.BUFFER_CACHE.invalidate(CONTRAPTION, Pair.of(contraption, chunkBufferLayer));
SuperByteBufferCache.getInstance().invalidate(CONTRAPTION, Pair.of(contraption, chunkBufferLayer));
}
return super.invalidate(contraption);
}
@ -47,16 +46,18 @@ public class SBBContraptionManager extends ContraptionRenderingWorld<Contraption
private void renderContraptionLayerSBB(ContraptionRenderInfo renderInfo, RenderType layer, VertexConsumer consumer) {
if (!renderInfo.isVisible()) return;
SuperByteBuffer contraptionBuffer = CreateClient.BUFFER_CACHE.get(CONTRAPTION, Pair.of(renderInfo.contraption, layer), () -> ContraptionRenderDispatcher.buildStructureBuffer(renderInfo.renderWorld, renderInfo.contraption, layer));
FlwSuperByteBuffer.cast(
SuperByteBufferCache.getInstance().get(CONTRAPTION, Pair.of(renderInfo.contraption, layer), () -> ContraptionRenderDispatcher.buildStructureBuffer(renderInfo.renderWorld, renderInfo.contraption, layer))
).ifPresent(superBuffer -> {
if (superBuffer.isEmpty())
return;
if (!contraptionBuffer.isEmpty()) {
ContraptionMatrices matrices = renderInfo.getMatrices();
contraptionBuffer.transform(matrices.getModel())
superBuffer.transform(matrices.getModel())
.light(matrices.getWorld())
.hybridLight()
.renderInto(matrices.getViewProjection(), consumer);
}
});
}
}

View file

@ -12,10 +12,10 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Abs
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController;
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController;
import com.simibubi.create.foundation.config.AllConfigs;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.Iterate;
import com.simibubi.create.foundation.utility.CreateLang;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;

View file

@ -5,8 +5,8 @@ import java.util.Random;
import com.mojang.math.Vector3f;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.networking.AllPackets;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.LocalPlayer;

View file

@ -1,10 +1,10 @@
package com.simibubi.create.content.contraptions.components.structureMovement.train;
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.Mth;

View file

@ -9,10 +9,10 @@ import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.KineticDebugger;
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.CatnipClient;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.VecHelper;
@ -66,9 +66,9 @@ public class CouplingRenderer {
BlockState renderState = Blocks.AIR.defaultBlockState();
VertexConsumer builder = buffer.getBuffer(RenderType.solid());
SuperByteBuffer attachment = CachedBufferer.partial(AllBlockPartials.COUPLING_ATTACHMENT, renderState);
SuperByteBuffer ring = CachedBufferer.partial(AllBlockPartials.COUPLING_RING, renderState);
SuperByteBuffer connector = CachedBufferer.partial(AllBlockPartials.COUPLING_CONNECTOR, renderState);
SuperByteBuffer attachment = CachedPartialBuffers.partial(AllBlockPartials.COUPLING_ATTACHMENT, renderState);
SuperByteBuffer ring = CachedPartialBuffers.partial(AllBlockPartials.COUPLING_RING, renderState);
SuperByteBuffer connector = CachedPartialBuffers.partial(AllBlockPartials.COUPLING_CONNECTOR, renderState);
Vec3 zero = Vec3.ZERO;
Vec3 firstEndpoint = transforms.getFirst()

View file

@ -14,8 +14,8 @@ import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
import com.simibubi.create.foundation.advancement.AllAdvancements;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.fluid.FluidHelper;
import net.createmod.catnip.utility.BlockFace;
import net.createmod.catnip.utility.BlockFace;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;

View file

@ -5,9 +5,10 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -33,10 +34,11 @@ public class PumpRenderer extends KineticTileEntityRenderer {
Vec3 rotationOffset = new Vec3(.5, 14 / 16f, .5);
BlockState blockState = te.getBlockState();
float angle = Mth.lerp(pump.arrowDirection.getValue(partialTicks), 0, 90) - 90;
SuperByteBuffer arrow = CachedBufferer.partial(AllBlockPartials.MECHANICAL_PUMP_ARROW, blockState);
SuperByteBuffer arrow = CachedPartialBuffers.partial(AllBlockPartials.MECHANICAL_PUMP_ARROW, blockState);
for (float yRot : new float[] { 0, 90 }) {
Direction direction = blockState.getValue(PumpBlock.FACING);
arrow.centre()
FlwSuperByteBuffer.cast(arrow).ifPresent(flwBuffer -> flwBuffer
.centre()
.rotateY(AngleHelper.horizontalAngle(direction) + 180)
.rotateX(-AngleHelper.verticalAngle(direction) - 90)
.unCentre()
@ -44,14 +46,15 @@ public class PumpRenderer extends KineticTileEntityRenderer {
.rotateY(yRot)
.rotateZ(angle)
.translateBack(rotationOffset)
.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));
);
arrow.light(light).renderInto(ms, buffer.getBuffer(RenderType.solid()));
}
}
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.MECHANICAL_PUMP_COG, state);
return CachedPartialBuffers.partialFacing(AllBlockPartials.MECHANICAL_PUMP_COG, state);
}
}

View file

@ -4,9 +4,9 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.pulley.AbstractPulleyRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction.Axis;
@ -31,12 +31,12 @@ public class HosePulleyRenderer extends AbstractPulleyRenderer {
@Override
protected SuperByteBuffer renderRope(KineticTileEntity te) {
return CachedBufferer.partial(AllBlockPartials.HOSE, te.getBlockState());
return CachedPartialBuffers.partial(AllBlockPartials.HOSE, te.getBlockState());
}
@Override
protected SuperByteBuffer renderMagnet(KineticTileEntity te) {
return CachedBufferer.partial(AllBlockPartials.HOSE_MAGNET, te.getBlockState());
return CachedPartialBuffers.partial(AllBlockPartials.HOSE_MAGNET, te.getBlockState());
}
@Override

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
@ -72,7 +72,7 @@ public class SpoutRenderer extends SafeTileEntityRenderer<SpoutTileEntity> {
ms.pushPose();
for (PartialModel bit : BITS) {
CachedBufferer.partial(bit, te.getBlockState())
CachedPartialBuffers.partial(bit, te.getBlockState())
.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));
ms.translate(0, -3 * squeeze / 32f, 0);

View file

@ -4,8 +4,8 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Quaternion;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.processing.BasinTileEntity;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.client.Camera;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;

View file

@ -12,8 +12,8 @@ import com.simibubi.create.content.contraptions.relays.elementary.BracketedTileE
import com.simibubi.create.content.contraptions.wrench.IWrenchableWithBracket;
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;

View file

@ -8,9 +8,9 @@ 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.relays.encased.ShaftInstance;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.core.Direction;
import net.minecraft.util.Mth;

View file

@ -5,10 +5,11 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -31,7 +32,7 @@ public class FluidValveRenderer extends KineticTileEntityRenderer {
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
BlockState blockState = te.getBlockState();
SuperByteBuffer pointer = CachedBufferer.partial(AllBlockPartials.FLUID_VALVE_POINTER, blockState);
SuperByteBuffer pointer = CachedPartialBuffers.partial(AllBlockPartials.FLUID_VALVE_POINTER, blockState);
Direction facing = blockState.getValue(FluidValveBlock.FACING);
if (!(te instanceof FluidValveTileEntity valve))
@ -41,15 +42,21 @@ public class FluidValveRenderer extends KineticTileEntityRenderer {
Axis pipeAxis = FluidValveBlock.getPipeAxis(blockState);
Axis shaftAxis = KineticTileEntityRenderer.getRotationAxisOf(te);
int pointerRotationOffset = 0;
int pointerRotationOffset;
if (pipeAxis.isHorizontal() && shaftAxis == Axis.X || pipeAxis.isVertical())
pointerRotationOffset = 90;
else
pointerRotationOffset = 0;
pointer.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)
.rotateY(pointerRotationOffset + pointerRotation)
.unCentre()
FlwSuperByteBuffer.cast(pointer).ifPresent(flwBuffer -> flwBuffer
.centre()
.rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)
.rotateY(pointerRotationOffset + pointerRotation)
.unCentre()
);
pointer
.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));
}

View file

@ -7,9 +7,9 @@ import com.simibubi.create.content.contraptions.fluids.FluidPropagator;
import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity.StraightPipeFluidTransportBehaviour;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.animation.LerpedFloat.Chaser;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;

View file

@ -8,9 +8,9 @@ import com.simibubi.create.content.contraptions.fluids.FluidPropagator;
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
import com.simibubi.create.foundation.block.ITE;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.VoxelShaper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;

View file

@ -10,9 +10,9 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;

View file

@ -5,7 +5,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.utility.Iterate;
@ -90,18 +90,18 @@ public class FluidTankRenderer extends SafeTileEntityRenderer<FluidTankTileEntit
for (Direction d : Iterate.horizontalDirections) {
ms.pushPose();
CachedBufferer.partial(AllBlockPartials.BOILER_GAUGE, blockState)
.rotateY(d.toYRot())
.unCentre()
CachedPartialBuffers.partial(AllBlockPartials.BOILER_GAUGE, blockState)
.rotate(Direction.Axis.Y, Mth.DEG_TO_RAD * d.toYRot())
.translate(-.5, -.5, -.5)
.translate(te.width / 2f - 6 / 16f, 0, 0)
.light(light)
.renderInto(ms, vb);
CachedBufferer.partial(AllBlockPartials.BOILER_GAUGE_DIAL, blockState)
.rotateY(d.toYRot())
.unCentre()
CachedPartialBuffers.partial(AllBlockPartials.BOILER_GAUGE_DIAL, blockState)
.rotate(Direction.Axis.Y, Mth.DEG_TO_RAD * d.toYRot())
.translate(-.5, -.5, -.5)
.translate(te.width / 2f - 6 / 16f, 0, 0)
.translate(0, dialPivot, dialPivot)
.rotateX(-90 * progress)
.rotate(Direction.Axis.X, Mth.DEG_TO_RAD * -90 * progress)
.translate(0, -dialPivot, -dialPivot)
.light(light)
.renderInto(ms, vb);

View file

@ -16,9 +16,9 @@ import com.simibubi.create.foundation.item.SmartInventory;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import net.createmod.catnip.utility.Iterate;
import com.simibubi.create.foundation.utility.recipe.IRecipeTypeInfo;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.Recipe;

View file

@ -8,13 +8,11 @@ import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.createmod.catnip.utility.IntAttached;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms.TransformType;

View file

@ -28,6 +28,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBe
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment;
import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.IntAttached;
@ -36,7 +37,6 @@ import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.animation.LerpedFloat.Chaser;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;

View file

@ -11,11 +11,11 @@ import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
@ -102,7 +102,7 @@ public class BlazeBurnerRenderer extends SafeTileEntityRenderer<BlazeBurnerTileE
uScroll = uScroll - Math.floor(uScroll);
uScroll = uScroll * spriteWidth / 2;
draw(CachedBufferer.partial(AllBlockPartials.BLAZE_BURNER_FLAME, blockState)
draw(CachedPartialBuffers.partial(AllBlockPartials.BLAZE_BURNER_FLAME, blockState)
.shiftUVScrolling(spriteShift, (float) uScroll, (float) vScroll), horizontalAngle, modelTransform, ms,
cutout);
}
@ -116,24 +116,24 @@ public class BlazeBurnerRenderer extends SafeTileEntityRenderer<BlazeBurnerTileE
float headY = offset - (animation * .75f);
draw(CachedBufferer.partial(blazeModel, blockState)
draw(CachedPartialBuffers.partial(blazeModel, blockState)
.translate(0, headY, 0), horizontalAngle, modelTransform, ms, solid);
if (drawGoggles)
draw(CachedBufferer.partial(blazeModel == AllBlockPartials.BLAZE_INERT
draw(CachedPartialBuffers.partial(blazeModel == AllBlockPartials.BLAZE_INERT
? AllBlockPartials.BLAZE_GOGGLES_SMALL : AllBlockPartials.BLAZE_GOGGLES, blockState)
.translate(0, headY + 8 / 16f, 0), horizontalAngle, modelTransform, ms, solid);
if (drawHat) {
SuperByteBuffer partial = CachedBufferer.partial(AllBlockPartials.TRAIN_HAT, blockState)
SuperByteBuffer partial = CachedPartialBuffers.partial(AllBlockPartials.TRAIN_HAT, blockState)
.translate(0, headY, 0);
if (blazeModel == AllBlockPartials.BLAZE_INERT) {
partial.translateY(0.5f)
.centre()
partial.translate(0, 0.5f, 0)
.translate(.5, .5, .5)
.scale(0.75f)
.unCentre();
.translate(-.5, -.5, -.5);
} else {
partial.translateY(0.75f);
partial.translate(0, 0.75f, 0);
}
if (modelTransform != null)
partial.transform(modelTransform);
@ -149,9 +149,9 @@ public class BlazeBurnerRenderer extends SafeTileEntityRenderer<BlazeBurnerTileE
: AllBlockPartials.BLAZE_BURNER_RODS;
PartialModel rods2 = heatLevel == HeatLevel.SEETHING ? AllBlockPartials.BLAZE_BURNER_SUPER_RODS_2
: AllBlockPartials.BLAZE_BURNER_RODS_2;
draw(CachedBufferer.partial(rods, blockState)
draw(CachedPartialBuffers.partial(rods, blockState)
.translate(0, offset1 + animation + .125f, 0), 0, modelTransform, ms, solid);
draw(CachedBufferer.partial(rods2, blockState)
draw(CachedPartialBuffers.partial(rods2, blockState)
.translate(0, offset2 + animation - 3 / 16f, 0), 0, modelTransform, ms, solid);
}

View file

@ -5,10 +5,11 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -43,7 +44,7 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
BlockState blockState = tileEntityIn.getBlockState();
boolean alongX = blockState.getValue(SpeedControllerBlock.HORIZONTAL_AXIS) == Axis.X;
SuperByteBuffer bracket = CachedBufferer.partial(AllBlockPartials.SPEED_CONTROLLER_BRACKET, blockState);
SuperByteBuffer bracket = CachedPartialBuffers.partial(AllBlockPartials.SPEED_CONTROLLER_BRACKET, blockState);
bracket.translate(0, 1, 0);
bracket.rotateCentered(Direction.UP,
(float) (alongX ? Math.PI : Math.PI / 2));
@ -52,7 +53,7 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer<SpeedContro
}
private SuperByteBuffer getRotatedModel(SpeedControllerTileEntity te) {
return CachedBufferer.block(KineticTileEntityRenderer.KINETIC_TILE,
return CachedBlockBuffers.block(KineticTileEntityRenderer.KINETIC_TILE,
KineticTileEntityRenderer.shaft(KineticTileEntityRenderer.getRotationAxisOf(te)));
}

View file

@ -26,8 +26,8 @@ import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.block.render.DestroyProgressRenderingHandler;
import com.simibubi.create.foundation.block.render.ReducedDestroyEffects;
import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.core.BlockPos;

View file

@ -15,9 +15,9 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.KineticTileInstance;
import com.simibubi.create.content.contraptions.base.flwdata.BeltData;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.render.AllMaterialSpecs;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.core.Direction;
import net.minecraft.world.item.DyeColor;

View file

@ -9,8 +9,8 @@ import java.util.Random;
import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity.CasingType;
import com.simibubi.create.foundation.block.render.QuadHelper;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.BakedModel;

View file

@ -14,12 +14,12 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSpriteShifts;
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.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.ShadowRenderHelper;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SpriteShiftEntry;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.worldWrappers.WrappedWorld;
@ -95,7 +95,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
PartialModel beltPartial = getBeltPartial(diagonal, start, end, bottom);
SuperByteBuffer beltBuffer = CachedBufferer.partial(beltPartial, blockState)
SuperByteBuffer beltBuffer = CachedPartialBuffers.partial(beltPartial, blockState)
.light(light);
SpriteShiftEntry spriteShift = getSpriteShiftEntry(color, diagonal, bottom);
@ -140,7 +140,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
return stack;
};
SuperByteBuffer superBuffer = CachedBufferer.partialDirectional(AllBlockPartials.BELT_PULLEY, blockState, dir, matrixStackSupplier);
SuperByteBuffer superBuffer = CachedPartialBuffers.partialDirectional(AllBlockPartials.BELT_PULLEY, blockState, dir, matrixStackSupplier);
KineticTileEntityRenderer.standardKineticRotationTransform(superBuffer, te, light).renderInto(ms, vb);
}
}

View file

@ -15,8 +15,8 @@ import com.simibubi.create.content.contraptions.relays.elementary.AbstractSimple
import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock;
import com.simibubi.create.foundation.advancement.AllAdvancements;
import com.simibubi.create.foundation.config.AllConfigs;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;

View file

@ -7,6 +7,7 @@ import java.util.Random;
import com.jozufozu.flywheel.core.virtual.VirtualEmptyModelData;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.ForgeCatnipClient;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.resources.model.BakedModel;
@ -15,7 +16,6 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.BakedModelWrapper;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
import net.minecraftforge.client.model.data.ModelProperty;
@ -30,7 +30,7 @@ public class BracketedKineticBlockModel extends BakedModelWrapper<BakedModel> {
@Override
public IModelData getModelData(BlockAndTintGetter world, BlockPos pos, BlockState state, IModelData tileData) {
if (VirtualEmptyModelData.is(tileData) || tileData.equals(EmptyModelData.INSTANCE))
if (VirtualEmptyModelData.is(tileData))
return tileData;
BracketedModelData data = new BracketedModelData();
@ -44,7 +44,7 @@ public class BracketedKineticBlockModel extends BakedModelWrapper<BakedModel> {
@Override
public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand, IModelData data) {
if (VirtualEmptyModelData.is(data) || data.equals(EmptyModelData.INSTANCE)) {
if (VirtualEmptyModelData.is(data) || data.equals(ForgeCatnipClient.NoModelData)) {
return super.getQuads(state, side, rand, data);
}

View file

@ -6,9 +6,9 @@ import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -44,7 +44,7 @@ public class BracketedKineticTileRenderer extends KineticTileEntityRenderer {
Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE);
renderRotatingBuffer(te,
CachedBufferer.partialFacingVertical(AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL, te.getBlockState(), facing),
CachedPartialBuffers.partialFacingVertical(AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL, te.getBlockState(), facing),
ms, buffer.getBuffer(RenderType.solid()), light);
float offset = getShaftAngleOffset(axis, pos);
@ -52,7 +52,7 @@ public class BracketedKineticTileRenderer extends KineticTileEntityRenderer {
float angle = ((time * te.getSpeed() * 3f / 10 + offset) % 360) / 180 * (float) Math.PI;
SuperByteBuffer shaft =
CachedBufferer.partialFacingVertical(AllBlockPartials.COGWHEEL_SHAFT, te.getBlockState(), facing);
CachedPartialBuffers.partialFacingVertical(AllBlockPartials.COGWHEEL_SHAFT, te.getBlockState(), facing);
kineticRotationTransform(shaft, te, axis, angle, light);
shaft.renderInto(ms, buffer.getBuffer(RenderType.solid()));

View file

@ -6,9 +6,9 @@ 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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -51,14 +51,14 @@ public class EncasedCogRenderer extends KineticTileEntityRenderer {
for (Direction d : Iterate.directionsInAxis(getRotationAxisOf(te))) {
if (!def.hasShaftTowards(te.getLevel(), te.getBlockPos(), blockState, d))
continue;
renderRotatingBuffer(te, CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), d),
renderRotatingBuffer(te, CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), d),
ms, buffer.getBuffer(RenderType.solid()), light);
}
}
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacingVertical(
return CachedPartialBuffers.partialFacingVertical(
large ? AllBlockPartials.SHAFTLESS_LARGE_COGWHEEL : AllBlockPartials.SHAFTLESS_COGWHEEL, state,
Direction.fromAxisAndDirection(state.getValue(EncasedCogwheelBlock.AXIS), AxisDirection.POSITIVE));
}

View file

@ -6,9 +6,9 @@ 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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
@ -52,7 +52,7 @@ public class SplitShaftRenderer extends KineticTileEntityRenderer {
angle = angle / 180f * (float) Math.PI;
SuperByteBuffer superByteBuffer =
CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction);
CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction);
kineticRotationTransform(superByteBuffer, te, axis, angle, light);
superByteBuffer.renderInto(ms, buffer.getBuffer(RenderType.solid()));
}

View file

@ -8,9 +8,9 @@ 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.relays.gauge.GaugeBlock.Type;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
@ -48,8 +48,8 @@ public class GaugeRenderer extends KineticTileEntityRenderer {
PartialModel partialModel = (type == Type.SPEED ? AllBlockPartials.GAUGE_HEAD_SPEED : AllBlockPartials.GAUGE_HEAD_STRESS);
SuperByteBuffer headBuffer =
CachedBufferer.partial(partialModel, gaugeState);
SuperByteBuffer dialBuffer = CachedBufferer.partial(AllBlockPartials.GAUGE_DIAL, gaugeState);
CachedPartialBuffers.partial(partialModel, gaugeState);
SuperByteBuffer dialBuffer = CachedPartialBuffers.partial(AllBlockPartials.GAUGE_DIAL, gaugeState);
float dialPivot = 5.75f / 16;
float progress = Mth.lerp(partialTicks, gaugeTE.prevDialState, gaugeTE.dialState);

View file

@ -5,9 +5,9 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
@ -38,7 +38,7 @@ public class GearboxRenderer extends KineticTileEntityRenderer {
if (boxAxis == axis)
continue;
SuperByteBuffer shaft = CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction);
SuperByteBuffer shaft = CachedPartialBuffers.partialFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState(), direction);
float offset = getRotationOffsetForPosition(te, pos, axis);
float angle = (time * te.getSpeed() * 3f / 10) % 360;

View file

@ -5,8 +5,8 @@ import com.mojang.math.Vector3f;
import com.simibubi.create.foundation.item.render.CustomRenderedItemModelRenderer;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueHandler;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.resources.model.BakedModel;

View file

@ -1,7 +1,6 @@
package com.simibubi.create.content.curiosities;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.NonNullList;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;

View file

@ -4,15 +4,15 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.gui.element.GuiGameElement;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.HumanoidModel;
@ -63,8 +63,8 @@ public class CopperBacktankArmorLayer<T extends LivingEntity, M extends EntityMo
RenderType renderType = Sheets.cutoutBlockSheet();
BlockState renderedState = AllBlocks.COPPER_BACKTANK.getDefaultState()
.setValue(CopperBacktankBlock.HORIZONTAL_FACING, Direction.SOUTH);
SuperByteBuffer backtank = CachedBufferer.block(renderedState);
SuperByteBuffer cogs = CachedBufferer.partial(AllBlockPartials.COPPER_BACKTANK_COGS, renderedState);
SuperByteBuffer backtank = CachedBlockBuffers.block(renderedState);
SuperByteBuffer cogs = CachedPartialBuffers.partial(AllBlockPartials.COPPER_BACKTANK_COGS, renderedState);
ms.pushPose();
@ -72,20 +72,23 @@ public class CopperBacktankArmorLayer<T extends LivingEntity, M extends EntityMo
ms.translate(-1 / 2f, 10 / 16f, 1f);
ms.scale(1, -1, -1);
backtank.forEntityRender()
.light(light)
.renderInto(ms, buffer.getBuffer(renderType));
FlwSuperByteBuffer.cast(backtank).ifPresent(flwBuffer -> flwBuffer
.forEntityRender()
.light(light)
.renderInto(ms, buffer.getBuffer(renderType))
);
cogs.centre()
.rotateY(180)
.unCentre()
.translate(0, 6.5f / 16, 11f / 16)
.rotate(Direction.EAST, AngleHelper.rad(2 * WorldTickHolder.getRenderTime(entity.level) % 360))
.translate(0, -6.5f / 16, -11f / 16);
FlwSuperByteBuffer.cast(cogs).ifPresent(flwBuffer -> flwBuffer
.centre()
.rotateY(180)
.unCentre()
.translate(0, 6.5f / 16, 11f / 16)
.rotate(Direction.EAST, AngleHelper.rad(2 * WorldTickHolder.getRenderTime(entity.level) % 360))
.translate(0, -6.5f / 16, -11f / 16)
.forEntityRender()
);
cogs.forEntityRender()
.light(light)
.renderInto(ms, buffer.getBuffer(renderType));
cogs.light(light).renderInto(ms, buffer.getBuffer(renderType));
ms.popPose();
}

View file

@ -4,16 +4,16 @@ import com.mojang.blaze3d.vertex.PoseStack;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction;
import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState;
public class CopperBacktankRenderer extends KineticTileEntityRenderer {
@ -28,10 +28,8 @@ public class CopperBacktankRenderer extends KineticTileEntityRenderer {
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
BlockState blockState = te.getBlockState();
SuperByteBuffer cogs = CachedBufferer.partial(AllBlockPartials.COPPER_BACKTANK_COGS, blockState);
cogs.centre()
.rotateY(180 + AngleHelper.horizontalAngle(blockState.getValue(CopperBacktankBlock.HORIZONTAL_FACING)))
.unCentre()
SuperByteBuffer cogs = CachedPartialBuffers.partial(AllBlockPartials.COPPER_BACKTANK_COGS, blockState);
cogs.rotateCentered(Direction.Axis.Y, Mth.DEG_TO_RAD * (180 + AngleHelper.horizontalAngle(blockState.getValue(CopperBacktankBlock.HORIZONTAL_FACING))))
.translate(0, 6.5f / 16, 11f / 16)
.rotate(Direction.EAST,
AngleHelper.rad(te.getSpeed() / 4f * WorldTickHolder.getRenderTime(te.getLevel()) % 360))
@ -42,7 +40,7 @@ public class CopperBacktankRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partial(AllBlockPartials.COPPER_BACKTANK_SHAFT, state);
return CachedPartialBuffers.partial(AllBlockPartials.COPPER_BACKTANK_SHAFT, state);
}
}

View file

@ -10,8 +10,8 @@ import com.simibubi.create.content.contraptions.particle.AirParticleData;
import com.simibubi.create.foundation.advancement.AllAdvancements;
import com.simibubi.create.foundation.tileEntity.ComparatorUtil;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction.Axis;
import net.minecraft.core.particles.ParticleTypes;

View file

@ -1,11 +1,11 @@
package com.simibubi.create.content.curiosities.bell;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -26,7 +26,7 @@ public class BellRenderer<TE extends AbstractBellTileEntity> extends SafeTileEnt
Direction facing = state.getValue(BellBlock.FACING);
BellAttachType attachment = state.getValue(BellBlock.ATTACHMENT);
SuperByteBuffer bell = CachedBufferer.partial(te.getBellModel(), state);
SuperByteBuffer bell = CachedPartialBuffers.partial(te.getBellModel(), state);
if (te.isRinging)
bell.rotateCentered(te.ringDirection.getCounterClockWise(), getSwingAngle(te.ringingTicks + partialTicks));

View file

@ -7,8 +7,8 @@ import java.util.stream.Stream;
import com.google.common.collect.Streams;
import com.simibubi.create.content.curiosities.bell.SoulParticle.ExpandingPerimeterData;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.SpawnPlacements;

View file

@ -7,8 +7,8 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Mov
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.logistics.trains.entity.CarriageContraptionEntity;
import com.simibubi.create.content.logistics.trains.entity.CarriageSyncData;
import net.createmod.catnip.utility.animation.LerpedFloat.Chaser;
import net.createmod.catnip.utility.animation.LerpedFloat.Chaser;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;

View file

@ -2,9 +2,9 @@ package com.simibubi.create.content.curiosities.deco;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.CachedBlockBuffers;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context;
@ -43,10 +43,10 @@ public class SlidingDoorRenderer extends SafeTileEntityRenderer<SlidingDoorTileE
VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped());
for (DoubleBlockHalf half : DoubleBlockHalf.values()) {
CachedBufferer.block(blockState.setValue(DoorBlock.OPEN, false)
CachedBlockBuffers.block(blockState.setValue(DoorBlock.OPEN, false)
.setValue(DoorBlock.HALF, half))
.translate(0, half == DoubleBlockHalf.UPPER ? 1 - 1 / 512f : 0, 0)
.translate(offset)
.translate(offset.x, offset.y, offset.z)
.light(light)
.renderInto(ms, vb);
}

View file

@ -4,9 +4,9 @@ import java.util.List;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.animation.LerpedFloat.Chaser;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;

View file

@ -3,15 +3,16 @@ package com.simibubi.create.content.curiosities.toolbox;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction;
import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState;
public class ToolboxRenderer extends SmartTileEntityRenderer<ToolboxTileEntity> {
@ -28,26 +29,24 @@ public class ToolboxRenderer extends SmartTileEntityRenderer<ToolboxTileEntity>
Direction facing = blockState.getValue(ToolboxBlock.FACING)
.getOpposite();
SuperByteBuffer lid =
CachedBufferer.partial(AllBlockPartials.TOOLBOX_LIDS.get(tileEntityIn.getColor()), blockState);
SuperByteBuffer drawer = CachedBufferer.partial(AllBlockPartials.TOOLBOX_DRAWER, blockState);
CachedPartialBuffers.partial(AllBlockPartials.TOOLBOX_LIDS.get(tileEntityIn.getColor()), blockState);
SuperByteBuffer drawer = CachedPartialBuffers.partial(AllBlockPartials.TOOLBOX_DRAWER, blockState);
float lidAngle = tileEntityIn.lid.getValue(partialTicks);
float drawerOffset = tileEntityIn.drawers.getValue(partialTicks);
VertexConsumer builder = buffer.getBuffer(RenderType.cutoutMipped());
lid.centre()
.rotateY(-facing.toYRot())
.unCentre()
lid
.rotateCentered(Direction.Axis.Y, Mth.DEG_TO_RAD * -facing.toYRot())
.translate(0, 6 / 16f, 12 / 16f)
.rotateX(135 * lidAngle)
.rotate(Direction.Axis.X, Mth.DEG_TO_RAD * (135 * lidAngle))
.translate(0, -6 / 16f, -12 / 16f)
.light(light)
.renderInto(ms, builder);
for (int offset : Iterate.zeroAndOne) {
drawer.centre()
.rotateY(-facing.toYRot())
.unCentre()
drawer
.rotateCentered(Direction.Axis.Y, Mth.DEG_TO_RAD * -facing.toYRot())
.translate(0, offset * 1 / 8f, -drawerOffset * .175f * (2 - offset))
.light(light)
.renderInto(ms, builder);

View file

@ -6,9 +6,10 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Matrix3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.curiosities.tools.BlueprintEntity.BlueprintSection;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Couple;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
@ -33,16 +34,21 @@ public class BlueprintRenderer extends EntityRenderer<BlueprintEntity> {
int light) {
PartialModel partialModel = entity.size == 3 ? AllBlockPartials.CRAFTING_BLUEPRINT_3x3
: entity.size == 2 ? AllBlockPartials.CRAFTING_BLUEPRINT_2x2 : AllBlockPartials.CRAFTING_BLUEPRINT_1x1;
SuperByteBuffer sbb = CachedBufferer.partial(partialModel, Blocks.AIR.defaultBlockState());
sbb.rotateY(-yaw)
.rotateX(90.0F + entity.getXRot())
.translate(-.5, -1 / 32f, -.5);
if (entity.size == 2)
sbb.translate(.5, 0, -.5);
SuperByteBuffer sbb = CachedPartialBuffers.partial(partialModel, Blocks.AIR.defaultBlockState());
FlwSuperByteBuffer.cast(sbb).ifPresent(flwBuffer -> {
flwBuffer
.rotateY(-yaw)
.rotateX(90.0F + entity.getXRot())
.translate(-.5, -1 / 32f, -.5);
if (entity.size == 2)
flwBuffer.translate(.5, 0, -.5);
flwBuffer.forEntityRender()
.light(light)
.renderInto(ms, buffer.getBuffer(Sheets.solidBlockSheet()));
});
sbb.forEntityRender()
.light(light)
.renderInto(ms, buffer.getBuffer(Sheets.solidBlockSheet()));
super.render(entity, yaw, pt, ms, buffer, light);
ms.pushPose();

View file

@ -10,9 +10,9 @@ import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.item.ItemDescription;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.CreateLang;
import net.createmod.catnip.utility.NBTHelper;
import com.simibubi.create.foundation.utility.NBTProcessors;
import net.createmod.catnip.utility.NBTHelper;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;

View file

@ -6,8 +6,8 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f;
import com.simibubi.create.content.curiosities.zapper.ZapperItemRenderer;
import com.simibubi.create.foundation.item.render.PartialItemModelRenderer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.renderer.LightTexture;

View file

@ -15,8 +15,8 @@ import com.simibubi.create.foundation.gui.widget.Label;
import com.simibubi.create.foundation.gui.widget.ScrollInput;
import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
import com.simibubi.create.foundation.utility.CreateLang;
import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.NBTHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;

View file

@ -5,10 +5,10 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
@ -34,7 +34,7 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer<BeltTunnelTileEn
if (Backend.canUseInstancing(te.getLevel()))
return;
SuperByteBuffer flapBuffer = CachedBufferer.partial(AllBlockPartials.BELT_TUNNEL_FLAP, te.getBlockState());
SuperByteBuffer flapBuffer = CachedPartialBuffers.partial(AllBlockPartials.BELT_TUNNEL_FLAP, te.getBlockState());
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
Vec3 pivot = VecHelper.voxelSpace(0, 10, 1f);
TransformStack msr = TransformStack.cast(ms);

View file

@ -1,9 +1,9 @@
package com.simibubi.create.content.logistics.block.chute;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.world.level.block.state.BlockState;

View file

@ -9,9 +9,10 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.IntAttached;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
@ -48,10 +49,9 @@ public class EjectorRenderer extends KineticTileEntityRenderer {
float angle = lidProgress * 70;
if (!Backend.canUseInstancing(te.getLevel())) {
SuperByteBuffer model = CachedBufferer.partial(AllBlockPartials.EJECTOR_TOP, te.getBlockState());
applyLidAngle(te, angle, model);
model.light(light)
.renderInto(ms, vertexBuilder);
SuperByteBuffer model = CachedPartialBuffers.partial(AllBlockPartials.EJECTOR_TOP, te.getBlockState());
FlwSuperByteBuffer.cast(model).ifPresent(flwBuffer -> applyLidAngle(te, angle, flwBuffer));
model.light(light).renderInto(ms, vertexBuilder);
}
TransformStack msr = TransformStack.cast(ms);

View file

@ -1,10 +1,10 @@
package com.simibubi.create.content.logistics.block.diodes;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.ColoredOverlayTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.theme.Color;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@ -21,7 +21,7 @@ public class BrassDiodeRenderer extends ColoredOverlayTileEntityRenderer<BrassDi
@Override
protected SuperByteBuffer getOverlayBuffer(BrassDiodeTileEntity te) {
return CachedBufferer.partial(AllBlockPartials.FLEXPEATER_INDICATOR, te.getBlockState());
return CachedPartialBuffers.partial(AllBlockPartials.FLEXPEATER_INDICATOR, te.getBlockState());
}
}

View file

@ -3,10 +3,12 @@ package com.simibubi.create.content.logistics.block.display;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.render.RenderTypes;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
@ -49,15 +51,17 @@ public class DisplayLinkRenderer extends SafeTileEntityRenderer<DisplayLinkTileE
.rotateX(-AngleHelper.verticalAngle(face) - 90)
.unCentre();
CachedBufferer.partial(AllBlockPartials.DISPLAY_LINK_TUBE, blockState)
CachedPartialBuffers.partial(AllBlockPartials.DISPLAY_LINK_TUBE, blockState)
.light(LightTexture.FULL_BRIGHT)
.renderInto(ms, buffer.getBuffer(RenderType.translucent()));
CachedBufferer.partial(AllBlockPartials.DISPLAY_LINK_GLOW, blockState)
.light(LightTexture.FULL_BRIGHT)
.color(color, color, color, 255)
.disableDiffuse()
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));
SuperByteBuffer partial = CachedPartialBuffers.partial(AllBlockPartials.DISPLAY_LINK_GLOW, blockState);
FlwSuperByteBuffer.cast(partial).ifPresent(flwBuffer -> flwBuffer
.light(LightTexture.FULL_BRIGHT)
.color(color, color, color, 255)
.disableDiffuse()
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()))
);
ms.popPose();
}

View file

@ -6,10 +6,10 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.client.renderer.MultiBufferSource;
@ -37,7 +37,7 @@ public class FunnelRenderer extends SmartTileEntityRenderer<FunnelTileEntity> {
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
PartialModel partialModel = (blockState.getBlock() instanceof FunnelBlock ? AllBlockPartials.FUNNEL_FLAP
: AllBlockPartials.BELT_FUNNEL_FLAP);
SuperByteBuffer flapBuffer = CachedBufferer.partial(partialModel, blockState);
SuperByteBuffer flapBuffer = CachedPartialBuffers.partial(partialModel, blockState);
Vec3 pivot = VecHelper.voxelSpace(0, 10, 9.5f);
TransformStack msr = TransformStack.cast(ms);

View file

@ -8,9 +8,9 @@ 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.logistics.block.mechanicalArm.ArmTileEntity.Phase;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.theme.Color;
@ -113,17 +113,17 @@ public class ArmRenderer extends KineticTileEntityRenderer {
private void renderArm(VertexConsumer builder, PoseStack ms, PoseStack msLocal, TransformStack msr,
BlockState blockState, int color, float baseAngle, float lowerArmAngle, float upperArmAngle, float headAngle,
boolean hasItem, boolean isBlockItem, int light) {
SuperByteBuffer base = CachedBufferer.partial(AllBlockPartials.ARM_BASE, blockState)
SuperByteBuffer base = CachedPartialBuffers.partial(AllBlockPartials.ARM_BASE, blockState)
.light(light);
SuperByteBuffer lowerBody = CachedBufferer.partial(AllBlockPartials.ARM_LOWER_BODY, blockState)
SuperByteBuffer lowerBody = CachedPartialBuffers.partial(AllBlockPartials.ARM_LOWER_BODY, blockState)
.light(light);
SuperByteBuffer upperBody = CachedBufferer.partial(AllBlockPartials.ARM_UPPER_BODY, blockState)
SuperByteBuffer upperBody = CachedPartialBuffers.partial(AllBlockPartials.ARM_UPPER_BODY, blockState)
.light(light);
SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.ARM_HEAD, blockState)
SuperByteBuffer head = CachedPartialBuffers.partial(AllBlockPartials.ARM_HEAD, blockState)
.light(light);
SuperByteBuffer claw = CachedBufferer.partial(AllBlockPartials.ARM_CLAW_BASE, blockState)
SuperByteBuffer claw = CachedPartialBuffers.partial(AllBlockPartials.ARM_CLAW_BASE, blockState)
.light(light);
SuperByteBuffer clawGrip = CachedBufferer.partial(AllBlockPartials.ARM_CLAW_GRIP, blockState);
SuperByteBuffer clawGrip = CachedPartialBuffers.partial(AllBlockPartials.ARM_CLAW_GRIP, blockState);
transformBase(msr, baseAngle);
base.transform(msLocal)
@ -204,7 +204,7 @@ public class ArmRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partial(AllBlockPartials.ARM_COG, state);
return CachedPartialBuffers.partial(AllBlockPartials.ARM_COG, state);
}
}

View file

@ -19,14 +19,13 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform;
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.INamedIconOptions;
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollOptionBehaviour;
import net.createmod.catnip.utility.lang.Lang;
import net.createmod.catnip.utility.math.AngleHelper;
import com.simibubi.create.foundation.utility.CreateLang;
import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.VecHelper;
import net.createmod.catnip.utility.animation.LerpedFloat;
import net.createmod.catnip.utility.lang.Lang;
import net.createmod.catnip.utility.math.AngleHelper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;

View file

@ -4,10 +4,10 @@ import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.theme.Color;
import net.minecraft.client.renderer.MultiBufferSource;
@ -34,7 +34,7 @@ public class AnalogLeverRenderer extends SafeTileEntityRenderer<AnalogLeverTileE
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
// Handle
SuperByteBuffer handle = CachedBufferer.partial(AllBlockPartials.ANALOG_LEVER_HANDLE, leverState);
SuperByteBuffer handle = CachedPartialBuffers.partial(AllBlockPartials.ANALOG_LEVER_HANDLE, leverState);
float angle = (float) ((state / 15) * 90 / 180 * Math.PI);
transform(handle, leverState).translate(1 / 2f, 1 / 16f, 1 / 2f)
.rotate(Direction.EAST, angle)
@ -44,7 +44,7 @@ public class AnalogLeverRenderer extends SafeTileEntityRenderer<AnalogLeverTileE
// Indicator
int color = Color.mixColors(0x2C0300, 0xCD0000, state / 15f);
SuperByteBuffer indicator = transform(CachedBufferer.partial(AllBlockPartials.ANALOG_LEVER_INDICATOR, leverState), leverState);
SuperByteBuffer indicator = transform(CachedPartialBuffers.partial(AllBlockPartials.ANALOG_LEVER_INDICATOR, leverState), leverState);
indicator.light(light)
.color(color)
.renderInto(ms, vb);

View file

@ -13,8 +13,8 @@ import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement;
import com.simibubi.create.content.schematics.ItemRequirement;
import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType;
import com.simibubi.create.foundation.block.ITE;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;

View file

@ -6,17 +6,17 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.logistics.block.redstone.DoubleFaceAttachedBlock.DoubleAttachFace;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import com.simibubi.create.foundation.render.FlwSuperByteBuffer;
import com.simibubi.create.foundation.render.RenderTypes;
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
import com.simibubi.create.foundation.utility.DyeHelper;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.catnip.utility.theme.Color;
import net.createmod.catnip.utility.Couple;
import com.simibubi.create.foundation.utility.DyeHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.createmod.catnip.utility.Iterate;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.font.glyphs.BakedGlyph;
@ -138,7 +138,7 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
boolean invertTubes =
facing == Direction.DOWN || blockState.getValue(NixieTubeBlock.FACE) == DoubleAttachFace.WALL_REVERSED;
CachedBufferer.partial(AllBlockPartials.SIGNAL_PANEL, blockState)
CachedPartialBuffers.partial(AllBlockPartials.SIGNAL_PANEL, blockState)
.light(light)
.renderInto(ms, buffer.getBuffer(RenderType.solid()));
@ -167,30 +167,35 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
float longSide = yellow ? 1 : 4;
float longSideGlow = yellow ? 2 : 5.125f;
CachedBufferer.partial(AllBlockPartials.SIGNAL_WHITE_CUBE, blockState)
.light(0xf000f0)
.disableDiffuse()
.scale(vert ? longSide : 1, vert ? 1 : longSide, 1)
.renderInto(ms, buffer.getBuffer(RenderType.translucent()));
FlwSuperByteBuffer.cast(CachedPartialBuffers.partial(AllBlockPartials.SIGNAL_WHITE_CUBE, blockState))
.ifPresent(flwBuffer -> flwBuffer
.light(0xf000f0)
.disableDiffuse()
.scale(vert ? longSide : 1, vert ? 1 : longSide, 1)
.renderInto(ms, buffer.getBuffer(RenderType.translucent()))
);
CachedBufferer
FlwSuperByteBuffer.cast(CachedPartialBuffers
.partial(
first ? AllBlockPartials.SIGNAL_RED_GLOW
: yellow ? AllBlockPartials.SIGNAL_YELLOW_GLOW : AllBlockPartials.SIGNAL_WHITE_GLOW,
blockState)
.light(0xf000f0)
.disableDiffuse()
.scale(vert ? longSideGlow : 2, vert ? 2 : longSideGlow, 2)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));
blockState)).ifPresent(flwBuffer -> flwBuffer
.light(0xf000f0)
.disableDiffuse()
.scale(vert ? longSideGlow : 2, vert ? 2 : longSideGlow, 2)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()))
);
}
CachedBufferer
FlwSuperByteBuffer.cast(CachedPartialBuffers
.partial(first ? AllBlockPartials.SIGNAL_RED
: yellow ? AllBlockPartials.SIGNAL_YELLOW : AllBlockPartials.SIGNAL_WHITE, blockState)
.light(0xF000F0)
.disableDiffuse()
.scale(1 + 1 / 16f)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));
: yellow ? AllBlockPartials.SIGNAL_YELLOW : AllBlockPartials.SIGNAL_WHITE, blockState))
.ifPresent(flwBuffer -> flwBuffer
.light(0xF000F0)
.disableDiffuse()
.scale(1 + 1 / 16f)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()))
);
ms.popPose();
}

View file

@ -9,9 +9,9 @@ import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalTileEntity.SignalState;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import net.createmod.catnip.utility.Couple;
import com.simibubi.create.foundation.utility.DynamicComponent;
import net.createmod.catnip.utility.Couple;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;

View file

@ -4,8 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import com.simibubi.create.AllContainerTypes;
import net.createmod.catnip.utility.Pair;
import net.createmod.catnip.utility.Pair;
import net.minecraft.ChatFormatting;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;

View file

@ -16,8 +16,8 @@ import com.simibubi.create.foundation.gui.widget.Label;
import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.utility.CreateLang;
import net.createmod.catnip.utility.Pair;
import net.createmod.catnip.utility.Pair;
import net.minecraft.ChatFormatting;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;

View file

@ -12,9 +12,9 @@ import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import com.simibubi.create.content.contraptions.components.structureMovement.Contraption;
import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.Pair;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;

View file

@ -7,7 +7,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.utility.AnimationTickHolder;
import net.createmod.catnip.utility.math.AngleHelper;
@ -16,6 +16,7 @@ import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
@ -74,9 +75,9 @@ public class CarriageCouplingRenderer {
ms.pushPose();
ms.pushPose();
ms.translate(anchor.x, anchor.y, anchor.z);
CachedBufferer.partial(AllBlockPartials.TRAIN_COUPLING_HEAD, air)
.rotateY(-yRot)
.rotateX(xRot)
CachedPartialBuffers.partial(AllBlockPartials.TRAIN_COUPLING_HEAD, air)
.rotate(Direction.Axis.Y, Mth.DEG_TO_RAD * -yRot)
.rotate(Direction.Axis.X, Mth.DEG_TO_RAD * xRot)
.light(lightCoords)
.renderInto(ms, vb);
@ -86,9 +87,9 @@ public class CarriageCouplingRenderer {
int couplingSegments = (int) Math.round(couplingDistance * 4);
double stretch = ((anchor2.distanceTo(anchor) - 2 * margin) * 4) / couplingSegments;
for (int j = 0; j < couplingSegments; j++) {
CachedBufferer.partial(AllBlockPartials.TRAIN_COUPLING_CABLE, air)
.rotateY(-yRot + 180)
.rotateX(-xRot)
CachedPartialBuffers.partial(AllBlockPartials.TRAIN_COUPLING_CABLE, air)
.rotate(Direction.Axis.Y, Mth.DEG_TO_RAD * (-yRot + 180))
.rotate(Direction.Axis.X, Mth.DEG_TO_RAD * -xRot)
.translate(0, 0, margin + 2 / 16f)
.scale(1, 1, (float) stretch)
.translate(0, 0, j / 4f)
@ -102,9 +103,9 @@ public class CarriageCouplingRenderer {
ms.translate(-position.x, -position.y, -position.z);
ms.translate(position2.x, position2.y, position2.z);
ms.translate(anchor2.x, anchor2.y, anchor2.z);
CachedBufferer.partial(AllBlockPartials.TRAIN_COUPLING_HEAD, air)
.rotateY(-yRot + 180)
.rotateX(-xRot)
CachedPartialBuffers.partial(AllBlockPartials.TRAIN_COUPLING_HEAD, air)
.rotate(Direction.Axis.Y, Mth.DEG_TO_RAD * (-yRot + 180))
.rotate(Direction.Axis.X, Mth.DEG_TO_RAD * -xRot)
.light(lightCoords2)
.renderInto(ms, vb);
ms.popPose();

View file

@ -31,11 +31,11 @@ import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalEdgeGroup;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.TrackEdgePoint;
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation;
import net.createmod.catnip.utility.Couple;
import net.createmod.catnip.utility.Iterate;
import net.createmod.catnip.utility.NBTHelper;
import net.createmod.catnip.utility.Pair;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.util.Mth;

View file

@ -11,9 +11,9 @@ import com.mojang.math.Matrix4f;
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.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import com.simibubi.create.foundation.render.CachedPartialBuffers;
import net.createmod.catnip.render.SuperByteBuffer;
import net.createmod.catnip.utility.math.AngleHelper;
import net.createmod.ponder.utility.WorldTickHolder;
import net.minecraft.client.Minecraft;
@ -232,7 +232,7 @@ public class FlapDisplayRenderer extends KineticTileEntityRenderer {
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacingVertical(AllBlockPartials.SHAFTLESS_COGWHEEL, state,
return CachedPartialBuffers.partialFacingVertical(AllBlockPartials.SHAFTLESS_COGWHEEL, state,
state.getValue(FlapDisplayBlock.HORIZONTAL_FACING));
}

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