mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-22 09:08:05 +01:00
Support name changing with UUIDs
This commit is contained in:
parent
a31d435809
commit
9917f81c1c
@ -10,6 +10,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import me.blackvein.quests.prompts.ItemStackPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
@ -46,12 +47,12 @@ import org.bukkit.potion.PotionEffectType;
|
||||
public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
|
||||
Quests quests;
|
||||
Map<Player, Quest> editSessions = new HashMap<Player, Quest>();
|
||||
Map<Player, Block> selectedExplosionLocations = new HashMap<Player, Block>();
|
||||
Map<Player, Block> selectedEffectLocations = new HashMap<Player, Block>();
|
||||
Map<Player, Block> selectedMobLocations = new HashMap<Player, Block>();
|
||||
Map<Player, Block> selectedLightningLocations = new HashMap<Player, Block>();
|
||||
Map<Player, Block> selectedTeleportLocations = new HashMap<Player, Block>();
|
||||
Map<UUID, Quest> editSessions = new HashMap<UUID, Quest>();
|
||||
Map<UUID, Block> selectedExplosionLocations = new HashMap<UUID, Block>();
|
||||
Map<UUID, Block> selectedEffectLocations = new HashMap<UUID, Block>();
|
||||
Map<UUID, Block> selectedMobLocations = new HashMap<UUID, Block>();
|
||||
Map<UUID, Block> selectedLightningLocations = new HashMap<UUID, Block>();
|
||||
Map<UUID, Block> selectedTeleportLocations = new HashMap<UUID, Block>();
|
||||
List<String> names = new LinkedList<String>();
|
||||
ConversationFactory convoCreator;
|
||||
File eventsFile;
|
||||
@ -724,7 +725,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
|
||||
} else if (input.equalsIgnoreCase("6")) {
|
||||
|
||||
selectedExplosionLocations.put((Player) context.getForWhom(), null);
|
||||
selectedExplosionLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new ExplosionPrompt();
|
||||
|
||||
} else if (input.equalsIgnoreCase("7")) {
|
||||
@ -745,7 +746,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
|
||||
} else if (input.equalsIgnoreCase("11")) {
|
||||
|
||||
selectedLightningLocations.put((Player) context.getForWhom(), null);
|
||||
selectedLightningLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new LightningPrompt();
|
||||
|
||||
} else if (input.equalsIgnoreCase("12")) {
|
||||
@ -766,7 +767,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
|
||||
} else if (input.equalsIgnoreCase("16")) {
|
||||
|
||||
selectedTeleportLocations.put((Player) context.getForWhom(), null);
|
||||
selectedTeleportLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new TeleportPrompt();
|
||||
|
||||
} else if (input.equalsIgnoreCase("17")) {
|
||||
@ -1524,7 +1525,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustAddEffects"));
|
||||
return new EffectListPrompt();
|
||||
} else {
|
||||
selectedEffectLocations.put((Player) context.getForWhom(), null);
|
||||
selectedEffectLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new EffectLocationPrompt();
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
@ -2085,7 +2086,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
} else if (input.equalsIgnoreCase("2")) {
|
||||
return new MobTypePrompt(mobIndex, questMob);
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
selectedMobLocations.put((Player) context.getForWhom(), null);
|
||||
selectedMobLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new MobLocationPrompt(mobIndex, questMob);
|
||||
} else if (input.equalsIgnoreCase("4")) {
|
||||
return new MobAmountPrompt(mobIndex, questMob);
|
||||
|
@ -86,7 +86,7 @@ public class NpcListener implements Listener {
|
||||
|
||||
if (plugin.questNPCs.contains(evt.getNPC()) && delivery == false) {
|
||||
|
||||
if (plugin.checkQuester(player.getName()) == false) {
|
||||
if (plugin.checkQuester(player.getUniqueId()) == false) {
|
||||
|
||||
boolean hasObjective = false;
|
||||
|
||||
|
@ -211,7 +211,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
|
||||
@ -230,60 +230,60 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
|
||||
if (!hasObjective) {
|
||||
|
||||
if (plugin.questFactory.selectedBlockStarts.containsKey(evt.getPlayer())) {
|
||||
if (plugin.questFactory.selectedBlockStarts.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.questFactory.selectedBlockStarts.put(evt.getPlayer(), block);
|
||||
plugin.questFactory.selectedBlockStarts.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.eventFactory.selectedExplosionLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.eventFactory.selectedExplosionLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.eventFactory.selectedExplosionLocations.put(evt.getPlayer(), block);
|
||||
plugin.eventFactory.selectedExplosionLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.eventFactory.selectedEffectLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.eventFactory.selectedEffectLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.eventFactory.selectedEffectLocations.put(evt.getPlayer(), block);
|
||||
plugin.eventFactory.selectedEffectLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.eventFactory.selectedMobLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.eventFactory.selectedMobLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.eventFactory.selectedMobLocations.put(evt.getPlayer(), block);
|
||||
plugin.eventFactory.selectedMobLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.eventFactory.selectedLightningLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.eventFactory.selectedLightningLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.eventFactory.selectedLightningLocations.put(evt.getPlayer(), block);
|
||||
plugin.eventFactory.selectedLightningLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.eventFactory.selectedTeleportLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.eventFactory.selectedTeleportLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.eventFactory.selectedTeleportLocations.put(evt.getPlayer(), block);
|
||||
plugin.eventFactory.selectedTeleportLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.questFactory.selectedKillLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.questFactory.selectedKillLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.questFactory.selectedKillLocations.put(evt.getPlayer(), block);
|
||||
plugin.questFactory.selectedKillLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (plugin.questFactory.selectedReachLocations.containsKey(evt.getPlayer())) {
|
||||
} else if (plugin.questFactory.selectedReachLocations.containsKey(evt.getPlayer().getUniqueId())) {
|
||||
|
||||
Block block = evt.getClickedBlock();
|
||||
Location loc = block.getLocation();
|
||||
plugin.questFactory.selectedReachLocations.put(evt.getPlayer(), block);
|
||||
plugin.questFactory.selectedReachLocations.put(evt.getPlayer().getUniqueId(), block);
|
||||
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")");
|
||||
|
||||
} else if (player.isConversing() == false) {
|
||||
@ -358,7 +358,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -403,7 +403,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onBlockDamage(BlockDamageEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -424,7 +424,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBlockPlace(BlockPlaceEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -447,7 +447,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBlockBreak(BlockBreakEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -492,7 +492,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerShearEntity(PlayerShearEntityEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -517,7 +517,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
if (evt.getOwner() instanceof Player) {
|
||||
|
||||
Player p = (Player) evt.getOwner();
|
||||
if (plugin.checkQuester(p.getName()) == false) {
|
||||
if (plugin.checkQuester(p.getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(p.getUniqueId());
|
||||
|
||||
@ -540,7 +540,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onEnchantItem(EnchantItemEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getEnchanter().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getEnchanter().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
||||
|
||||
@ -652,7 +652,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
|
||||
Player player = (Player) evt.getEntity().getLastDamageCause().getEntity();
|
||||
|
||||
if (plugin.checkQuester(player.getName()) == false) {
|
||||
if (plugin.checkQuester(player.getUniqueId()) == false) {
|
||||
|
||||
boolean okay = true;
|
||||
|
||||
@ -684,7 +684,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
|
||||
Player player = (Player) damager;
|
||||
|
||||
if (plugin.checkQuester(player.getName()) == false) {
|
||||
if (plugin.checkQuester(player.getUniqueId()) == false) {
|
||||
|
||||
boolean okay = true;
|
||||
|
||||
@ -718,7 +718,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
}
|
||||
|
||||
Player player = evt.getEntity();
|
||||
if (plugin.checkQuester(player.getName()) == false) {
|
||||
if (plugin.checkQuester(player.getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
|
||||
@ -755,7 +755,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
public void onPlayerFish(PlayerFishEvent evt) {
|
||||
|
||||
Player player = evt.getPlayer();
|
||||
if (plugin.checkQuester(player.getName()) == false) {
|
||||
if (plugin.checkQuester(player.getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(player.getUniqueId());
|
||||
|
||||
@ -774,7 +774,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = new Quester(plugin);
|
||||
quester.id = evt.getPlayer().getUniqueId();
|
||||
@ -824,7 +824,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
||||
@ -856,7 +856,7 @@ public class PlayerListener implements Listener, ColorUtil {
|
||||
@EventHandler
|
||||
public void onPlayerMove(PlayerMoveEvent evt) {
|
||||
|
||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
|
||||
boolean isPlayer = true;
|
||||
if (plugin.citizens != null) {
|
||||
|
@ -12,6 +12,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import me.blackvein.quests.prompts.ItemStackPrompt;
|
||||
import me.blackvein.quests.prompts.RequirementsPrompt;
|
||||
@ -41,10 +42,10 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
|
||||
public Quests quests;
|
||||
Map<Player, Quest> editSessions = new HashMap<Player, Quest>();
|
||||
Map<Player, Block> selectedBlockStarts = new HashMap<Player, Block>();
|
||||
public Map<Player, Block> selectedKillLocations = new HashMap<Player, Block>();
|
||||
public Map<Player, Block> selectedReachLocations = new HashMap<Player, Block>();
|
||||
Map<UUID, Quest> editSessions = new HashMap<UUID, Quest>();
|
||||
Map<UUID, Block> selectedBlockStarts = new HashMap<UUID, Block>();
|
||||
public Map<UUID, Block> selectedKillLocations = new HashMap<UUID, Block>();
|
||||
public Map<UUID, Block> selectedReachLocations = new HashMap<UUID, Block>();
|
||||
public HashSet<Player> selectingNPCs = new HashSet<Player>();
|
||||
public List<String> names = new LinkedList<String>();
|
||||
ConversationFactory convoCreator;
|
||||
@ -344,14 +345,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
||||
if (quests.citizens != null) {
|
||||
return new SetNpcStartPrompt();
|
||||
} else {
|
||||
selectedBlockStarts.put((Player) context.getForWhom(), null);
|
||||
selectedBlockStarts.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new BlockStartPrompt();
|
||||
}
|
||||
|
||||
} else if (input.equalsIgnoreCase("6")) {
|
||||
|
||||
if (quests.citizens != null) {
|
||||
selectedBlockStarts.put((Player) context.getForWhom(), null);
|
||||
selectedBlockStarts.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new BlockStartPrompt();
|
||||
} else if (Quests.worldGuard != null) {
|
||||
return new RegionPrompt();
|
||||
|
@ -2494,16 +2494,16 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
if (quester == null) {
|
||||
|
||||
if (debug == true) {
|
||||
getLogger().log(Level.WARNING, "Quester data for player \"" + id.toString() + "\" not stored. Attempting manual data retrieval..");
|
||||
getLogger().log(Level.WARNING, "Quester data for UUID \"" + id.toString() + "\" not stored. Attempting manual data retrieval..");
|
||||
}
|
||||
|
||||
quester = new Quester(this);
|
||||
quester.id = id;
|
||||
if (quester.loadData() == false) {
|
||||
getLogger().severe("Quester not found for player \"" + id.toString() + "\". Consider adding them to the Quester blacklist.");
|
||||
getLogger().severe("Quester not found for UUID \"" + id.toString() + "\". Consider adding it to the Quester blacklist.");
|
||||
} else {
|
||||
if (debug == true) {
|
||||
getLogger().log(Level.INFO, "Manual data retrieval succeeded for player \"" + id.toString() + "\"");
|
||||
getLogger().log(Level.INFO, "Manual data retrieval succeeded for UUID \"" + id.toString() + "\"");
|
||||
}
|
||||
questers.put(id, quester);
|
||||
}
|
||||
@ -4757,11 +4757,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkQuester(String name) {
|
||||
public boolean checkQuester(UUID uuid) {
|
||||
|
||||
for (String s : questerBlacklist) {
|
||||
|
||||
if (Quests.checkQuester(name, s)) {
|
||||
if (UUID.fromString(s) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4771,30 +4771,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
private static boolean checkQuester(String name, String check) {
|
||||
|
||||
if (check.endsWith("*") && check.startsWith("*") == false) {
|
||||
|
||||
check = check.substring(0, check.length());
|
||||
return name.endsWith(check);
|
||||
|
||||
} else if (check.endsWith("*") == false && check.startsWith("*")) {
|
||||
|
||||
check = check.substring(1);
|
||||
return name.startsWith(check);
|
||||
|
||||
} else if (check.endsWith("*") && check.startsWith("*")) {
|
||||
|
||||
check = check.substring(1, check.length());
|
||||
return name.contains(check);
|
||||
|
||||
} else {
|
||||
return name.equalsIgnoreCase(check);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean checkList(List<?> list, Class<?> c) {
|
||||
|
||||
if (list == null) {
|
||||
|
@ -2603,7 +2603,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
||||
context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoMobTypes"));
|
||||
return new MobListPrompt();
|
||||
} else {
|
||||
questFactory.selectedKillLocations.put((Player) context.getForWhom(), null);
|
||||
questFactory.selectedKillLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new MobLocationPrompt();
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("4")) {
|
||||
@ -3010,7 +3010,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("1")) {
|
||||
questFactory.selectedReachLocations.put((Player) context.getForWhom(), null);
|
||||
questFactory.selectedReachLocations.put(((Player) context.getForWhom()).getUniqueId(), null);
|
||||
return new ReachLocationPrompt();
|
||||
} else if (input.equalsIgnoreCase("2")) {
|
||||
if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) {
|
||||
|
@ -14,7 +14,7 @@ npc-effect: "note"
|
||||
max-quests: 0
|
||||
convert-data-on-startup: false
|
||||
quester-blacklist:
|
||||
- "SomeGuy12345"
|
||||
- "UUID"
|
||||
- "somePrefix*"
|
||||
- "*someSuffix"
|
||||
- "*someRegex*"
|
Loading…
Reference in New Issue
Block a user