fix work everywhere

This commit is contained in:
MidnightTale 2023-04-13 14:42:55 +07:00
commit 08dc0189b0

View file

@ -62,9 +62,8 @@ public class FoliaFlow extends JavaPlugin implements Listener {
for (World world : Bukkit.getWorlds()) {
for (Entity entity : world.getEntities()) {
if (entity.getType() == EntityType.FALLING_BLOCK && entity.getWorld().getEnvironment() == World.Environment.THE_END) {
//Location loc = entity.getLocation();
//debug("Falling block spawned at location " + loc);
Location loc = entity.getLocation();
if (loc.getBlockX() == 100 && loc.getBlockY() == 49 && loc.getBlockZ() == 0) {
// Set the initial velocity of the falling block only if it doesn't have a velocity stored
if (!velocitiesMap.containsKey(entity)) {
int index = counter % 4;
@ -77,8 +76,9 @@ public class FoliaFlow extends JavaPlugin implements Listener {
}
}
}
}
}), 0L, 1L, TimeUnit.MILLISECONDS);
} catch (NullPointerException e) {
} catch (NullPointerException entity) {
getServer().getLogger().info("AsyncScheduler erorr (likly chunky it not load)");
}
getServer().getPluginManager().registerEvents(this, this);