Text update function working on v1.8 R1!

This commit is contained in:
Jitse Boonstra
2019-10-28 20:10:47 +01:00
parent 3dceca16b9
commit d9558eef63
5 changed files with 72 additions and 64 deletions
@@ -13,6 +13,7 @@ import net.jitse.npclib.api.events.NPCShowEvent;
import net.jitse.npclib.api.skin.Skin;
import net.jitse.npclib.api.state.NPCSlot;
import net.jitse.npclib.api.state.NPCState;
import net.jitse.npclib.hologram.Hologram;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
@@ -39,6 +40,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
protected List<String> text;
protected Location location;
protected Skin skin;
protected Hologram hologram;
// offHand support in 1.9 R1 and later.
protected ItemStack helmet, chestplate, leggings, boots, inHand, offHand;
@@ -304,7 +306,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
for (UUID shownUuid : shown) {
Player player = Bukkit.getPlayer(shownUuid);
if (player != null && isShown(player)) {
sendTextUpdatePackets(this.text, text, player);
hologram.updateText(text);
}
}
this.text = text;