From 8166be66148c3c47a1f0a98b43f871810a76d8c4 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Wed, 20 Nov 2013 16:33:50 -0700 Subject: [PATCH] Fix an error with the Haste buff not being applied right when getting the 5th stat point. --- .../src/me/kaZep/Base/PlayerBuffData.java | 2 +- .../src/me/kaZep/Base/PlayerListener.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java b/BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java index 67e3d96..f1d126c 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java @@ -191,7 +191,7 @@ public class PlayerBuffData { } if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0) { p.removePotionEffect(PotionEffectType.FAST_DIGGING); - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING,399,this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/4)/20-1)); + p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING,399,this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)/20-1)); } //p.sendMessage("Health: "+p.getHealth()+"/"+p.getMaxHealth()+" Base HP Level: "+base_hplv); if (p.getHealth()>p.getMaxHealth()) { diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index ba6b8d4..748895e 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -8203,6 +8203,27 @@ implements Listener @EventHandler public void onBlockPlace(BlockPlaceEvent e) { Player p = e.getPlayer(); + if (e.getItemInHand().getType()==Material.HOPPER) { + //Check surrounding blocks to verify it's not a chest. + for (int i=-1;i<2;i++) { + for (int j=0;j<2;j++) { + for (int k=-1;k<2;k++) { + if (p.getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(i,j,k)).getType()==Material.CHEST) { + //Check to see if it's a recycling center chest. + for (int l=0;l