Skip to content

Commit 6a52999

Browse files
authored
Merge pull request #258 from Oondanomala/1.8-less-allocations
[1.8] Reduce allocations
2 parents ca1c2b6 + 2af3c2d commit 6a52999

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/dev/tr7zw/entityculling/Provider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
public class Provider implements DataProvider {
1010

1111
private final Minecraft client = Minecraft.getMinecraft();
12+
private final BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos();
1213
private WorldClient world = null;
13-
14+
1415
@Override
1516
public boolean prepareChunk(int chunkX, int chunkZ) {
1617
world = client.theWorld;
@@ -19,8 +20,7 @@ public boolean prepareChunk(int chunkX, int chunkZ) {
1920

2021
@Override
2122
public boolean isOpaqueFullCube(int x, int y, int z) {
22-
BlockPos pos = new BlockPos(x, y, z);
23-
return world.getBlockState(pos).getBlock().isOpaqueCube();
23+
return world.getBlockState(pos.set(x, y, z)).getBlock().isOpaqueCube();
2424
}
2525

2626
@Override

0 commit comments

Comments
 (0)