mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
Replaced WorldListener Bukkit schedular
This commit is contained in:
parent
e23e8d3884
commit
760e610226
@ -12,6 +12,8 @@ import org.bukkit.event.world.ChunkUnloadEvent;
|
|||||||
import org.bukkit.event.world.StructureGrowEvent;
|
import org.bukkit.event.world.StructureGrowEvent;
|
||||||
import org.bukkit.event.world.WorldUnloadEvent;
|
import org.bukkit.event.world.WorldUnloadEvent;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class WorldListener implements Listener {
|
public class WorldListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
@ -30,11 +32,12 @@ public class WorldListener implements Listener {
|
|||||||
if(WorldBlacklist.isWorldBlacklisted(event.getWorld()))
|
if(WorldBlacklist.isWorldBlacklisted(event.getWorld()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> {
|
// Using 50 ms later as I do not know of a way to run one tick later (safely)
|
||||||
|
plugin.getFoliaLib().getImpl().runLater(() -> {
|
||||||
for (BlockState blockState : event.getBlocks()) {
|
for (BlockState blockState : event.getBlocks()) {
|
||||||
mcMMO.getPlaceStore().setFalse(blockState);
|
mcMMO.getPlaceStore().setFalse(blockState);
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 50, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user