Minor tweaks & fixes. Changed Tree Feller to use custom item drop method

so we fire the event like we're supposed to.
This commit is contained in:
GJ
2012-02-24 11:21:07 -05:00
parent fb35e7dd5d
commit 1cd7181d26
3 changed files with 65 additions and 115 deletions

View File

@ -76,10 +76,10 @@ public class Excavation
Material t = block.getType();
return t == Material.DIRT || t == Material.GRASS || t == Material.SAND || t == Material.GRAVEL || t == Material.CLAY || t == Material.MYCEL || t == Material.SOUL_SAND;
}
public static void excavationProcCheck(Material type, Location loc, Player player)
public static void excavationProcCheck(Block block, Player player)
{
if(LoadProperties.excavationRequiresShovel && !m.isShovel(player.getItemInHand()))
return;
Material type = block.getType();
Location loc = block.getLocation();
PlayerProfile PP = Users.getProfile(player);
int skillLevel = PP.getSkillLevel(SkillType.EXCAVATION);
@ -209,9 +209,9 @@ public class Excavation
{
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
Excavation.excavationProcCheck(block, player);
Excavation.excavationProcCheck(block, player);
Excavation.excavationProcCheck(block, player);
}
if(LoadProperties.spoutEnabled)

View File

@ -126,10 +126,12 @@ public class WoodCutting
}
//Remove the block
x.setData((byte) 0);
x.setType(Material.AIR);
plugin.misc.blockWatchList.remove(x);
//Drop the block
x.getWorld().dropItemNaturally(x.getLocation(), item);
m.mcDropItem(x.getLocation(), item);
//Damage the tool more if the Tree is larger
durabilityLoss++;
@ -146,6 +148,7 @@ public class WoodCutting
//Remove the block
x.setData((byte) 0);
x.setType(Material.AIR);
plugin.misc.blockWatchList.remove(x);
//Damage the tool more if the Tree is larger
durabilityLoss++;