From 07b3adec91002cfa70aa6e6525590686b56d0431 Mon Sep 17 00:00:00 2001 From: bconlon Date: Wed, 5 Aug 2020 13:18:32 -0700 Subject: [PATCH] Config to enable the Sun Altar for all players in multiplayer. --- src/main/java/com/legacy/aether/AetherConfig.java | 8 ++++++++ .../com/legacy/aether/blocks/container/BlockSunAltar.java | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/legacy/aether/AetherConfig.java b/src/main/java/com/legacy/aether/AetherConfig.java index 6dd94ae..6bd1b0e 100644 --- a/src/main/java/com/legacy/aether/AetherConfig.java +++ b/src/main/java/com/legacy/aether/AetherConfig.java @@ -29,6 +29,8 @@ public class AetherConfig { private static int inebriation_id; + private static boolean sun_altar_multiplayer; + public static void init(File location) { File newFile = new File(location + "/aether" + "/AetherI.cfg"); @@ -68,6 +70,8 @@ public class AetherConfig { inebriation_id = config.get("Misc", "Sets the id for the Inebriation effect.", 31).getInt(31); + sun_altar_multiplayer = config.get("Gameplay", "Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer.", false).getBoolean(false); + config.save(); } @@ -139,4 +143,8 @@ public class AetherConfig { { return AetherConfig.inebriation_id; } + + public static boolean sunAltarMultiplayer() { + return AetherConfig.sun_altar_multiplayer; + } } \ No newline at end of file diff --git a/src/main/java/com/legacy/aether/blocks/container/BlockSunAltar.java b/src/main/java/com/legacy/aether/blocks/container/BlockSunAltar.java index 0baf1c5..4744972 100644 --- a/src/main/java/com/legacy/aether/blocks/container/BlockSunAltar.java +++ b/src/main/java/com/legacy/aether/blocks/container/BlockSunAltar.java @@ -75,13 +75,13 @@ public class BlockSunAltar extends Block { if (provider.getIsEternalDay() && provider.getShouldCycleCatchup()) { - if (server != null && ((server.isDedicatedServer() && server.getConfigurationManager().func_152596_g(player.getGameProfile()) || !server.isDedicatedServer()))) + if (server != null && ((server.isDedicatedServer() && (server.getConfigurationManager().func_152596_g(player.getGameProfile()) || AetherConfig.sunAltarMultiplayer()) || !server.isDedicatedServer()))) { Aether.proxy.openSunAltar(); } else if (world.isRemote) { - if (player instanceof EntityPlayerSP && player.canCommandSenderUseCommand(2, "")) + if (player instanceof EntityPlayerSP && (player.canCommandSenderUseCommand(2, "") || AetherConfig.sunAltarMultiplayer())) { Aether.proxy.openSunAltar(); }