Unwrap Event Exceptions
This was a useless exception wrapper that ends up making stack traces harder to read as well as the JVM cutting off the important parts Nothing catches this exception, so its safe to just get rid of it and let the REAL exception bubble down
This commit is contained in:
parent
ddab622b9a
commit
17b58d00d8
170 changed files with 389 additions and 385 deletions
|
@ -1,44 +0,0 @@
|
|||
From 6b5682f52304efe35982bf2d15e3d9a25b840b66 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 24 May 2018 21:01:13 -0400
|
||||
Subject: [PATCH] Location.toBlockLocation/toCenterLocation()
|
||||
|
||||
Convert location objects to their block coordinates, or the center of the block
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 1ddebf3c..916238c4 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -492,6 +492,29 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
}
|
||||
|
||||
public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z)
|
||||
+ */
|
||||
+ public Location toBlockLocation() {
|
||||
+ Location blockLoc = clone();
|
||||
+ blockLoc.setX(getBlockX());
|
||||
+ blockLoc.setY(getBlockY());
|
||||
+ blockLoc.setZ(getBlockZ());
|
||||
+ return blockLoc;
|
||||
+ }
|
||||
+ /**
|
||||
+ * @return A new location where X/Y/Z are the center of the block
|
||||
+ */
|
||||
+ public Location toCenterLocation() {
|
||||
+ Location centerLoc = clone();
|
||||
+ centerLoc.setX(getBlockX() + 0.5);
|
||||
+ centerLoc.setY(getBlockY() + 0.5);
|
||||
+ centerLoc.setZ(getBlockZ() + 0.5);
|
||||
+ return centerLoc;
|
||||
+ }
|
||||
+ // Paper end
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
--
|
||||
2.18.0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue