Increased version number

This commit is contained in:
MCMDEV
2020-07-14 15:37:17 +02:00
parent 919cfa5e5e
commit a984f6ddec
29 changed files with 125 additions and 24 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
<parent>
<groupId>net.jitse</groupId>
<artifactId>npclib-nms</artifactId>
<version>2.8-SNAPSHOT</version>
<version>2.9-SNAPSHOT</version>
</parent>
<artifactId>npclib-nms-v1_8_R3</artifactId>
@@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.jitse.npclib.NPCLib;
import net.jitse.npclib.api.skin.Skin;
import net.jitse.npclib.api.state.NPCAnimation;
import net.jitse.npclib.api.state.NPCSlot;
import net.jitse.npclib.hologram.Hologram;
import net.jitse.npclib.internal.MinecraftVersion;
@@ -115,6 +116,18 @@ public class NPC_v1_8_R3 extends NPCBase {
playerConnection.sendPacket(packet);
}
@Override
public void sendAnimationPacket(Player player, NPCAnimation animation) {
if(animation == NPCAnimation.SWING_OFFHAND) {
throw new IllegalArgumentException("Offhand Swing Animations are only available on 1.9 and up.");
}
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
PacketPlayOutAnimation packet = new PacketPlayOutAnimationWrapper().create(animation, entityId);
playerConnection.sendPacket(packet);
}
@Override
public void updateSkin(Skin skin) {
GameProfile newProfile = new GameProfile(uuid, name);
@@ -7,15 +7,12 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
public class PacketPlayOutAnimationWrapper {
public PacketPlayOutAnimation create(NPCAnimation npcAnimation, int entityId) {
int id = npcAnimation.getId();
if(id == 3) throw new IllegalArgumentException("Offhand Swing Animations are only available on 1.9 and up.");
PacketPlayOutAnimation packetPlayOutAnimation = new PacketPlayOutAnimation();
Reflection.getField(packetPlayOutAnimation.getClass(), "a", int.class)
.set(packetPlayOutAnimation, entityId);
Reflection.getField(packetPlayOutAnimation.getClass(), "b", int.class)
.set(packetPlayOutAnimation, id);
.set(packetPlayOutAnimation, npcAnimation.getId());
return packetPlayOutAnimation;
}