This commit is contained in:
MidnightTale 2023-04-12 22:29:42 +07:00
commit 5ca043ae8b

View file

@ -11,8 +11,6 @@ import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import java.util.Objects;
public class FoliaFlow extends JavaPlugin implements Listener { public class FoliaFlow extends JavaPlugin implements Listener {
private final Vector velocity1 = new Vector(0, 0.5, -1); private final Vector velocity1 = new Vector(0, 0.5, -1);
private final Vector velocity2 = new Vector(-1, 0.5, 0); private final Vector velocity2 = new Vector(-1, 0.5, 0);
@ -113,7 +111,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
case 'y' -> relative = loc.getBlock().getRelative(0, (int) Math.signum(max), 0); case 'y' -> relative = loc.getBlock().getRelative(0, (int) Math.signum(max), 0);
case 'z' -> relative = loc.getBlock().getRelative(0, 0, (int) Math.signum(max)); case 'z' -> relative = loc.getBlock().getRelative(0, 0, (int) Math.signum(max));
} }
debug("Moving falling block from location " + loc.toString() + " to location " + Objects.requireNonNull(relative).getLocation()); debug("Moving falling block from location " + loc.toString() + " to location " + relative.getLocation());
return relative; return relative;
} }