Skip to content

Commit

Permalink
Merge pull request #73 from Warriorrrr/peacefultown-teleport-config
Browse files Browse the repository at this point in the history
Peacefultown teleport config
  • Loading branch information
Goosius1 authored Jan 27, 2021
2 parents 803312a + 01655d1 commit d5a6aca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void onPlayerUsesTownySpawnCommand(SpawnEvent event) {
return;

// Don't block spawning for residents which belong to the Town, or to neutral towns.
if (destinationTown.hasResident(res) || destinationTown.isNeutral())
if (destinationTown.hasResident(res) || (destinationTown.isNeutral() && SiegeWarSettings.getWarCommonPeacefulTownsPublicSpawning()))
return;

//Block TP if the target town is besieged
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,16 @@ public enum ConfigNodes {
"false",
"",
"# If this setting is true, then peaceful towns can toggle PVP on and off."),
PEACEFUL_TOWNS_PUBLIC_SPAWNING(
"peaceful_towns.public_spawning",
"true",
"",
"# This setting is essential to allow peaceful players to play in their preferred style.",
"# For example, in servers with no war, a peaceful town can create and maintain a nation.",
"# This (usually) gives the town a public /n spawn, an important asset which delivers visitors and shop customers directly to the town.",
"# Also the nation can change allies/enemies, affecting visitors to the public /t spawn of the town (if there is one).",
"# However with SiegeWar, peaceful towns cannot (and must not) be able to maintain a nation",
"# Thus, without this setting, peaceful players would be denied control of a key asset (public spawn in the town) which they could get on other servers, and would be more likely to quit or never join."),

OCCUPIED_TOWNS("occupied_towns",
"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,7 @@ public static double getWarSiegeCapitalCostIncreasePercentage() {
return Settings.getDouble(ConfigNodes.WAR_SIEGE_CAPITAL_SIEGE_COST_INCREASE_PERCENTAGE);
}

public static boolean getWarCommonPeacefulTownsPublicSpawning() {
return Settings.getBoolean(ConfigNodes.PEACEFUL_TOWNS_PUBLIC_SPAWNING);
}
}

0 comments on commit d5a6aca

Please sign in to comment.