From ad63fd7d6ade4c0423da881a7056f9b4acd8a59c 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 --- ...ptimize-isValidLocation-for-inlining.patch | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/0100-Optimize-isValidLocation-for-inlining.patch b/Spigot-Server-Patches/0100-Optimize-isValidLocation-for-inlining.patch index c5b890419c..280641c711 100644 --- a/Spigot-Server-Patches/0100-Optimize-isValidLocation-for-inlining.patch +++ b/Spigot-Server-Patches/0100-Optimize-isValidLocation-for-inlining.patch @@ -1,4 +1,4 @@ -From e678b0cd49904fd62192a607e2444dd4c8eae5d4 Mon Sep 17 00:00:00 2001 +From 3a02b0e6f4d2149f1be45e802a51ecfae1fa7453 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 22 Mar 2016 23:41:34 -0400 Subject: [PATCH] Optimize isValidLocation for inlining @@ -23,6 +23,23 @@ index d60e755..9114388 100644 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 99fcf4c..be34dcd 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -326,6 +326,12 @@ 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 3bdf072..ecf3a38 100644 --- a/src/main/java/net/minecraft/server/World.java