tweak
This commit is contained in:
parent
0561f864a8
commit
625f38dcff
1 changed files with 9 additions and 0 deletions
|
|
@ -24,6 +24,12 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
private int counter = 0;
|
private int counter = 0;
|
||||||
private final Set<Location> movingBlocks = new HashSet<>();
|
private final Set<Location> movingBlocks = new HashSet<>();
|
||||||
|
|
||||||
|
public void Remove1blockinEnd() {
|
||||||
|
World WorldEnd = Bukkit.getServer().getWorld("world_the_end");
|
||||||
|
Location LocationEnd = new Location(WorldEnd,100,48,0);
|
||||||
|
WorldEnd.getBlockAt(LocationEnd).setType(Material.AIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -73,6 +79,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
dummyVel.add(new Vector(0, 1, 0));
|
dummyVel.add(new Vector(0, 1, 0));
|
||||||
|
|
||||||
dummy.setVelocity(dummyVel);
|
dummy.setVelocity(dummyVel);
|
||||||
|
Remove1blockinEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,6 +88,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onFallingBlockSpawn(EntitySpawnEvent e) {
|
public void onFallingBlockSpawn(EntitySpawnEvent e) {
|
||||||
if (e.getEntityType() == EntityType.FALLING_BLOCK && e.getEntity().getWorld().getEnvironment() == World.Environment.THE_END) {
|
if (e.getEntityType() == EntityType.FALLING_BLOCK && e.getEntity().getWorld().getEnvironment() == World.Environment.THE_END) {
|
||||||
|
Remove1blockinEnd();
|
||||||
Entity entity = e.getEntity();
|
Entity entity = e.getEntity();
|
||||||
Location loc = entity.getLocation();
|
Location loc = entity.getLocation();
|
||||||
|
|
||||||
|
|
@ -91,6 +99,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
counter ++;
|
counter ++;
|
||||||
Vector velocity = velocities[index];
|
Vector velocity = velocities[index];
|
||||||
entity.setVelocity(velocity);
|
entity.setVelocity(velocity);
|
||||||
|
Remove1blockinEnd();
|
||||||
|
|
||||||
// Remove the block from the movingBlocks set after a delay, to prevent it from being immediately moved again
|
// Remove the block from the movingBlocks set after a delay, to prevent it from being immediately moved again
|
||||||
getServer().getScheduler().runTaskLater(this, () -> movingBlocks.remove(loc.getBlock().getLocation()), 20L);
|
getServer().getScheduler().runTaskLater(this, () -> movingBlocks.remove(loc.getBlock().getLocation()), 20L);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue