From 84d25b7cdd34f6119c845c1194c89ee937b3fdf8 Mon Sep 17 00:00:00 2001 From: Dennis C Date: Thu, 14 Dec 2023 03:37:04 +0100 Subject: [PATCH] Fix render bounds of more block entities (#384) Shulker box, end gateway, spawner, trial spawner and piston --- .../blockentity/PistonHeadRenderer.java.patch | 11 +++++++++++ .../blockentity/ShulkerBoxRenderer.java.patch | 2 +- .../renderer/blockentity/SpawnerRenderer.java.patch | 13 +++++++++++++ .../blockentity/TheEndGatewayRenderer.java.patch | 12 ++++++++++++ .../blockentity/TrialSpawnerRenderer.java.patch | 13 +++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch create mode 100644 patches/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java.patch create mode 100644 patches/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java.patch diff --git a/patches/net/minecraft/client/renderer/blockentity/PistonHeadRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/PistonHeadRenderer.java.patch index ff968db636..f2fda5062b 100644 --- a/patches/net/minecraft/client/renderer/blockentity/PistonHeadRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/blockentity/PistonHeadRenderer.java.patch @@ -11,3 +11,14 @@ RenderType rendertype = ItemBlockRenderTypes.getMovingBlockRenderType(p_112460_); VertexConsumer vertexconsumer = p_112462_.getBuffer(rendertype); this.blockRenderer +@@ -86,5 +_,10 @@ + @Override + public int getViewDistance() { + return 68; ++ } ++ ++ @Override ++ public net.minecraft.world.phys.AABB getRenderBoundingBox(PistonMovingBlockEntity blockEntity) { ++ return INFINITE_EXTENT_AABB; + } + } diff --git a/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch index da40479869..88dd656992 100644 --- a/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch @@ -8,6 +8,6 @@ + @Override + public net.minecraft.world.phys.AABB getRenderBoundingBox(ShulkerBoxBlockEntity blockEntity) { + net.minecraft.core.BlockPos pos = blockEntity.getBlockPos(); -+ return new net.minecraft.world.phys.AABB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1.0, pos.getY() + 1.5, pos.getZ() + 1.0); ++ return new net.minecraft.world.phys.AABB(pos.getX() - 0.5, pos.getY() - 0.5, pos.getZ() - 0.5, pos.getX() + 1.5, pos.getY() + 1.5, pos.getZ() + 1.5); + } } diff --git a/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch new file mode 100644 index 0000000000..351d861b08 --- /dev/null +++ b/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java ++++ b/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java +@@ -57,4 +_,10 @@ + p_312703_.render(p_312223_, 0.0, 0.0, 0.0, 0.0F, p_311943_, p_312805_, p_312394_, p_311996_); + p_312805_.popPose(); + } ++ ++ @Override ++ public net.minecraft.world.phys.AABB getRenderBoundingBox(SpawnerBlockEntity blockEntity) { ++ net.minecraft.core.BlockPos pos = blockEntity.getBlockPos(); ++ return new net.minecraft.world.phys.AABB(pos.getX() - 1.0, pos.getY() - 1.0, pos.getZ() - 1.0, pos.getX() + 2.0, pos.getY() + 2.0, pos.getZ() + 2.0); ++ } + } diff --git a/patches/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java.patch new file mode 100644 index 0000000000..e495d572fd --- /dev/null +++ b/patches/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java ++++ b/net/minecraft/client/renderer/blockentity/TheEndGatewayRenderer.java +@@ -51,4 +_,9 @@ + public int getViewDistance() { + return 256; + } ++ ++ @Override ++ public net.minecraft.world.phys.AABB getRenderBoundingBox(TheEndGatewayBlockEntity blockEntity) { ++ return blockEntity.isSpawning() || blockEntity.isCoolingDown() ? INFINITE_EXTENT_AABB : super.getRenderBoundingBox(blockEntity); ++ } + } diff --git a/patches/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java.patch new file mode 100644 index 0000000000..2808364eff --- /dev/null +++ b/patches/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java ++++ b/net/minecraft/client/renderer/blockentity/TrialSpawnerRenderer.java +@@ -32,4 +_,10 @@ + } + } + } ++ ++ @Override ++ public net.minecraft.world.phys.AABB getRenderBoundingBox(TrialSpawnerBlockEntity blockEntity) { ++ net.minecraft.core.BlockPos pos = blockEntity.getBlockPos(); ++ return new net.minecraft.world.phys.AABB(pos.getX() - 1.0, pos.getY() - 1.0, pos.getZ() - 1.0, pos.getX() + 2.0, pos.getY() + 2.0, pos.getZ() + 2.0); ++ } + }