1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-16 22:47:38 +00:00

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.
This commit is contained in:
Jonathan Coates
2022-05-04 19:11:35 +01:00
parent 550f63b1cb
commit 53a23f8d3d

View File

@@ -24,6 +24,7 @@ import net.minecraft.entity.player.EntityPlayer;
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 class TileCable extends TileGeneric implements IPeripheralTile
IBlockState state = getBlockState();
return BlockCable.getPeripheralType( state );
}
@Nonnull
@Override
public AxisAlignedBB getRenderBoundingBox()
{
return Block.FULL_BLOCK_AABB.offset( getPos() );
}
}