From f01ac7e33c7acde28433cf85216d849416a61141 Mon Sep 17 00:00:00 2001 From: LlmDl Date: Fri, 6 Mar 2020 10:43:14 -0600 Subject: [PATCH] Merge pull request #3744 from TownyAdvanced/hotfix/flagwar Hotfix: Fix Flagwar townblock town transfer. --- .../flagwar/listeners/TownyWarCustomListener.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/com/palmergames/bukkit/towny/war/flagwar/listeners/TownyWarCustomListener.java b/src/com/palmergames/bukkit/towny/war/flagwar/listeners/TownyWarCustomListener.java index d67ed0382f..574f25d660 100644 --- a/src/com/palmergames/bukkit/towny/war/flagwar/listeners/TownyWarCustomListener.java +++ b/src/com/palmergames/bukkit/towny/war/flagwar/listeners/TownyWarCustomListener.java @@ -188,17 +188,14 @@ public void onCellWonEvent(CellWonEvent event) { // Defender loses townblock if (TownyWarConfig.isFlaggedTownblockTransfered()) { - // Defender loses townblock - universe.getDataSource().removeTownBlock(townBlock); - // Attacker Claim Automatically try { - List selection = new ArrayList<>(); - selection.add(worldCoord); - TownCommand.checkIfSelectionIsValid(attackingTown, selection, false, 0, false); - new TownClaim(plugin, null, attackingTown, selection, false, true, false).start(); - } catch (TownyException te) { + townBlock.setTown(attackingTown); + TownyUniverse.getInstance().getDataSource().saveTownBlock(townBlock); + } catch (Exception te) { // Couldn't claim it. + TownyMessaging.sendErrorMsg(te.getMessage()); + te.printStackTrace(); } } else {