mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +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:
		| @@ -24,6 +24,7 @@ import net.minecraft.entity.player.EntityPlayer; | |||||||
| import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.NBTTagCompound; | ||||||
| import net.minecraft.util.EnumFacing; | import net.minecraft.util.EnumFacing; | ||||||
| import net.minecraft.util.EnumHand; | import net.minecraft.util.EnumHand; | ||||||
|  | import net.minecraft.util.math.AxisAlignedBB; | ||||||
| import net.minecraft.util.math.BlockPos; | import net.minecraft.util.math.BlockPos; | ||||||
| import net.minecraft.util.math.Vec3d; | import net.minecraft.util.math.Vec3d; | ||||||
| import net.minecraft.util.text.TextComponentTranslation; | import net.minecraft.util.text.TextComponentTranslation; | ||||||
| @@ -444,4 +445,11 @@ public class TileCable extends TileGeneric implements IPeripheralTile | |||||||
|         IBlockState state = getBlockState(); |         IBlockState state = getBlockState(); | ||||||
|         return BlockCable.getPeripheralType( state ); |         return BlockCable.getPeripheralType( state ); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Nonnull | ||||||
|  |     @Override | ||||||
|  |     public AxisAlignedBB getRenderBoundingBox() | ||||||
|  |     { | ||||||
|  |         return Block.FULL_BLOCK_AABB.offset( getPos() ); | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates