mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Fixed the Cacti & Sugar Cane fix!
This commit is contained in:
		@@ -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;
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user