Config to enable the Sun Altar for all players in multiplayer.

This commit is contained in:
bconlon 2020-08-05 13:18:32 -07:00
parent 70d243b9bf
commit 07b3adec91
2 changed files with 10 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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();
}