From 53a23f8d3d40f84dc66ccaabd222351ea2c04d25 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 4 May 2022 19:11:35 +0100 Subject: [PATCH] Use a simpler getRenderBoundingBox method for cables Our cable has a rather complex getCollisionBoundingBox implementation, which (combined with computing the actual block state) ends up taking an awful lot of time. This shaves 9% off each frame. I don't miss 1.12 one bit. --- .../shared/peripheral/modem/wired/TileCable.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java index 18a835f09..5c3c69adb 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java @@ -24,6 +24,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.text.TextComponentTranslation; @@ -444,4 +445,11 @@ public PeripheralType getPeripheralType() IBlockState state = getBlockState(); return BlockCable.getPeripheralType( state ); } + + @Nonnull + @Override + public AxisAlignedBB getRenderBoundingBox() + { + return Block.FULL_BLOCK_AABB.offset( getPos() ); + } }