Permalink
Browse files

Hopefully fixed casting issue for Block Break event (not tested)

  • Loading branch information...
1 parent 08dfe2c commit 06f81123ed72dbf415803fc62710064fa044b259 @atlan1 committed Apr 17, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 Guns+/src/team/GunsPlus/Util/GunUtils.java
@@ -377,7 +377,7 @@ public static void performEffects(HashSet<LivingEntity> targets, SpoutPlayer pla
Bukkit.getServer().getPluginManager().callEvent(new GunEffectEvent(player, gun, eff));
break;
case BREAK:
- if(MaterialData.getBlock(loc_tar.getBlock().getTypeId()).getHardness()<(Integer) eff.getArgument("POTENCY")){
+ if(MaterialData.getBlock(loc_tar.getBlock().getTypeId()).getHardness()<(Float) eff.getArgument("POTENCY")){
loc_tar.getBlock().setTypeId(0);
Bukkit.getServer().getPluginManager().callEvent(new BlockBreakEvent(loc_tar.getBlock(), player));
}
@@ -426,7 +426,7 @@ public static void performEffects(HashSet<LivingEntity> targets, SpoutPlayer pla
Bukkit.getServer().getPluginManager().callEvent(new GunEffectEvent(player, gun, eff));
break;
case BREAK:
- if(MaterialData.getBlock(loc_tar.getBlock().getTypeId()).getHardness()<(Integer) eff.getArgument("POTENCY")){
+ if(MaterialData.getBlock(loc_tar.getBlock().getTypeId()).getHardness()<(Float) eff.getArgument("POTENCY")){
loc_tar.getBlock().setTypeId(0);
Bukkit.getServer().getPluginManager().callEvent(new BlockBreakEvent(loc_tar.getBlock(), player));
}
@@ -547,7 +547,7 @@ public static void performEffects(HashSet<LivingEntity> targets, SpoutPlayer pla
loop = true;
while(bi.hasNext()&&loop){
Block b = bi.next();
- if(MaterialData.getBlock(b.getTypeId()).getHardness()<(Integer)eff.getArgument("POTENCY")){
+ if(MaterialData.getBlock(b.getTypeId()).getHardness()<(Float)eff.getArgument("POTENCY")){
b.setTypeId(0);
Bukkit.getServer().getPluginManager().callEvent(new BlockBreakEvent(loc_tar.getBlock(), player));
}else{

0 comments on commit 06f8112

Please sign in to comment.