mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Fixed custom woodcutting blocks throwing errors.
This commit is contained in:
parent
a2e342b4fc
commit
c567e2714a
@ -28,6 +28,7 @@ Version 1.3.10-dev
|
|||||||
= Fixed custom tools not properly respecting the Ability_Enabled flag.
|
= Fixed custom tools not properly respecting the Ability_Enabled flag.
|
||||||
= Fixed "lower tool" messages still being displayed even when ability messages are disabled.
|
= 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 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
|
! Changed the format by which Chunklets are stored to be much smaller, and much faster to load
|
||||||
! Optimized how player placed blocks are tracked
|
! Optimized how player placed blocks are tracked
|
||||||
|
|
||||||
|
@ -300,9 +300,6 @@ public class WoodCutting {
|
|||||||
byte type = block.getData();
|
byte type = block.getData();
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
Material mat = Material.getMaterial(block.getTypeId());
|
||||||
|
|
||||||
Tree tree = (Tree) block.getState().getData();
|
|
||||||
TreeSpecies species = tree.getSpecies();
|
|
||||||
|
|
||||||
int randomChance = 1000;
|
int randomChance = 1000;
|
||||||
|
|
||||||
if (player.hasPermission("mcmmo.perks.lucky.woodcutting")) {
|
if (player.hasPermission("mcmmo.perks.lucky.woodcutting")) {
|
||||||
@ -329,41 +326,42 @@ public class WoodCutting {
|
|||||||
else {
|
else {
|
||||||
Misc.dropItems(location, item, minimumDropAmount);
|
Misc.dropItems(location, item, minimumDropAmount);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
item = new ItemStack(mat, 1, (short) 0, type);
|
item = new ItemStack(mat, 1, (short) 0, type);
|
||||||
location = block.getLocation();
|
location = block.getLocation();
|
||||||
}
|
|
||||||
|
|
||||||
/* Drop the block */
|
TreeSpecies species = TreeSpecies.getByData(type);
|
||||||
switch (species) {
|
|
||||||
case GENERIC:
|
/* Drop the block */
|
||||||
if (configInstance.getOakDoubleDropsEnabled()) {
|
switch (species) {
|
||||||
Misc.dropItem(location, item);
|
case GENERIC:
|
||||||
|
if (configInstance.getOakDoubleDropsEnabled()) {
|
||||||
|
Misc.dropItem(location, item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case REDWOOD:
|
||||||
|
if (configInstance.getSpruceDoubleDropsEnabled()) {
|
||||||
|
Misc.dropItem(location, item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BIRCH:
|
||||||
|
if (configInstance.getBirchDoubleDropsEnabled()) {
|
||||||
|
Misc.dropItem(location, item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JUNGLE:
|
||||||
|
if (configInstance.getJungleDoubleDropsEnabled()) {
|
||||||
|
Misc.dropItem(location, item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case REDWOOD:
|
|
||||||
if (configInstance.getSpruceDoubleDropsEnabled()) {
|
|
||||||
Misc.dropItem(location, item);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BIRCH:
|
|
||||||
if (configInstance.getBirchDoubleDropsEnabled()) {
|
|
||||||
Misc.dropItem(location, item);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case JUNGLE:
|
|
||||||
if (configInstance.getJungleDoubleDropsEnabled()) {
|
|
||||||
Misc.dropItem(location, item);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -377,7 +375,6 @@ public class WoodCutting {
|
|||||||
public static void woodcuttingBlockCheck(Player player, Block block) {
|
public static void woodcuttingBlockCheck(Player player, Block block) {
|
||||||
PlayerProfile profile = Users.getProfile(player);
|
PlayerProfile profile = Users.getProfile(player);
|
||||||
int xp = 0;
|
int xp = 0;
|
||||||
TreeSpecies species = TreeSpecies.getByData(block.getData());
|
|
||||||
|
|
||||||
if (mcMMO.placeStore.isTrue(block)) {
|
if (mcMMO.placeStore.isTrue(block)) {
|
||||||
return;
|
return;
|
||||||
@ -387,6 +384,8 @@ public class WoodCutting {
|
|||||||
xp = ModChecks.getCustomBlock(block).getXpGain();
|
xp = ModChecks.getCustomBlock(block).getXpGain();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
TreeSpecies species = TreeSpecies.getByData(block.getData());
|
||||||
|
|
||||||
switch (species) {
|
switch (species) {
|
||||||
case GENERIC:
|
case GENERIC:
|
||||||
xp += Config.getInstance().getWoodcuttingXPOak();
|
xp += Config.getInstance().getWoodcuttingXPOak();
|
||||||
|
Loading…
Reference in New Issue
Block a user