distance in y 48.5
This commit is contained in:
parent
866151f1af
commit
2f6cf3536b
1 changed files with 3 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
super.onEnable();
|
super.onEnable();
|
||||||
|
|
||||||
// Get the region scheduler for the server
|
// Get the region scheduler for the server
|
||||||
try {
|
try {
|
||||||
RegionScheduler schedulerblock = getServer().getRegionScheduler();
|
RegionScheduler schedulerblock = getServer().getRegionScheduler();
|
||||||
|
|
@ -61,8 +62,9 @@ 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 centerLoc = new Location(entity.getWorld(), 100, 48.5, 0);
|
||||||
Location loc = entity.getLocation();
|
Location loc = entity.getLocation();
|
||||||
if (loc.getBlockX() == 100 && loc.getBlockY() == 48.5 && loc.getBlockZ() == 0) {
|
if (loc.distance(centerLoc) <= 1) {
|
||||||
// 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)) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue