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
2 changed files with 10 additions and 4 deletions
@@ -97,9 +97,12 @@ public class NPC_v1_8_R2 extends NPCBase {
public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) { public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection; PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
if (slot == NPCSlot.OFFHAND && !auto) { if (slot == NPCSlot.OFFHAND) {
if (!auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9"); throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
} }
return;
}
ItemStack item = getItem(slot); ItemStack item = getItem(slot);
@@ -98,9 +98,12 @@ public class NPC_v1_8_R3 extends NPCBase {
public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) { public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) {
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection; PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
if (slot == NPCSlot.OFFHAND && !auto) { if (slot == NPCSlot.OFFHAND) {
if (!auto) {
throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9"); throw new UnsupportedOperationException("Offhand is not supported on servers below 1.9");
} }
return;
}
ItemStack item = getItem(slot); ItemStack item = getItem(slot);