This commit is contained in:
MidnightTale 2023-04-13 12:59:59 +07:00
commit 9d7e9be5a9

View file

@ -108,6 +108,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
Location loc = entity.getLocation();
Vector vel = entity.getVelocity();
Block movingTo = getBlockMovingTo(loc, vel);
try {
if(movingTo != null && movingTo.getType() == Material.END_PORTAL){
Location spawnLoc = movingTo.getLocation();
@ -127,14 +128,12 @@ public class FoliaFlow extends JavaPlugin implements Listener {
dummy.setVelocity(dummyVel);
}
} catch (NullPointerException e) {
getServer().getLogger().info("onFallingBlockToBlock erorr (likly chunky it not load)");
}
}
}
Block getBlockMovingTo(Location loc, Vector vel) {
double absMax = 0, max = 0;
char dir = ' ';