|
@@ -87,7 +87,9 @@ public class Herbalism {
|
|
protected static int countAndMarkDoubleDropsMultiBlockPlant(BlockState blockState, boolean triple, HerbalismManager herbalismManager) {
|
|
protected static int countAndMarkDoubleDropsMultiBlockPlant(BlockState blockState, boolean triple, HerbalismManager herbalismManager) {
|
|
Block block = blockState.getBlock();
|
|
Block block = blockState.getBlock();
|
|
Material blockType = blockState.getType();
|
|
Material blockType = blockState.getType();
|
|
- int dropAmount = mcMMO.getPlaceStore().isTrue(block) ? 0 : 1;
|
|
|
|
|
|
+ int dropAmount = 0;
|
|
|
|
+ int bonusDropAmount = 0;
|
|
|
|
+ int bonusAdd = triple ? 2 : 1;
|
|
|
|
|
|
if (blockType == Material.CHORUS_PLANT) {
|
|
if (blockType == Material.CHORUS_PLANT) {
|
|
dropAmount = 1;
|
|
dropAmount = 1;
|
|
@@ -96,6 +98,17 @@ public class Herbalism {
|
|
dropAmount = calculateChorusPlantDrops(block, triple, herbalismManager);
|
|
dropAmount = calculateChorusPlantDrops(block, triple, herbalismManager);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ //Check the block itself first
|
|
|
|
+ if(!mcMMO.getPlaceStore().isTrue(block))
|
|
|
|
+ {
|
|
|
|
+ dropAmount++;
|
|
|
|
+
|
|
|
|
+ if(herbalismManager.checkDoubleDrop(blockState))
|
|
|
|
+ bonusDropAmount+=bonusAdd;
|
|
|
|
+ } else {
|
|
|
|
+ mcMMO.getPlaceStore().setFalse(blockState);
|
|
|
|
+ }
|
|
|
|
+
|
|
// Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally
|
|
// Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally
|
|
for (int y = 1; y < 255; y++) {
|
|
for (int y = 1; y < 255; y++) {
|
|
Block relativeBlock = block.getRelative(BlockFace.UP, y);
|
|
Block relativeBlock = block.getRelative(BlockFace.UP, y);
|
|
@@ -110,11 +123,14 @@ public class Herbalism {
|
|
dropAmount++;
|
|
dropAmount++;
|
|
|
|
|
|
if(herbalismManager.checkDoubleDrop(relativeBlock.getState()))
|
|
if(herbalismManager.checkDoubleDrop(relativeBlock.getState()))
|
|
- BlockUtils.markDropsAsBonus(relativeBlock.getState(), triple);
|
|
|
|
|
|
+ bonusDropAmount+=bonusAdd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //Mark the original block for bonus drops
|
|
|
|
+ BlockUtils.markDropsAsBonus(blockState, bonusDropAmount);
|
|
|
|
+
|
|
return dropAmount;
|
|
return dropAmount;
|
|
}
|
|
}
|
|
|
|
|