Archiviert
13
0

Override BlockPosition.MutableBlockPosition.isValidLocation()

Fixes GH-281
Dieser Commit ist enthalten in:
BlackHole 2016-05-12 12:56:48 -05:00 committet von Zach Brown
Ursprung 74a73b7223
Commit ad63fd7d6a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: CC9DA35FC5450B76

Datei anzeigen

@ -1,4 +1,4 @@
From e678b0cd49904fd62192a607e2444dd4c8eae5d4 Mon Sep 17 00:00:00 2001
From 3a02b0e6f4d2149f1be45e802a51ecfae1fa7453 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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