Skip to content

Commit

Permalink
Temporary workaround for TheElectronWill/night-config#82
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Jun 1, 2020
1 parent fd49772 commit d570d91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/the_fireplace/clans/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static class GeneralClanSettings {
@Comment("Allow players to be a member of multiple clans at once.")
public boolean allowMultiClanMembership = true;
@Comment("Default clan to put players in when they first join the server. Leave empty for no clan.")
public String serverDefaultClan = "";
// Don't use empty string because night-config's HOCON writer is borked
// https://github.com/TheElectronWill/night-config/issues/82
public String serverDefaultClan = "N/A";
@Comment("Cost of forming a clan. This requires a compatible economy to be installed.")
@RangeDecimal(min=0)
public double formClanCost = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/the_fireplace/clans/logic/PlayerEventLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static void onFirstLogin(UUID playerId) {
Clan serverDefault = ClanCache.getClanByName(Clans.getConfig().getServerDefaultClan());
if(serverDefault != null)
serverDefault.addMember(playerId);
else if(!Clans.getConfig().getServerDefaultClan().equalsIgnoreCase("N/A"))
Clans.getLogger().warn("Invalid server default clan {}, players won't be added to it.", Clans.getConfig().getServerDefaultClan());
}

public static void checkUpdateDefaultClan(EntityPlayer player) {
Expand Down

0 comments on commit d570d91

Please sign in to comment.