Minor bug fixes (incl. fix for #17)
This commit is contained in:
parent
a7026134e0
commit
2982a1ecb3
|
@ -85,7 +85,7 @@ public abstract class TinyProtocol {
|
|||
logger.info("Attempting to inject into netty");
|
||||
registerChannelHandler();
|
||||
registerPlayers(plugin);
|
||||
} catch (IllegalArgumentException exceptionx) {
|
||||
} catch (IllegalArgumentException exception) {
|
||||
// Damn you, late bind
|
||||
logger.log(Level.WARNING, "Attempting to delay injection");
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ public abstract class NPC implements PacketHandler, ActionHandler {
|
|||
|
||||
shown.add(player.getUniqueId());
|
||||
|
||||
if (player.getLocation().distance(location) <= autoHideDistance) {
|
||||
if (player.getWorld().equals(location.getWorld()) && player.getLocation().distance(location) <= autoHideDistance) {
|
||||
sendShowPackets(player);
|
||||
} else {
|
||||
autoHidden.add(player.getUniqueId());
|
||||
|
|
|
@ -73,7 +73,8 @@ public class PlayerListener implements Listener {
|
|||
// This will cause issues otherwise (e.g. custom skin disappearing).
|
||||
double hideDistance = npc.getAutoHideDistance();
|
||||
double distanceSquared = player.getLocation().distanceSquared(npc.getLocation());
|
||||
boolean inRange = distanceSquared <= (hideDistance * hideDistance) && distanceSquared <= (Bukkit.getViewDistance() << 4);
|
||||
boolean inRange = distanceSquared <= (Math.pow(hideDistance, 2))
|
||||
&& distanceSquared <= (Math.pow(Bukkit.getViewDistance() << 4, 2));
|
||||
if (npc.getAutoHidden().contains(player.getUniqueId())) {
|
||||
// Check if the player and NPC are within the range to sendShowPackets it again.
|
||||
if (inRange) {
|
||||
|
|
Loading…
Reference in New Issue