For v1.2 - Added 1.13 support.

This commit is contained in:
Jitse Boonstra 2018-08-18 14:37:05 +02:00
parent 15335c24f1
commit 1f0fca019b
85 changed files with 356 additions and 29 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
.travis.yml Normal file → Executable file
View File

0
LICENSE.md Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

8
api/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-api</artifactId>
@ -67,6 +67,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms-v1_13_R1</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

0
build.sh Normal file → Executable file
View File

4
commons/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-commons</artifactId>
@ -16,7 +16,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

View File

0
commons/src/main/java/net/jitse/npclib/NPCLib.java Normal file → Executable file
View File

0
commons/src/main/java/net/jitse/npclib/NPCManager.java Normal file → Executable file
View File

View File

0
commons/src/main/java/net/jitse/npclib/api/NPC.java Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -5,8 +5,13 @@
package net.jitse.npclib.nms.holograms;
import com.comphenix.tinyprotocol.Reflection;
import net.minecraft.server.v1_13_R1.EntityArmorStand;
import org.bukkit.Location;
import org.bukkit.Nameable;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftArmorStand;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.util.ArrayList;
@ -26,6 +31,8 @@ public class Hologram {
private Set<Object> destroyPackets = new HashSet<>();
// Classes:
private static final Class<?> CHAT_COMPONENT_TEXT_CLAZZ = Reflection.getMinecraftClass("ChatComponentText");
private static final Class<?> CHAT_BASE_COMPONENT_CLAZZ = Reflection.getMinecraftClass("IChatBaseComponent");
private static final Class<?> ENTITY_ARMOR_STAND_CLAZZ = Reflection.getMinecraftClass("EntityArmorStand");
private static final Class<?> ENTITY_LIVING_CLAZZ = Reflection.getMinecraftClass("EntityLiving");
private static final Class<?> ENTITY_CLAZZ = Reflection.getMinecraftClass("Entity");
@ -40,6 +47,8 @@ public class Hologram {
private static final Class<?> PACKET_CLAZZ = Reflection.getMinecraftClass("Packet");
// Constructors:
private static final Reflection.ConstructorInvoker CHAT_COMPONENT_TEXT_CONSTRUCTOR = Reflection
.getConstructor(CHAT_COMPONENT_TEXT_CLAZZ, String.class);
private static final Reflection.ConstructorInvoker PACKET_PLAY_OUT_SPAWN_ENTITY_LIVING_CONSTRUCTOR = Reflection
.getConstructor(PACKET_PLAY_OUT_SPAWN_ENTITY_LIVING_CLAZZ, ENTITY_LIVING_CLAZZ);
private static final Reflection.ConstructorInvoker PACKET_PLAY_OUT_ENTITY_DESTROY_CONSTRUCTOR = Reflection
@ -52,10 +61,6 @@ public class Hologram {
// Methods:
private static final Reflection.MethodInvoker SET_LOCATION_METHOD = Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setLocation", double.class, double.class, double.class, float.class, float.class);
private static final Reflection.MethodInvoker SET_CUSTOM_NAME_METHOD = Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setCustomName", String.class);
private static final Reflection.MethodInvoker SET_CUSTOM_NAME_VISIBLE_METHOD = Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setCustomNameVisible", boolean.class);
private static final Reflection.MethodInvoker SET_SMALL_METHOD = Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setSmall", boolean.class);
private static final Reflection.MethodInvoker SET_INVISIBLE_METHOD = Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
@ -84,11 +89,19 @@ public class Hologram {
}
public void generatePackets(boolean above1_9_r2) {
public void generatePackets(boolean above1_9_r2, boolean above_1_12_r1) {
Reflection.MethodInvoker gravityMethod = (above1_9_r2 ? Reflection.getMethod(ENTITY_CLAZZ,
"setNoGravity", boolean.class) : Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setGravity", boolean.class));
Reflection.MethodInvoker customNameMethod = (above_1_12_r1 ? Reflection.getMethod(ENTITY_CLAZZ,
"setCustomName", CHAT_BASE_COMPONENT_CLAZZ) : Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setCustomName", String.class));
Reflection.MethodInvoker customNameVisibilityMethod = (above_1_12_r1 ? Reflection.getMethod(ENTITY_CLAZZ,
"setCustomNameVisible", boolean.class) : Reflection.getMethod(ENTITY_ARMOR_STAND_CLAZZ,
"setCustomNameVisible", boolean.class));
Location location = start.clone().add(0, delta * lines.size(), 0);
Class<?> worldClass = worldServer.getClass().getSuperclass();
@ -103,8 +116,8 @@ public class Hologram {
Object entityArmorStand = entityArmorStandConstructor.invoke(worldServer);
SET_LOCATION_METHOD.invoke(entityArmorStand, location.getX(), location.getY(), location.getZ(), 0, 0);
SET_CUSTOM_NAME_METHOD.invoke(entityArmorStand, line);
SET_CUSTOM_NAME_VISIBLE_METHOD.invoke(entityArmorStand, true);
customNameMethod.invoke(entityArmorStand, above_1_12_r1 ? CHAT_COMPONENT_TEXT_CONSTRUCTOR.invoke(line) : line);
customNameVisibilityMethod.invoke(entityArmorStand, true);
gravityMethod.invoke(entityArmorStand, above1_9_r2);
SET_SMALL_METHOD.invoke(entityArmorStand, true);
SET_INVISIBLE_METHOD.invoke(entityArmorStand, true);

View File

0
commons/src/main/java/net/jitse/npclib/skin/Skin.java Normal file → Executable file
View File

3
nms/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms</artifactId>
@ -21,6 +21,7 @@
<module>v1_10_R1</module>
<module>v1_11_R1</module>
<module>v1_12_R1</module>
<module>v1_13_R1</module>
</modules>
<dependencies>

2
nms/v1_10_R1/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_10_R1</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_10_R1 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().subtract(0, 0.5, 0), lines);
hologram.generatePackets(true);
hologram.generatePackets(true, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_11_R1/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_11_R1</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_11_R1 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(true);
hologram.generatePackets(true, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_12_R1/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_12_R1</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_12_R1 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(true);
hologram.generatePackets(true, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

27
nms/v1_13_R1/pom.xml Executable file
View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) 2018 Jitse Boonstra
-->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_13_R1</artifactId>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,105 @@
/*
* Copyright (c) 2018 Jitse Boonstra
*/
package net.jitse.npclib.nms.v1_13_R1;
import net.jitse.npclib.api.NPC;
import net.jitse.npclib.nms.holograms.Hologram;
import net.jitse.npclib.nms.v1_13_R1.packets.PacketPlayOutEntityHeadRotationWrapper;
import net.jitse.npclib.nms.v1_13_R1.packets.PacketPlayOutNamedEntitySpawnWrapper;
import net.jitse.npclib.nms.v1_13_R1.packets.PacketPlayOutPlayerInfoWrapper;
import net.jitse.npclib.nms.v1_13_R1.packets.PacketPlayOutScoreboardTeamWrapper;
import net.jitse.npclib.skin.Skin;
import net.minecraft.server.v1_13_R1.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;
/**
* @author Jitse Boonstra
*/
public class NPC_v1_13_R1 extends NPC {
private Hologram hologram;
private PacketPlayOutNamedEntitySpawn packetPlayOutNamedEntitySpawn;
private PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeamRegister, packetPlayOutScoreboardTeamUnregister;
private PacketPlayOutPlayerInfo packetPlayOutPlayerInfoAdd, packetPlayOutPlayerInfoRemove;
private PacketPlayOutEntityHeadRotation packetPlayOutEntityHeadRotation;
private PacketPlayOutEntityDestroy packetPlayOutEntityDestroy;
public NPC_v1_13_R1(JavaPlugin plugin, Skin skin, double autoHideDistance, List<String> lines) {
super(plugin, skin, autoHideDistance, lines);
}
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(true, true);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
// Packets for spawning the NPC:
this.packetPlayOutScoreboardTeamRegister = new PacketPlayOutScoreboardTeamWrapper()
.createRegisterTeam(name); // First packet to send.
this.packetPlayOutPlayerInfoAdd = packetPlayOutPlayerInfoWrapper
.create(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, gameProfile, name); // Second packet to send.
this.packetPlayOutNamedEntitySpawn = new PacketPlayOutNamedEntitySpawnWrapper()
.create(uuid, location, entityId); // Third packet to send.
this.packetPlayOutEntityHeadRotation = new PacketPlayOutEntityHeadRotationWrapper()
.create(location, entityId); // Fourth packet to send.
this.packetPlayOutPlayerInfoRemove = packetPlayOutPlayerInfoWrapper
.create(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, gameProfile, name); // Fifth packet to send (delayed).
// Packet for destroying the NPC:
this.packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(entityId); // First packet to send.
// Second packet to send is "packetPlayOutPlayerInfoRemove".
this.packetPlayOutScoreboardTeamUnregister = new PacketPlayOutScoreboardTeamWrapper()
.createUnregisterTeam(name); // Third packet to send.
}
@Override
public void sendShowPackets(Player player) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
playerConnection.sendPacket(packetPlayOutScoreboardTeamRegister);
playerConnection.sendPacket(packetPlayOutPlayerInfoAdd);
playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
hologram.spawn(player);
Bukkit.getScheduler().runTaskLater(plugin, () ->
playerConnection.sendPacket(packetPlayOutPlayerInfoRemove), 50);
}
@Override
public void sendHidePackets(Player player, boolean scheduler) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
playerConnection.sendPacket(packetPlayOutEntityDestroy);
playerConnection.sendPacket(packetPlayOutPlayerInfoRemove);
hologram.destroy(player);
if (scheduler) {
// Sending this a bit later so the player doesn't see the name (for that split second).
Bukkit.getScheduler().runTaskLater(plugin, () ->
playerConnection.sendPacket(packetPlayOutScoreboardTeamUnregister), 5);
} else {
playerConnection.sendPacket(packetPlayOutScoreboardTeamUnregister);
}
}
}

View File

@ -0,0 +1,26 @@
/*
* Copyright (c) 2018 Jitse Boonstra
*/
package net.jitse.npclib.nms.v1_13_R1.packets;
import com.comphenix.tinyprotocol.Reflection;
import net.minecraft.server.v1_13_R1.PacketPlayOutEntityHeadRotation;
import org.bukkit.Location;
/**
* @author Jitse Boonstra
*/
public class PacketPlayOutEntityHeadRotationWrapper {
public PacketPlayOutEntityHeadRotation create(Location location, int entityId) {
PacketPlayOutEntityHeadRotation packetPlayOutEntityHeadRotation = new PacketPlayOutEntityHeadRotation();
Reflection.getField(packetPlayOutEntityHeadRotation.getClass(), "a", int.class).
set(packetPlayOutEntityHeadRotation, entityId);
Reflection.getField(packetPlayOutEntityHeadRotation.getClass(), "b", byte.class)
.set(packetPlayOutEntityHeadRotation, (byte) ((int) location.getYaw() * 256.0F / 360.0F));
return packetPlayOutEntityHeadRotation;
}
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2018 Jitse Boonstra
*/
package net.jitse.npclib.nms.v1_13_R1.packets;
import com.comphenix.tinyprotocol.Reflection;
import net.minecraft.server.v1_13_R1.DataWatcher;
import net.minecraft.server.v1_13_R1.DataWatcherObject;
import net.minecraft.server.v1_13_R1.DataWatcherRegistry;
import net.minecraft.server.v1_13_R1.PacketPlayOutNamedEntitySpawn;
import org.bukkit.Location;
import java.util.UUID;
/**
* @author Jitse Boonstra
*/
public class PacketPlayOutNamedEntitySpawnWrapper {
public PacketPlayOutNamedEntitySpawn create(UUID uuid, Location location, int entityId) {
PacketPlayOutNamedEntitySpawn packetPlayOutNamedEntitySpawn = new PacketPlayOutNamedEntitySpawn();
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "a", int.class)
.set(packetPlayOutNamedEntitySpawn, entityId);
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "b", UUID.class)
.set(packetPlayOutNamedEntitySpawn, uuid);
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "c", double.class)
.set(packetPlayOutNamedEntitySpawn, location.getX());
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "d", double.class)
.set(packetPlayOutNamedEntitySpawn, location.getY());
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "e", double.class)
.set(packetPlayOutNamedEntitySpawn, location.getZ());
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "f", byte.class)
.set(packetPlayOutNamedEntitySpawn, (byte) ((int) (location.getYaw() * 256.0F / 360.0F)));
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "g", byte.class)
.set(packetPlayOutNamedEntitySpawn, (byte) ((int) (location.getPitch() * 256.0F / 360.0F)));
DataWatcher dataWatcher = new DataWatcher(null);
dataWatcher.register(new DataWatcherObject<>(13, DataWatcherRegistry.a), (byte) 127);
Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "h", DataWatcher.class)
.set(packetPlayOutNamedEntitySpawn, dataWatcher);
return packetPlayOutNamedEntitySpawn;
}
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018 Jitse Boonstra
*/
package net.jitse.npclib.nms.v1_13_R1.packets;
import com.comphenix.tinyprotocol.Reflection;
import com.mojang.authlib.GameProfile;
import net.minecraft.server.v1_13_R1.EnumGamemode;
import net.minecraft.server.v1_13_R1.IChatBaseComponent;
import net.minecraft.server.v1_13_R1.PacketPlayOutPlayerInfo;
import org.bukkit.ChatColor;
import java.util.List;
/**
* @author Jitse Boonstra
*/
public class PacketPlayOutPlayerInfoWrapper {
private final Class<?> packetPlayOutPlayerInfoClazz = Reflection.getMinecraftClass("PacketPlayOutPlayerInfo");
private final Class<?> playerInfoDataClazz = Reflection.getMinecraftClass("PacketPlayOutPlayerInfo$PlayerInfoData");
private final Reflection.ConstructorInvoker playerInfoDataConstructor = Reflection.getConstructor(playerInfoDataClazz,
packetPlayOutPlayerInfoClazz, GameProfile.class, int.class, EnumGamemode.class, IChatBaseComponent.class);
public PacketPlayOutPlayerInfo create(PacketPlayOutPlayerInfo.EnumPlayerInfoAction action, GameProfile gameProfile, String name) {
PacketPlayOutPlayerInfo packetPlayOutPlayerInfo = new PacketPlayOutPlayerInfo();
Reflection.getField(packetPlayOutPlayerInfo.getClass(), "a", PacketPlayOutPlayerInfo.EnumPlayerInfoAction.class)
.set(packetPlayOutPlayerInfo, action);
Object playerInfoData = playerInfoDataConstructor.invoke(packetPlayOutPlayerInfo,
gameProfile, 1, EnumGamemode.NOT_SET,
IChatBaseComponent.ChatSerializer.b("{\"text\":\"" + ChatColor.BLUE + "[NPC] " + name + "\"}")
);
Reflection.FieldAccessor<List> fieldAccessor = Reflection.getField(packetPlayOutPlayerInfo.getClass(), "b", List.class);
List list = fieldAccessor.get(packetPlayOutPlayerInfo);
list.add(playerInfoData);
fieldAccessor.set(packetPlayOutPlayerInfo, list);
return packetPlayOutPlayerInfo;
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2018 Jitse Boonstra
*/
package net.jitse.npclib.nms.v1_13_R1.packets;
import com.comphenix.tinyprotocol.Reflection;
import net.minecraft.server.v1_13_R1.ChatComponentText;
import net.minecraft.server.v1_13_R1.IChatBaseComponent;
import net.minecraft.server.v1_13_R1.PacketPlayOutScoreboardTeam;
import java.util.Collection;
/**
* @author Jitse Boonstra
*/
public class PacketPlayOutScoreboardTeamWrapper {
public PacketPlayOutScoreboardTeam createRegisterTeam(String name) {
PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeam = new PacketPlayOutScoreboardTeam();
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "i", int.class)
.set(packetPlayOutScoreboardTeam, 0);
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "a", String.class)
.set(packetPlayOutScoreboardTeam, name);
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "b", IChatBaseComponent.class)
.set(packetPlayOutScoreboardTeam, new ChatComponentText(name));
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "e", String.class)
.set(packetPlayOutScoreboardTeam, "never");
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "f", String.class)
.set(packetPlayOutScoreboardTeam, "never");
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "j", int.class)
.set(packetPlayOutScoreboardTeam, 0);
Reflection.FieldAccessor<Collection> collectionFieldAccessor = Reflection.getField(
packetPlayOutScoreboardTeam.getClass(), "h", Collection.class);
Collection collection = collectionFieldAccessor.get(packetPlayOutScoreboardTeam);
collection.add(name);
collectionFieldAccessor.set(packetPlayOutScoreboardTeam, collection);
return packetPlayOutScoreboardTeam;
}
public PacketPlayOutScoreboardTeam createUnregisterTeam(String name) {
PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeam = new PacketPlayOutScoreboardTeam();
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "i", int.class)
.set(packetPlayOutScoreboardTeam, 1);
Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "a", String.class)
.set(packetPlayOutScoreboardTeam, name);
return packetPlayOutScoreboardTeam;
}
}

