Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚒️ Fix blocks between with minus Y #4647

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/ch/njol/skript/util/BlockLineIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package ch.njol.skript.util;

import ch.njol.skript.bukkitutil.WorldUtils;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.util.BlockIterator;
Expand Down Expand Up @@ -85,7 +86,7 @@ public BlockLineIterator(final Block start, final Vector dir, final double dist)
private static Vector fitInWorld(final Location l, final Vector dir) {
if (0 <= l.getBlockY() && l.getBlockY() < l.getWorld().getMaxHeight())
return l.toVector();
final double y = Math2.fit(0, l.getY(), l.getWorld().getMaxHeight());
final double y = Math2.fit(WorldUtils.getWorldMinHeight(l.getWorld()), l.getY(), l.getWorld().getMaxHeight());
if (Math.abs(dir.getY()) < Skript.EPSILON)
return new Vector(l.getX(), y, l.getZ());
final double dy = y - l.getY();
Expand Down