mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 04:25:26 +01:00
Override BlockPosition.MutableBlockPosition.isValidLocation()
Fixes GH-281
This commit is contained in:
parent
74a73b7223
commit
ad63fd7d6a
@ -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>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Tue, 22 Mar 2016 23:41:34 -0400
|
Date: Tue, 22 Mar 2016 23:41:34 -0400
|
||||||
Subject: [PATCH] Optimize isValidLocation for inlining
|
Subject: [PATCH] Optimize isValidLocation for inlining
|
||||||
@ -23,6 +23,23 @@ index d60e755..9114388 100644
|
|||||||
|
|
||||||
public BaseBlockPosition(int i, int j, int k) {
|
public BaseBlockPosition(int i, int j, int k) {
|
||||||
this.a = i;
|
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
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||||
index 3bdf072..ecf3a38 100644
|
index 3bdf072..ecf3a38 100644
|
||||||
--- a/src/main/java/net/minecraft/server/World.java
|
--- a/src/main/java/net/minecraft/server/World.java
|
||||||
|
Loading…
Reference in New Issue
Block a user