fix work everywhere
This commit is contained in:
parent
63566b88b1
commit
08dc0189b0
1 changed files with 12 additions and 12 deletions
|
|
@ -62,23 +62,23 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
for (World world : Bukkit.getWorlds()) {
|
for (World world : Bukkit.getWorlds()) {
|
||||||
for (Entity entity : world.getEntities()) {
|
for (Entity entity : world.getEntities()) {
|
||||||
if (entity.getType() == EntityType.FALLING_BLOCK && entity.getWorld().getEnvironment() == World.Environment.THE_END) {
|
if (entity.getType() == EntityType.FALLING_BLOCK && entity.getWorld().getEnvironment() == World.Environment.THE_END) {
|
||||||
//Location loc = entity.getLocation();
|
Location loc = entity.getLocation();
|
||||||
//debug("Falling block spawned at location " + loc);
|
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
|
||||||
// Set the initial velocity of the falling block only if it doesn't have a velocity stored
|
if (!velocitiesMap.containsKey(entity)) {
|
||||||
if (!velocitiesMap.containsKey(entity)) {
|
int index = counter % 4;
|
||||||
int index = counter % 4;
|
counter++;
|
||||||
counter++;
|
Vector velocity = velocities[index];
|
||||||
Vector velocity = velocities[index];
|
entity.setVelocity(velocity);
|
||||||
entity.setVelocity(velocity);
|
velocitiesMap.put(entity, velocity); // Store the velocity in the map
|
||||||
velocitiesMap.put(entity, velocity); // Store the velocity in the map
|
movingBlocks.add(entity.getLocation()); // Add the location to the set
|
||||||
movingBlocks.add(entity.getLocation()); // Add the location to the set
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}), 0L, 1L, TimeUnit.MILLISECONDS);
|
}), 0L, 1L, TimeUnit.MILLISECONDS);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException entity) {
|
||||||
getServer().getLogger().info("AsyncScheduler erorr (likly chunky it not load)");
|
getServer().getLogger().info("AsyncScheduler erorr (likly chunky it not load)");
|
||||||
}
|
}
|
||||||
getServer().getPluginManager().registerEvents(this, this);
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue