Switch up the signature to take ints instead of a blockpos and stop allocating one (#324)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2024-02-21 21:29:56 -08:00
1 parent 8898a6f252
commit ce97ef876d
2 files changed
+5 -5

No files matched your search

@@ -35,10 +35,10 @@ public class ChunkSectionPos extends Vector3i {
return coord & 15;
}
public static short packLocal(BlockPos pos) {
int i = getLocalCoord(pos.x);
int j = getLocalCoord(pos.y);
int k = getLocalCoord(pos.z);
public static short packLocal(int x, int y, int z) {
final int i = getLocalCoord(x);
final int j = getLocalCoord(y);
final int k = getLocalCoord(z);
return (short)(i << 8 | k << 4 | j << 0);
}
@@ -87,7 +87,7 @@ public class ClonedChunkSection {
if (tileentity != null)
{
this.tileEntities.put(ChunkSectionPos.packLocal(new BlockPos(tileentity.xCoord & 15, tileentity.yCoord & 15, tileentity.zCoord & 15)), tileentity);
this.tileEntities.put(ChunkSectionPos.packLocal(tileentity.xCoord & 15, tileentity.yCoord & 15, tileentity.zCoord & 15), tileentity);
}
}
}