Improves button and material customization

Allows specifying a comma-separated list of materials and tags for a portal's button, open-material, closed-material and border blocks. A random value is used if more than one material is available.0
Uses the supplied button if any, instead of enforcing the specified button material.
Always protects the button against block breaking.
Fixes an incorrect permission result in the previous commit, which caused players stargate access to be inverted.
This commit is contained in:
2024-02-20 15:15:52 +01:00
parent b4a6ce1a77
commit a9e5855194
16 changed files with 385 additions and 154 deletions

View File

@@ -409,11 +409,13 @@ public final class PermissionHelper {
}
//Player cannot access portal
if (!PermissionHelper.cannotAccessPortal(player, entrancePortal, destination)) {
if (PermissionHelper.cannotAccessPortal(player, entrancePortal, destination)) {
if (!entrancePortal.getOptions().isSilent()) {
Stargate.getMessageSender().sendErrorMessage(player, Stargate.getString("denyMsg"));
}
new PlayerTeleporter(entrancePortal, player).teleportPlayer(entrancePortal, event);
Stargate.debug("PermissionHelper::playerCannotTeleport", "Closed portal because player is " +
"missing necessary permissions");
entrancePortal.getPortalOpener().closePortal(false);
return true;
}