Fix an error with the Haste buff not being applied right when getting
the 5th stat point.
This commit is contained in:
parent
c5a992c418
commit
8166be6614
@ -191,7 +191,7 @@ public class PlayerBuffData {
|
|||||||
}
|
}
|
||||||
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0) {
|
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0) {
|
||||||
p.removePotionEffect(PotionEffectType.FAST_DIGGING);
|
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);
|
//p.sendMessage("Health: "+p.getHealth()+"/"+p.getMaxHealth()+" Base HP Level: "+base_hplv);
|
||||||
if (p.getHealth()>p.getMaxHealth()) {
|
if (p.getHealth()>p.getMaxHealth()) {
|
||||||
|
@ -8203,6 +8203,27 @@ implements Listener
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPlace(BlockPlaceEvent e) {
|
public void onBlockPlace(BlockPlaceEvent e) {
|
||||||
Player p = e.getPlayer();
|
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<this.plugin.recycling_center_list.size();l++) {
|
||||||
|
for (int m=0;m<this.plugin.recycling_center_list.get(l).locations.size();m++) {
|
||||||
|
if (this.plugin.recycling_center_list.get(l).locations.get(m).getBlock().equals(p.getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(i,j,k)))) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
p.updateInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (e.getItemInHand().getType()==Material.PUMPKIN) {
|
if (e.getItemInHand().getType()==Material.PUMPKIN) {
|
||||||
if (e.getBlockPlaced().getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(0,-1,0)).getType()==Material.SNOW_BLOCK &&
|
if (e.getBlockPlaced().getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(0,-1,0)).getType()==Material.SNOW_BLOCK &&
|
||||||
e.getBlockPlaced().getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(0,-2,0)).getType()==Material.SNOW_BLOCK) {
|
e.getBlockPlaced().getWorld().getBlockAt(e.getBlockPlaced().getLocation().add(0,-2,0)).getType()==Material.SNOW_BLOCK) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user