Shake has an upper limit of 10 damage (will be configurable in the near future), alchemy ranks adjusted

This commit is contained in:
nossr50
2019-03-26 08:22:39 -07:00
parent 55fb3ed74f
commit 719283177e
5 changed files with 16 additions and 10 deletions

View File

@ -65,18 +65,20 @@ public class BlockListener implements Listener {
if(is.getAmount() <= 0)
continue;
//Extra Protection
if(event.getBlock().getState() instanceof Container)
return;
if(event.getBlock().getState().getMetadata(mcMMO.doubleDropKey).size() > 0)
{
//Extra Protection
if(event.getBlock().getState() instanceof Container)
return;
event.getBlock().getState().removeMetadata(mcMMO.doubleDropKey, plugin);
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
else if(event.getBlock().getState().getMetadata(mcMMO.tripleDropKey).size() > 0)
{
//Extra Protection
if(event.getBlock().getState() instanceof Container)
return;
event.getBlock().getState().removeMetadata(mcMMO.tripleDropKey, plugin);
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);

View File

@ -420,7 +420,7 @@ public class FishingManager extends SkillManager {
}
Misc.dropItem(target.getLocation(), drop);
CombatUtils.dealDamage(target, Math.max(target.getMaxHealth() / 4, 1), EntityDamageEvent.DamageCause.CUSTOM, getPlayer()); // Make it so you can shake a mob no more than 4 times.
CombatUtils.dealDamage(target, Math.min(Math.max(target.getMaxHealth() / 4, 1), 10), EntityDamageEvent.DamageCause.CUSTOM, getPlayer()); // Make it so you can shake a mob no more than 4 times.
applyXpGain(ExperienceConfig.getInstance().getFishingShakeXP(), XPGainReason.PVE);
}
}