SteamWar/SpigotCore
Archiviert
13
0

Fix REntityServer click listener #230

Zusammengeführt
Lixfel hat 4 Commits von REntityCallback nach master 2023-02-23 17:02:28 +01:00 zusammengeführt
Nur Änderungen aus Commit 833e6f5818 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.entity;
import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol;
import de.steamwar.core.Core;
import de.steamwar.core.FlatteningWrapper;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -93,8 +94,11 @@ public class REntityServer implements Listener {
}
public void setCallback(EntityActionListener callback) {
boolean uninitialized = this.callback == null;
this.callback = callback;
TinyProtocol.instance.addFilter(useEntity, filter);
if(uninitialized)
TinyProtocol.instance.addFilter(useEntity, filter);
}
public void addPlayer(Player player) {
@ -261,7 +265,7 @@ public class REntityServer implements Listener {
}
private int viewRadius(Player player) {
return player.getClientViewDistance() / 2;
return FlatteningWrapper.impl.getViewDistance(player) / 2;
}
private long entityToId(REntity entity) {