Skip to content

Commit

Permalink
Reconfigure Git Organization and Fix Kick Prompt not Kicking
Browse files Browse the repository at this point in the history
  • Loading branch information
benny-conn committed Jan 27, 2021
1 parent ad2d09e commit 005ec91
Show file tree
Hide file tree
Showing 25 changed files with 3 additions and 143 deletions.
129 changes: 0 additions & 129 deletions TownyMenu/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package net.tolmikarc.townymenu.town.prompt;

import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.exceptions.EmptyTownException;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import net.tolmikarc.townymenu.settings.Localization;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
Expand Down Expand Up @@ -36,16 +32,9 @@ protected boolean isInputValid(ConversationContext context, String input) {
if (!getPlayer(context).hasPermission("towny.command.town.kick"))
return null;

try {
if (input.toLowerCase().equals(Localization.CONFIRM)) {
Town town = resident.getTown();
town.removeResident(resident);
TownyAPI.getInstance().getDataSource().saveTown(town);
TownyAPI.getInstance().getDataSource().saveResident(resident);
tell(Localization.TownConversables.Kick.RESPONSE.replace("{player}", resident.getName()));
}
} catch (EmptyTownException | NotRegisteredException e) {
e.printStackTrace();
if (input.toLowerCase().equals(Localization.CONFIRM)) {
resident.removeTown();
tell(Localization.TownConversables.Kick.RESPONSE.replace("{player}", resident.getName()));
}


Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 005ec91

Please sign in to comment.