mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +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) {
|
protected static int calculateCatciAndSugarDrops(BlockState blockState) {
|
||||||
Block block = blockState.getBlock();
|
Block block = blockState.getBlock();
|
||||||
Material blockType = blockState.getType();
|
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
|
// Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally
|
||||||
for (int y = 1; y < 3; y++) {
|
for (int y = 1; y < 3; y++) {
|
||||||
@ -73,7 +73,10 @@ public class Herbalism {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mcMMO.placeStore.isTrue(relativeBlock)) {
|
if (mcMMO.placeStore.isTrue(relativeBlock)) {
|
||||||
|
mcMMO.placeStore.setFalse(relativeBlock);
|
||||||
|
}
|
||||||
|
else {
|
||||||
dropAmount++;
|
dropAmount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,9 @@ public class HerbalismManager extends SkillManager {
|
|||||||
*/
|
*/
|
||||||
public void herbalismBlockCheck(BlockState blockState) {
|
public void herbalismBlockCheck(BlockState blockState) {
|
||||||
Material material = blockState.getType();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +137,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
drop = herbalismBlock.getDropItem();
|
drop = herbalismBlock.getDropItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK) {
|
if (!oneBlockPlant) {
|
||||||
amount = Herbalism.calculateCatciAndSugarDrops(blockState);
|
amount = Herbalism.calculateCatciAndSugarDrops(blockState);
|
||||||
xp *= amount;
|
xp *= amount;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user