Don't send offhand on 1.8
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user