Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peacefultown teleport config #73

Merged
merged 3 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}