From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 6 Jul 2020 22:48:48 -0700 Subject: [PATCH] Manually inline methods in BlockPosition diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java index f2758e3c9447dbf307b2306c8d56bdc2d5ee7edf..cf3c1b32677143a4bcf249bd471d336ef00757b3 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -515,9 +515,9 @@ public class BlockPos extends Vec3i { } public BlockPos.MutableBlockPos set(int x, int y, int z) { - this.setX(x); - this.setY(y); - this.setZ(z); + this.x = x; // Paper - force inline + this.y = y; // Paper - force inline + this.z = z; // Paper - force inline return this; } @@ -581,19 +581,19 @@ public class BlockPos extends Vec3i { // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep @Override public BlockPos.MutableBlockPos setX(int i) { - super.setX(i); + this.x = i; // Paper return this; } @Override public BlockPos.MutableBlockPos setY(int i) { - super.setY(i); + this.y = i; // Paper return this; } @Override public BlockPos.MutableBlockPos setZ(int i) { - super.setZ(i); + this.z = i; // Paper return this; } // Paper end diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java index 509702714fa9c5565fcc766d76874a0e051e9c72..279ef2fc921a86a607a505ed179f0d736279494b 100644 --- a/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java @@ -19,9 +19,9 @@ public class Vec3i implements Comparable { return IntStream.of(vec.getX(), vec.getY(), vec.getZ()); }); public static final Vec3i ZERO = new Vec3i(0, 0, 0); - private int x; - private int y; - private int z; + protected int x; // Paper - protected + protected int y; // Paper - protected + protected int z; // Paper - protected public static Codec offsetCodec(int maxAbsValue) { return ExtraCodecs.validate(CODEC, (vec) -> {