Added toString to LazyLocation to fix /rg info with the teleport flag.

This commit is contained in:
Matthew Miller 2018-11-17 16:33:30 +10:00
parent 83b375b6e1
commit 015f192193
5 changed files with 14 additions and 5 deletions

View File

@ -68,4 +68,13 @@ public LazyLocation add(double x, double y, double z) {
return this.setPosition(toVector().add(x, y, z));
}
@Override
public String toString() {
if (getPitch() == 0 && getYaw() == 0) {
return String.join(", ", "World=" + worldName, "X=" + getX(), "Y=" + getY(), "Z=" + getZ());
} else {
return String.join(", ", "World=" + worldName, "X=" + getX(), "Y=" + getY(),
"Z=" + getZ(), "Pitch=" + getPitch(), "Yaw=" + getYaw());
}
}
}

View File

@ -40,8 +40,8 @@
* left of &lt; appear before in the sorted list):</p>
*
* <ul>
* <li>[aaa, aab, aac] < aa < a</li>
* <li>[ba, bc] < b</li>
* <li>[aaa, aab, aac] &lt; aa &lt; a</li>
* <li>[ba, bc] &lt; b</li>
* </ul>
*
* <p>In the case of "[aaa, aab, aac]," the relative order between these

View File

@ -68,7 +68,7 @@ public interface SessionManager {
* @param after the handler factory to insert the first handler after, to ensure a specific order when creating new sessions
*
* @return {@code true} (as specified by {@link Collection#add})
* {@code false} if {@param after} is not registered, or {@param factory} is null
* {@code false} if after is not registered, or factory is null
*/
boolean registerHandler(Handler.Factory<? extends Handler> factory, @Nullable Handler.Factory<? extends Handler> after);

View File

@ -164,7 +164,7 @@ public void appendParentTree(boolean useColors) {
return;
}
List<ProtectedRegion> inheritance = new ArrayList<ProtectedRegion>();
List<ProtectedRegion> inheritance = new ArrayList<>();
ProtectedRegion r = region;
inheritance.add(r);

View File

@ -182,7 +182,7 @@ public void resetState(LocalPlayer player) {
* @param after the handler factory to insert the first handler after, to ensure a specific order when creating new sessions
*
* @return {@code true} (as specified by {@link Collection#add})
* {@code false} if {@param after} is not registered, or {@param factory} is null
* {@code false} if after is not registered, or factory is null
*/
@Override
public boolean registerHandler(Factory<? extends Handler> factory, @Nullable Factory<? extends Handler> after) {