Don't send offhand on 1.8

This commit is contained in:
MrMicky 2020-04-10 13:57:24 +02:00
parent 1ed374bb3f
commit 89e2a63777
No known key found for this signature in database
GPG Key ID: 03CF90CDE757C478
2 changed files with 10 additions and 4 deletions

View File

@ -97,8 +97,11 @@ public class NPC_v1_8_R2 extends NPCBase {
public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
if (slot == NPCSlot.OFFHAND && !auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
if (slot == NPCSlot.OFFHAND) {
if (!auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
}
return;
}
ItemStack item = getItem(slot);

View File

@ -98,8 +98,11 @@ public class NPC_v1_8_R3 extends NPCBase {
public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
if (slot == NPCSlot.OFFHAND && !auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
if (slot == NPCSlot.OFFHAND) {
if (!auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
}
return;
}
ItemStack item = getItem(slot);