8
nms/v1_8_R1/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_8_R1</artifactId>
@ -19,5 +19,11 @@
<version>1.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -38,7 +38,7 @@ public class NPC_v1_8_R1 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(false);
hologram.generatePackets(false, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_8_R2/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_8_R2</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_8_R2 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(false);
hologram.generatePackets(false, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_8_R3/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_8_R3</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_8_R3 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().add(0, 0.5, 0), lines);
hologram.generatePackets(false);
hologram.generatePackets(false, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_9_R1/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_9_R1</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_9_R1 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().subtract(0, 0.5, 0), lines);
hologram.generatePackets(false);
hologram.generatePackets(false, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
nms/v1_9_R2/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-nms-v1_9_R2</artifactId>

View File

@ -38,7 +38,7 @@ public class NPC_v1_9_R2 extends NPC {
@Override
public void createPackets() {
this.hologram = new Hologram(location.clone().subtract(0, 0.5, 0), lines);
hologram.generatePackets(false);
hologram.generatePackets(false, false);
this.gameProfile = generateGameProfile(uuid, name);
PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();

2
plugin/pom.xml Normal file → Executable file
View File

@ -7,7 +7,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib</artifactId>
<version>1.1.4</version>
<version>1.2</version>
</parent>
<artifactId>npclib-plugin</artifactId>

View File

0
plugin/src/main/resources/plugin.yml Normal file → Executable file
View File

2
pom.xml Normal file → Executable file
View File

@ -8,7 +8,7 @@
<groupId>net.jitse</groupId>
<artifactId>npclib</artifactId>
<version>1.1.4</version>
<version>1.2</version>
<name>NPCLib</name>
<url>https://github.com/JitseB/npclib</url>