From b2087ca1afdc62d4ca356103c2de2cd75c78ff70 Mon Sep 17 00:00:00 2001 From: BlackHole Date: Thu, 12 May 2016 12:56:48 -0500 Subject: [PATCH] Override BlockPosition.MutableBlockPosition.isValidLocation() Fixes GH-281 --- .../Optimize-isValidLocation-for-inlining.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Spigot-Server-Patches/Optimize-isValidLocation-for-inlining.patch b/Spigot-Server-Patches/Optimize-isValidLocation-for-inlining.patch index 9d83a2cf91..6c60332f08 100644 --- a/Spigot-Server-Patches/Optimize-isValidLocation-for-inlining.patch +++ b/Spigot-Server-Patches/Optimize-isValidLocation-for-inlining.patch @@ -23,6 +23,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public BaseBlockPosition(int i, int j, int k) { this.a = i; +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + protected int b; + protected int c; + protected int d; ++ // Paper start ++ @Override ++ public boolean isValidLocation() { ++ return this.getX() >= -30000000 && this.getZ() >= -30000000 && this.getX() < 30000000 && this.getZ() < 30000000 && this.getY() >= 0 && this.getY() < 256; ++ } ++ // Paper end + + public MutableBlockPosition() { + this(0, 0, 0); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/World.java