Gets rid of the rest of the modX and modY usages, and removes some unused code

This commit is contained in:
2021-10-08 18:23:42 +02:00
parent a68dc4b464
commit fff4d8d78b
20 changed files with 150 additions and 279 deletions

View File

@ -125,7 +125,7 @@ public final class BungeeHelper {
Stargate.bungeeQueue.put(playerName.toLowerCase(), destination);
} else {
Portal destinationPortal = PortalHandler.getBungeePortal(destination);
// Specified an invalid gate. For now we'll just let them connect at their current location
// Specified an invalid gate. For now, we'll just let them connect at their current location
if (destinationPortal == null) {
Stargate.logger.info(Stargate.getString("prefix") + "Bungee gate " + destination + " does not exist");
return;

View File

@ -7,7 +7,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.util.Vector;
/**
* This class helps with direction-dependent (modX, modZ) calculations
* This class helps with direction-dependent calculations
*/
public final class DirectionHelper {
@ -81,7 +81,7 @@ public final class DirectionHelper {
} else if (yaw == 270) {
return new Vector(1, 0, 0);
} else {
throw new IllegalArgumentException("Invalid yaw given");
throw new IllegalArgumentException(String.format("Invalid yaw %f given", yaw));
}
}
@ -97,16 +97,6 @@ public final class DirectionHelper {
return topLeft.getRelativeLocation(vector, yaw);
}
/**
* Gets the block at a relative block vector location
*
* @param vector <p>The relative block vector</p>
* @return <p>The block at the given relative position</p>
*/
public static BlockLocation getBlockAt(BlockLocation topLeft, RelativeBlockVector vector, int modX, int modZ) {
return topLeft.modRelative(vector.getRight(), vector.getDepth(), vector.getDistance(), modX, 1, modZ);
}
/**
* Moves a location relatively
*

View File

@ -39,7 +39,7 @@ public final class EconomyHelper {
return false;
}
//Send the deduct message to the player
//Send the deduct-message to the player
sendDeductMessage(entrancePortal.getName(), player, cost);
if (entrancePortal.getGate().getToOwner()) {