Skip to content

Commit

Permalink
Fix render bounds of more block entities (#384)
Browse files Browse the repository at this point in the history
Shulker box, end gateway, spawner, trial spawner and piston
  • Loading branch information
XFactHD authored Dec 14, 2023
1 parent c045a7e commit 84d25b7
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
+ }
}
Original file line number Diff line number Diff line change
@@ -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);
+ }
}
Original file line number Diff line number Diff line change
@@ -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);
+ }
}
Original file line number Diff line number Diff line change
@@ -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);
+ }
}

0 comments on commit 84d25b7

Please sign in to comment.