Removes the temporary ignoreEntrances option and replaces it with proper snowman blocking. Fixes #3

Allows new gates to contain water as underwater gates are a thing now
Adds a check to prevent snowmen from placing snow inside a portal's entrance
Removes the ignoreEntrances option everywhere
This commit is contained in:
2021-10-09 15:09:14 +02:00
parent f87ffc906c
commit 051a6b8f98
7 changed files with 35 additions and 14 deletions

View File

@ -214,16 +214,13 @@ public class Gate {
* @return <p>Whether this is used in the context of creating a new gate</p>
*/
private boolean verifyGateEntrancesMatch(BlockLocation topLeft, double yaw, boolean onCreate) {
if (Stargate.ignoreEntrance) {
return true;
}
Stargate.debug("verifyGateEntrancesMatch", String.valueOf(topLeft));
for (RelativeBlockVector entranceVector : layout.getEntrances()) {
Stargate.debug("verifyGateEntrancesMatch", String.valueOf(entranceVector));
Material type = getBlockAt(topLeft, entranceVector, yaw).getType();
//Ignore entrance if it's air, and we're creating a new gate
if (onCreate && type == Material.AIR) {
//Ignore entrance if it's air or water, and we're creating a new gate
if (onCreate && (type == Material.AIR || type == Material.WATER)) {
continue;
}

View File

@ -52,6 +52,12 @@ public class PortalHandler {
}
/**
* Gets names of all portals within a network
*
* @param network <p>The network to get portals from</p>
* @return <p>A list of portal names</p>
*/
public static List<String> getNetwork(String network) {
return allPortalNetworks.get(network.toLowerCase());
}