Mangrove trees are now properly marked natural from growth

Fixes #4810
This commit is contained in:
nossr50 2022-08-07 15:54:22 -07:00
parent 032a407c8a
commit fb738d85f6
2 changed files with 17 additions and 10 deletions

View File

@ -844,13 +844,14 @@ public class PlayerListener implements Listener {
if(!event.isCancelled() || event.useInteractedBlock() != Event.Result.DENY) {
//TODO: Is this code to set false from bone meal even needed? I'll have to double check later.
if (heldItem.getType() == Material.BONE_MEAL) {
switch (blockState.getType()) {
case BEETROOTS:
case CARROT:
case COCOA:
case WHEAT:
case NETHER_WART_BLOCK:
case POTATO:
switch (blockState.getType().toString()) {
case "BEETROOTS":
case "CARROT":
case "COCOA":
case "WHEAT":
case "NETHER_WART_BLOCK":
case "POTATO":
case "MANGROVE_PROPAGULE":
mcMMO.getPlaceStore().setFalse(blockState);
break;
}

View File

@ -1,7 +1,10 @@
package com.gmail.nossr50.listeners;
import com.gmail.nossr50.config.WorldBlacklist;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.block.BlockState;
import org.bukkit.event.EventHandler;
@ -10,6 +13,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class WorldListener implements Listener {
private final mcMMO plugin;
@ -29,9 +33,11 @@ public class WorldListener implements Listener {
if(WorldBlacklist.isWorldBlacklisted(event.getWorld()))
return;
Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> {
for (BlockState blockState : event.getBlocks()) {
mcMMO.getPlaceStore().setFalse(blockState);
}
}, 1);
}
/**