mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-21 20:56:45 +01:00
parent
032a407c8a
commit
fb738d85f6
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
for (BlockState blockState : event.getBlocks()) {
|
||||
mcMMO.getPlaceStore().setFalse(blockState);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> {
|
||||
for (BlockState blockState : event.getBlocks()) {
|
||||
mcMMO.getPlaceStore().setFalse(blockState);
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user