Skip to content

Commit

Permalink
Use deprecated setItemInHand for 1.8.8 compat
Browse files Browse the repository at this point in the history
Fixes #89
  • Loading branch information
Techcable committed May 8, 2017
1 parent 628ce02 commit 32f47ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public void initiateEntityPet() {
new BukkitRunnable() {
@Override
public void run() {
getBukkitEntity().getEquipment().setItemInMainHand(new ItemStack(getInitialItemInHand()));
//noinspection deprecation - 1.8.8 compatibility
getBukkitEntity().getEquipment().setItemInHand(new ItemStack(getInitialItemInHand()));
}
}.runTaskLater(EchoPet.getPlugin(), 5L);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ public void run() {
switch (getSkeletonType()) {
case STRAY:
case NORMAL:
getBukkitEntity().getEquipment().setItemInMainHand(new ItemStack(Material.BOW));
//noinspection deprecation - 1.8.8 compatibility
getBukkitEntity().getEquipment().setItemInHand(new ItemStack(Material.BOW));
break;
case WITHER:
getBukkitEntity().getEquipment().setItemInMainHand(new ItemStack(Material.STONE_SWORD));
//noinspection deprecation - 1.8.8 compatibility
getBukkitEntity().getEquipment().setItemInHand(new ItemStack(Material.STONE_SWORD));
break;
default:
throw new AssertionError("Unknown skeleton type: " + getSkeletonType());
Expand Down

0 comments on commit 32f47ac

Please sign in to comment.