Skip to content

Commit

Permalink
- Fix Towny moving Citizens NPCs to server spawn when Towny loads in
Browse files Browse the repository at this point in the history
safe mode.
    - Closes #3760.
  • Loading branch information
LlmDl committed Mar 10, 2020
1 parent 6e967b5 commit 8102deb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4242,4 +4242,6 @@ v0.92.0.11:
- Remove redundant arraylist creation for tab-completion, courtesy of silverwolfg11 with #3756.
- Fix revert-on-unclaim not respecting the PlotManagementSpeed set in the config.
- Closes #3759.
- Fix Towny safe-mode induced via /ta reload still allowing Towny commands to be used.
- Fix Towny safe-mode induced via /ta reload still allowing Towny commands to be used.
- Fix Towny moving Citizens NPCs to server spawn when Towny loads in safe mode.
- Closes #3760.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import com.palmergames.bukkit.towny.war.flagwar.TownyWarConfig;
import com.palmergames.bukkit.util.ChatTools;
import com.palmergames.bukkit.util.Colors;

import net.citizensnpcs.api.CitizensAPI;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
Expand Down Expand Up @@ -92,7 +95,11 @@ public void onPlayerJoin(PlayerJoinEvent event) {
player.sendMessage(Colors.Rose + "[Towny Error] Locked in Safe mode!");
return;
}

// Citizens were being moved to the server spawn when a server was in safe mode, this solves that.
if (plugin.isCitizens2())
if (!CitizensAPI.getNPCRegistry().isNPC(player))
return;

TownyUniverse.getInstance().onLogin(player);
}

Expand Down

0 comments on commit 8102deb

Please sign in to comment.