diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java index 0bb354858..7a346812c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java @@ -5,10 +5,13 @@ import static com.simibubi.create.content.contraptions.base.DirectionalKineticBl import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.PartialModel; +import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Vector3f; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.AllBlocks; +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.content.contraptions.components.deployer.DeployerTileEntity.Mode; @@ -34,6 +37,7 @@ import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; +import net.minecraft.core.Direction.AxisDirection; import net.minecraft.util.Mth; import net.minecraft.world.item.BlockItem; import net.minecraft.world.level.block.state.BlockState; @@ -158,6 +162,11 @@ public class DeployerRenderer extends SafeTileEntityRenderer Mode mode = NBTHelper.readEnum(context.tileData, "Mode", Mode.class); PartialModel handPose = getHandPose(mode); + float speed = (float) context.getAnimationSpeed(); + 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); @@ -177,13 +186,35 @@ public class DeployerRenderer extends SafeTileEntityRenderer PoseStack m = matrices.getModel(); m.pushPose(); - m.translate(offset.x, offset.y, offset.z); + m.pushPose(); + Axis axis = Axis.Y; + if (context.state.getBlock() instanceof IRotate) { + IRotate def = (IRotate) context.state.getBlock(); + axis = def.getRotationAxis(context.state); + } + + float time = AnimationTickHolder.getRenderTime(context.world) / 20; + float angle = (time * speed) % 360; + + new MatrixTransformStack(m) + .centre() + .rotateY(axis == Axis.Z ? 90 : 0) + .rotateZ(axis.isHorizontal() ? 90 : 0) + .unCentre(); + shaft.transform(m); + shaft.rotateCentered(Direction.get(AxisDirection.POSITIVE, Axis.Y), angle); + m.popPose(); + + m.translate(offset.x, offset.y, offset.z); pole.transform(m); hand.transform(m); + transform(pole, blockState, true); transform(hand, blockState, false); + shaft.light(matrices.getWorld(), ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld)) + .renderInto(matrices.getViewProjection(), builder); pole.light(matrices.getWorld(), ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld)) .renderInto(matrices.getViewProjection(), builder); hand.light(matrices.getWorld(), ContraptionRenderDispatcher.getContraptionWorldLight(context, renderWorld)) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelMovementBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelMovementBehaviour.java index 00bd9df24..3430fd6f0 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelMovementBehaviour.java @@ -120,6 +120,11 @@ public class FunnelMovementBehaviour extends MovementBehaviour { item.setItem(remainder); } } + + @Override + public boolean renderAsNormalTileEntity() { + return true; + } private ItemStack getFilter(MovementContext context) { return hasFilter ? ItemStack.of(context.tileData.getCompound("Filter")) : ItemStack.EMPTY; diff --git a/src/main/java/com/simibubi/create/foundation/worldgen/LayerPattern.java b/src/main/java/com/simibubi/create/foundation/worldgen/LayerPattern.java index 07676a335..fbb45ebe4 100644 --- a/src/main/java/com/simibubi/create/foundation/worldgen/LayerPattern.java +++ b/src/main/java/com/simibubi/create/foundation/worldgen/LayerPattern.java @@ -130,7 +130,7 @@ public class LayerPattern { private LayerBuilder blocks(BlockState stone, BlockState deepslate) { Layer.this.targets.add( ImmutableList.of(OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, stone), - OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, deepslate))); + OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, deepslate))); return this; } diff --git a/src/main/java/com/simibubi/create/foundation/worldgen/LayeredOreFeature.java b/src/main/java/com/simibubi/create/foundation/worldgen/LayeredOreFeature.java index 9b17ba183..98093069f 100644 --- a/src/main/java/com/simibubi/create/foundation/worldgen/LayeredOreFeature.java +++ b/src/main/java/com/simibubi/create/foundation/worldgen/LayeredOreFeature.java @@ -81,7 +81,7 @@ public class LayeredOreFeature extends OreFeatureBase { float dy = y * 2f / height - 1; if (dx * dx + dy * dy > 1) continue; - if (worldgenlevel.isOutsideBuildHeight(y)) + if (worldgenlevel.isOutsideBuildHeight(y0 + y)) continue; for (int z = 0; z < length; z++) {