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

@ -134,8 +134,8 @@ public class FishingManager extends SkillManager {
player.playSound(location, SoundAdapter.GHAST_SCREAM, Misc.GHAST_VOLUME, Misc.getGhastPitch());
}
if (player.getItemInHand().getType() == Material.FISHING_ROD) {
player.setItemInHand(null);
if (player.getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
player.getInventory().setItemInMainHand(null);
}
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
@ -491,7 +491,7 @@ public class FishingManager extends SkillManager {
*/
private FishingTreasure getFishingTreasure() {
double diceRoll = Misc.getRandom().nextDouble() * 100;
diceRoll -= getPlayer().getItemInHand().getEnchantmentLevel(Enchantment.LUCK);
diceRoll -= getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
FishingTreasure treasure = null;