potential feature for per-player hologram names
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_10_R1</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_10_R1 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_10_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_10_R1, location.clone().subtract(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +89,7 @@ public class NPC_v1_10_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_11_R1</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_11_R1 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_11_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_11_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +89,7 @@ public class NPC_v1_11_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_12_R1</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_12_R1 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_12_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_12_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +89,7 @@ public class NPC_v1_12_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_13_R1</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_13_R1 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_13_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_13_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +89,7 @@ public class NPC_v1_13_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_13_R2</artifactId>
|
||||
|
||||
@@ -37,10 +37,24 @@ public class NPC_v1_13_R2 extends NPCBase {
|
||||
public NPC_v1_13_R2(NPCLib instance, List<String> lines) {
|
||||
super(instance, lines);
|
||||
}
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_13_R2, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_13_R2, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +88,7 @@ public class NPC_v1_13_R2 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_14_R1</artifactId>
|
||||
|
||||
@@ -33,10 +33,24 @@ public class NPC_v1_14_R1 extends NPCBase {
|
||||
public NPC_v1_14_R1(NPCLib instance, List<String> lines) {
|
||||
super(instance, lines);
|
||||
}
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_14_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_14_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -70,7 +84,7 @@ public class NPC_v1_14_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_15_R1</artifactId>
|
||||
|
||||
@@ -33,10 +33,24 @@ public class NPC_v1_15_R1 extends NPCBase {
|
||||
public NPC_v1_15_R1(NPCLib instance, List<String> lines) {
|
||||
super(instance, lines);
|
||||
}
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_15_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_15_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -71,7 +85,7 @@ public class NPC_v1_15_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
sendMetadataPacket(player);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_16_R1</artifactId>
|
||||
|
||||
@@ -36,10 +36,24 @@ public class NPC_v1_16_R1 extends NPCBase {
|
||||
public NPC_v1_16_R1(NPCLib instance, List<String> lines) {
|
||||
super(instance, lines);
|
||||
}
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_16_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_15_R1, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +88,7 @@ public class NPC_v1_16_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
sendMetadataPacket(player);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_8_R2</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_8_R2 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_8_R2, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_8_R2, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -64,6 +79,7 @@ public class NPC_v1_8_R2 extends NPCBase {
|
||||
this.packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(entityId); // First packet to send.
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendShowPackets(Player player) {
|
||||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
@@ -74,7 +90,7 @@ public class NPC_v1_8_R2 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_8_R3</artifactId>
|
||||
|
||||
@@ -38,9 +38,23 @@ public class NPC_v1_8_R3 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_8_R3, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_8_R3, location.clone().add(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +88,7 @@ public class NPC_v1_8_R3 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_9_R1</artifactId>
|
||||
|
||||
@@ -38,9 +38,24 @@ public class NPC_v1_9_R1 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_9_R1, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_9_R1, location.clone().subtract(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +89,7 @@ public class NPC_v1_9_R1 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>net.jitse</groupId>
|
||||
<artifactId>npclib-nms</artifactId>
|
||||
<version>2.9-SNAPSHOT</version>
|
||||
<version>2.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>npclib-nms-v1_9_R2</artifactId>
|
||||
|
||||
@@ -38,9 +38,25 @@ public class NPC_v1_9_R2 extends NPCBase {
|
||||
super(instance, lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hologram getPlayerHologram(Player player) {
|
||||
Hologram holo = super.getPlayerHologram(player);
|
||||
if (holo == null){
|
||||
holo = new Hologram(MinecraftVersion.V1_9_R2, location.clone().add(0, 0.5, 0), getPlayerLines(player));
|
||||
}
|
||||
super.textDisplayHolograms.put(player.getUniqueId(), holo);
|
||||
return holo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void createPackets() {
|
||||
this.hologram = new Hologram(MinecraftVersion.V1_9_R2, location.clone().subtract(0, 0.5, 0), text);
|
||||
Bukkit.getOnlinePlayers().forEach(this::createPackets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPackets(Player player) {
|
||||
|
||||
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
|
||||
|
||||
@@ -74,7 +90,7 @@ public class NPC_v1_9_R2 extends NPCBase {
|
||||
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
|
||||
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
|
||||
|
||||
hologram.show(player);
|
||||
getPlayerHologram(player).show(player);
|
||||
|
||||
// Removing the player info after 10 seconds.
|
||||
Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
|
||||
|
||||
Reference in New Issue
Block a user