mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 03:04:44 +02:00
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:
@ -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)
|
||||
|
@ -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++;
|
||||
|
Reference in New Issue
Block a user