Splits the portal class into Portal, PortalActivator, PortalOpener and PortalStructure

PortalStructure now contains information about the gate's physical structure, such as the location of border blocks, the location of entrances, the gate type and the button location.
PortalActivator is responsible for activating/de-activating portals, destination toggling and getting information about available destinations.
PortalOpener is responsible for opening/closing a portal. It's also the place to go for checking if the portal is open for a given player.
Comments of the Portal class have been improved, but the comments of the three new classes need fixing.
This commit is contained in:
2021-10-20 16:09:35 +02:00
parent 635d08b1b3
commit d2e8c81a5a
13 changed files with 749 additions and 574 deletions

View File

@ -35,7 +35,7 @@ public final class EconomyHelper {
// Insufficient Funds
if (!success) {
sendInsufficientFundsMessage(entrancePortal.getName(), player, cost);
entrancePortal.close(false);
entrancePortal.getPortalOpener().closePortal(false);
return true;
}