mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-28 02:51:44 +01:00
Minor fix for player tab list
This commit is contained in:
parent
9048d0738a
commit
651fbac979
@ -25,7 +25,6 @@ import net.citizensnpcs.api.npc.NPCRegistry;
|
||||
import net.citizensnpcs.api.trait.trait.Owner;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.editor.Editor;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
import net.citizensnpcs.trait.CurrentLocation;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
@ -249,7 +248,7 @@ public class EventListen implements Listener {
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
|
||||
if (!(event.getPlayer() instanceof NPCHolder))
|
||||
if (npcRegistry.getNPC(event.getPlayer()) == null)
|
||||
return;
|
||||
NMS.removeFromServerPlayerList(event.getPlayer());
|
||||
// on teleport, player NPCs are added to the server player list. this is
|
||||
|
@ -89,7 +89,7 @@ public class BlockBreaker extends BehaviorGoalAdapter {
|
||||
startDigTick = currentTick;
|
||||
if (entity instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) entity).getNPC();
|
||||
if (!npc.getNavigator().isNavigating()) {
|
||||
if (npc != null && !npc.getNavigator().isNavigating()) {
|
||||
npc.getNavigator()
|
||||
.setTarget(entity.world.getWorld().getBlockAt(x, y, z).getLocation().add(0, 1, 0));
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
@ -293,7 +294,16 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
if (useListName != this.useListName || this.useListName == -1) {
|
||||
this.useListName = useListName;
|
||||
}
|
||||
boolean sendListPacket = true;
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (player.getName().equalsIgnoreCase(getName())) {
|
||||
sendListPacket = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sendListPacket) {
|
||||
NMS.sendToOnline(getListPacket(removeFromPlayerList));
|
||||
}
|
||||
NMS.sendPacketsNearby(getBukkitEntity(), current, packets);
|
||||
}
|
||||
}
|
||||
|
@ -295,6 +295,8 @@ public class NMS {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void minecartItemLogic(EntityMinecartAbstract minecart) {
|
||||
NPC npc = ((NPCHolder) minecart).getNPC();
|
||||
if (npc == null)
|
||||
return;
|
||||
Material mat = Material.getMaterial(npc.data().get(NPC.MINECART_ITEM_METADATA, ""));
|
||||
int data = npc.data().get(NPC.MINECART_ITEM_DATA_METADATA, 0);
|
||||
int offset = npc.data().get(NPC.MINECART_OFFSET_METADATA, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user