Adds more comments, simplifies some code and improves positioning of teleported large entities, like horses

This commit is contained in:
2021-02-27 21:17:36 +01:00
parent 79703e49af
commit ba64572254
3 changed files with 359 additions and 82 deletions

View File

@ -3,6 +3,7 @@ package net.knarcraft.stargate.portal;
import net.knarcraft.stargate.BlockLocation;
import net.knarcraft.stargate.RelativeBlockVector;
import net.knarcraft.stargate.Stargate;
import net.knarcraft.stargate.utility.DirectionHelper;
import net.knarcraft.stargate.utility.EconomyHandler;
import org.bukkit.Material;
@ -271,7 +272,7 @@ public class Gate {
* @return <p>The block at the given relative position</p>
*/
private BlockLocation getBlockAt(BlockLocation topLeft, RelativeBlockVector vector, int modX, int modZ) {
return topLeft.modRelative(vector.getRight(), vector.getDepth(), vector.getDistance(), modX, 1, modZ);
return DirectionHelper.getBlockAt(topLeft, vector, modX, modZ);
}
/**