Fixed custom woodcutting blocks throwing errors.

This commit is contained in:
GJ 2012-07-09 09:26:22 -04:00
parent a2e342b4fc
commit c567e2714a
2 changed files with 33 additions and 33 deletions

View File

@ -28,6 +28,7 @@ Version 1.3.10-dev
= Fixed custom tools not properly respecting the Ability_Enabled flag.
= Fixed "lower tool" messages still being displayed even when ability messages are disabled.
= Fixed custom blocks not dropping the proper item with Super Breaker when Silk Touch is used
= Fixed custom woodcutting blocks throwing errors.
! Changed the format by which Chunklets are stored to be much smaller, and much faster to load
! Optimized how player placed blocks are tracked

View File

@ -300,9 +300,6 @@ public class WoodCutting {
byte type = block.getData();
Material mat = Material.getMaterial(block.getTypeId());
Tree tree = (Tree) block.getState().getData();
TreeSpecies species = tree.getSpecies();
int randomChance = 1000;
if (player.hasPermission("mcmmo.perks.lucky.woodcutting")) {
@ -329,12 +326,12 @@ public class WoodCutting {
else {
Misc.dropItems(location, item, minimumDropAmount);
}
return;
}
else {
item = new ItemStack(mat, 1, (short) 0, type);
location = block.getLocation();
}
TreeSpecies species = TreeSpecies.getByData(type);
/* Drop the block */
switch (species) {
@ -367,6 +364,7 @@ public class WoodCutting {
}
}
}
}
/**
* Check XP gain for woodcutting.
@ -377,7 +375,6 @@ public class WoodCutting {
public static void woodcuttingBlockCheck(Player player, Block block) {
PlayerProfile profile = Users.getProfile(player);
int xp = 0;
TreeSpecies species = TreeSpecies.getByData(block.getData());
if (mcMMO.placeStore.isTrue(block)) {
return;
@ -387,6 +384,8 @@ public class WoodCutting {
xp = ModChecks.getCustomBlock(block).getXpGain();
}
else {
TreeSpecies species = TreeSpecies.getByData(block.getData());
switch (species) {
case GENERIC:
xp += Config.getInstance().getWoodcuttingXPOak();