mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 08:09:39 +01:00
Fixed the Cacti & Sugar Cane fix!
This commit is contained in:
parent
d9bd0ace9a
commit
0e2746622d
@ -63,7 +63,7 @@ public class Herbalism {
|
||||
protected static int calculateCatciAndSugarDrops(BlockState blockState) {
|
||||
Block block = blockState.getBlock();
|
||||
Material blockType = blockState.getType();
|
||||
int dropAmount = 1;
|
||||
int dropAmount = mcMMO.placeStore.isTrue(block) ? 0 : 1;
|
||||
|
||||
// Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally
|
||||
for (int y = 1; y < 3; y++) {
|
||||
@ -73,7 +73,10 @@ public class Herbalism {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mcMMO.placeStore.isTrue(relativeBlock)) {
|
||||
if (mcMMO.placeStore.isTrue(relativeBlock)) {
|
||||
mcMMO.placeStore.setFalse(relativeBlock);
|
||||
}
|
||||
else {
|
||||
dropAmount++;
|
||||
}
|
||||
}
|
||||
|
@ -114,8 +114,9 @@ public class HerbalismManager extends SkillManager {
|
||||
*/
|
||||
public void herbalismBlockCheck(BlockState blockState) {
|
||||
Material material = blockState.getType();
|
||||
boolean oneBlockPlant = (material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK) ? false : true;
|
||||
|
||||
if (mcMMO.placeStore.isTrue(blockState) && (material != Material.CACTUS || material != Material.SUGAR_CANE_BLOCK)) {
|
||||
if (oneBlockPlant && mcMMO.placeStore.isTrue(blockState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -136,7 +137,7 @@ public class HerbalismManager extends SkillManager {
|
||||
drop = herbalismBlock.getDropItem();
|
||||
}
|
||||
|
||||
if (material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK) {
|
||||
if (!oneBlockPlant) {
|
||||
amount = Herbalism.calculateCatciAndSugarDrops(blockState);
|
||||
xp *= amount;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user