Dieser Commit ist enthalten in:
Ursprung
8f1f5c10aa
Commit
ca4c31a353
@ -23,7 +23,6 @@ import com.comphenix.tinyprotocol.Reflection;
|
|||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
import de.steamwar.core.FlatteningWrapper;
|
import de.steamwar.core.FlatteningWrapper;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -49,7 +48,7 @@ public class REntityServer implements Listener {
|
|||||||
|
|
||||||
private static final Class<?> useEntity = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity");
|
private static final Class<?> useEntity = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity");
|
||||||
private static final Reflection.FieldAccessor<Integer> useEntityTarget = Reflection.getField(useEntity, int.class, 0);
|
private static final Reflection.FieldAccessor<Integer> useEntityTarget = Reflection.getField(useEntity, int.class, 0);
|
||||||
private static final Reflection.FieldAccessor<Integer> useEntityAction = Reflection.getField(useEntity, int.class, 1);
|
//private static final Reflection.FieldAccessor<Integer> useEntityAction = Reflection.getField(useEntity, int.class, 1);
|
||||||
|
|
||||||
private final ConcurrentHashMap<Integer, REntity> entityMap = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<Integer, REntity> entityMap = new ConcurrentHashMap<>();
|
||||||
private final HashMap<Long, HashSet<REntity>> entities = new HashMap<>();
|
private final HashMap<Long, HashSet<REntity>> entities = new HashMap<>();
|
||||||
@ -65,10 +64,10 @@ public class REntityServer implements Listener {
|
|||||||
REntity entity = entityMap.get(target);
|
REntity entity = entityMap.get(target);
|
||||||
if (entity == null) return packet;
|
if (entity == null) return packet;
|
||||||
|
|
||||||
EntityAction action = useEntityAction.get(packet) == 1 ? EntityAction.ATTACK : EntityAction.INTERACT;
|
/*EntityAction action = useEntityAction.get(packet) == 1 ? EntityAction.ATTACK : EntityAction.INTERACT;
|
||||||
Bukkit.getScheduler().runTask(Core.getInstance(), () -> {
|
Bukkit.getScheduler().runTask(Core.getInstance(), () -> {
|
||||||
callback.onAction(player, entity, action);
|
callback.onAction(player, entity, action);
|
||||||
});
|
});*/
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren