You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The money line from the traceback is of course Caused by: java.lang.IllegalArgumentException: Cannot measure distance between survival and hub at org.bukkit.Location.distanceSquared(Location.java:456)
The onPlayerMove() handler has an explicit check to make sure the renderer is in the same world as the player. Except at the point the event fires, the player hasn't actually moved yet, so you're checking against the source of the move. If the player is moving from the world with the renderer to a different one (stepped into a portal), then this check will pass because they are currently in the same world. Except then you're trying to do distance math on the destination of the move, which doesn't work since the destination wasn't in the same world.
The fix is to check the world of the destination instead of the player's current world.
diff --git a/consoles-core/src/main/java/ca/jarcode/consoles/internal/ConsolePixelBuffer.java b/consoles-core/src/main/java/ca/jarcode/consoles/internal/ConsolePixelBuffer.java
index 02e5025..5bbde59 100644
--- a/consoles-core/src/main/java/ca/jarcode/consoles/internal/ConsolePixelBuffer.java+++ b/consoles-core/src/main/java/ca/jarcode/consoles/internal/ConsolePixelBuffer.java@@ -166,7 +166,7 @@ public class ConsolePixelBuffer {
@SuppressWarnings("unused")
public void onPlayerMove(PlayerMoveEvent e) {
boolean last = inside;
- inside = renderer.pos.getWorld() == e.getPlayer().getWorld()+ inside = renderer.pos.getWorld() == e.getTo().getWorld()
&& renderer.pos.distanceSquared(e.getTo()) <= 1280;
// if the player entered the radius, update the painting
if (!last && inside)
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report and fix, I will get this change in once I can get version 1.3 working. I've been incredibly busy with other things and trying to get the native component for Consoles to work has been a chore (if anyone is able to help me with the codebase, that would be great).
The money line from the traceback is of course
Caused by: java.lang.IllegalArgumentException: Cannot measure distance between survival and hub at org.bukkit.Location.distanceSquared(Location.java:456)
The onPlayerMove() handler has an explicit check to make sure the renderer is in the same world as the player. Except at the point the event fires, the player hasn't actually moved yet, so you're checking against the source of the move. If the player is moving from the world with the renderer to a different one (stepped into a portal), then this check will pass because they are currently in the same world. Except then you're trying to do distance math on the destination of the move, which doesn't work since the destination wasn't in the same world.
The fix is to check the world of the destination instead of the player's current world.
The text was updated successfully, but these errors were encountered: