Use getItemInMainHand()

Add 1.9 blocks to be detected for experience rewards.
Add experience rewards for the Chorus plant.
Add experience rewards for the Shulker mob.
This commit is contained in:
Dor
2016-03-11 16:20:23 +02:00
parent 2d3d11ec2d
commit a557fc7d3c
26 changed files with 145 additions and 67 deletions

View File

@ -257,7 +257,7 @@ public class TamingManager extends SkillManager {
private void callOfTheWild(EntityType type, int summonAmount) {
Player player = getPlayer();
ItemStack heldItem = player.getItemInHand();
ItemStack heldItem = player.getInventory().getItemInMainHand();
int heldItemAmount = heldItem.getAmount();
Location location = player.getLocation();
@ -326,7 +326,7 @@ public class TamingManager extends SkillManager {
ParticleEffectUtils.playCallOfTheWildEffect(entity);
}
player.setItemInHand(heldItemAmount == summonAmount ? null : new ItemStack(heldItem.getType(), heldItemAmount - summonAmount));
player.getInventory().setItemInMainHand(heldItemAmount == summonAmount ? null : new ItemStack(heldItem.getType(), heldItemAmount - summonAmount));
String lifeSpan = "";
if (tamingCOTWLength > 0) {