mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-01 21:21:30 +01:00
Support name changing with UUIDs pt. 2
This commit is contained in:
parent
d60ded0302
commit
2ee3021645
@ -77,11 +77,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent) {
|
public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent) {
|
||||||
|
|
||||||
Player player = (Player) abandonedEvent.getContext().getForWhom();
|
Player player = (Player) abandonedEvent.getContext().getForWhom();
|
||||||
selectedExplosionLocations.remove(player);
|
selectedExplosionLocations.remove(player.getUniqueId());
|
||||||
selectedEffectLocations.remove(player);
|
selectedEffectLocations.remove(player.getUniqueId());
|
||||||
selectedMobLocations.remove(player);
|
selectedMobLocations.remove(player.getUniqueId());
|
||||||
selectedLightningLocations.remove(player);
|
selectedLightningLocations.remove(player.getUniqueId());
|
||||||
selectedTeleportLocations.remove(player);
|
selectedTeleportLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1282,7 +1282,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = selectedExplosionLocations.get(player);
|
Block block = selectedExplosionLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
@ -1296,7 +1296,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
locs.add(Quests.getLocationInfo(loc));
|
locs.add(Quests.getLocationInfo(loc));
|
||||||
context.setSessionData(CK.E_EXPLOSIONS, locs);
|
context.setSessionData(CK.E_EXPLOSIONS, locs);
|
||||||
selectedExplosionLocations.remove(player);
|
selectedExplosionLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||||
@ -1308,12 +1308,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
|
||||||
context.setSessionData(CK.E_EXPLOSIONS, null);
|
context.setSessionData(CK.E_EXPLOSIONS, null);
|
||||||
selectedExplosionLocations.remove(player);
|
selectedExplosionLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
selectedExplosionLocations.remove(player);
|
selectedExplosionLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1589,7 +1589,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = selectedEffectLocations.get(player);
|
Block block = selectedEffectLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
@ -1603,7 +1603,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
locs.add(Quests.getLocationInfo(loc));
|
locs.add(Quests.getLocationInfo(loc));
|
||||||
context.setSessionData(CK.E_EFFECTS_LOCATIONS, locs);
|
context.setSessionData(CK.E_EFFECTS_LOCATIONS, locs);
|
||||||
selectedEffectLocations.remove(player);
|
selectedEffectLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||||
@ -1614,7 +1614,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
selectedEffectLocations.remove(player);
|
selectedEffectLocations.remove(player.getUniqueId());
|
||||||
return new EffectListPrompt();
|
return new EffectListPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1664,7 +1664,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
effects.add(input.toUpperCase());
|
effects.add(input.toUpperCase());
|
||||||
context.setSessionData(CK.E_EFFECTS, effects);
|
context.setSessionData(CK.E_EFFECTS, effects);
|
||||||
selectedEffectLocations.remove(player);
|
selectedEffectLocations.remove(player.getUniqueId());
|
||||||
return new EffectListPrompt();
|
return new EffectListPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1674,7 +1674,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
selectedEffectLocations.remove(player);
|
selectedEffectLocations.remove(player.getUniqueId());
|
||||||
return new EffectListPrompt();
|
return new EffectListPrompt();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2307,13 +2307,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = selectedMobLocations.get(player);
|
Block block = selectedMobLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
|
|
||||||
questMob.setSpawnLocation(loc);
|
questMob.setSpawnLocation(loc);
|
||||||
selectedMobLocations.remove(player);
|
selectedMobLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||||
@ -2324,7 +2324,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
selectedMobLocations.remove(player);
|
selectedMobLocations.remove(player.getUniqueId());
|
||||||
return new QuestMobPrompt(mobIndex, questMob);
|
return new QuestMobPrompt(mobIndex, questMob);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -2395,7 +2395,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = selectedLightningLocations.get(player);
|
Block block = selectedLightningLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
@ -2409,7 +2409,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
locs.add(Quests.getLocationInfo(loc));
|
locs.add(Quests.getLocationInfo(loc));
|
||||||
context.setSessionData(CK.E_LIGHTNING, locs);
|
context.setSessionData(CK.E_LIGHTNING, locs);
|
||||||
selectedLightningLocations.remove(player);
|
selectedLightningLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||||
@ -2421,12 +2421,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
|
||||||
context.setSessionData(CK.E_LIGHTNING, null);
|
context.setSessionData(CK.E_LIGHTNING, null);
|
||||||
selectedLightningLocations.remove(player);
|
selectedLightningLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
selectedLightningLocations.remove(player);
|
selectedLightningLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -2803,13 +2803,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdDone"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdDone"))) {
|
||||||
|
|
||||||
Block block = selectedTeleportLocations.get(player);
|
Block block = selectedTeleportLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
|
|
||||||
context.setSessionData(CK.E_TELEPORT, Quests.getLocationInfo(loc));
|
context.setSessionData(CK.E_TELEPORT, Quests.getLocationInfo(loc));
|
||||||
selectedTeleportLocations.remove(player);
|
selectedTeleportLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst"));
|
||||||
@ -2821,12 +2821,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
|
||||||
context.setSessionData(CK.E_TELEPORT, null);
|
context.setSessionData(CK.E_TELEPORT, null);
|
||||||
selectedTeleportLocations.remove(player);
|
selectedTeleportLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
selectedTeleportLocations.remove(player);
|
selectedTeleportLocations.remove(player.getUniqueId());
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,9 +76,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player player = (Player) abandonedEvent.getContext().getForWhom();
|
Player player = (Player) abandonedEvent.getContext().getForWhom();
|
||||||
selectedBlockStarts.remove(player);
|
selectedBlockStarts.remove(player.getUniqueId());
|
||||||
selectedKillLocations.remove(player);
|
selectedKillLocations.remove(player.getUniqueId());
|
||||||
selectedReachLocations.remove(player);
|
selectedReachLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,25 +599,25 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdDone"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdDone"))) {
|
||||||
|
|
||||||
Block block = selectedBlockStarts.get(player);
|
Block block = selectedBlockStarts.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
context.setSessionData(CK.Q_START_BLOCK, loc);
|
context.setSessionData(CK.Q_START_BLOCK, loc);
|
||||||
selectedBlockStarts.remove(player);
|
selectedBlockStarts.remove(player.getUniqueId());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(ChatColor.RED + Lang.get("questEditorNoStartBlockSelected"));
|
player.sendMessage(ChatColor.RED + Lang.get("questEditorNoStartBlockSelected"));
|
||||||
return new BlockStartPrompt();
|
return new BlockStartPrompt();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
selectedBlockStarts.remove(player);
|
selectedBlockStarts.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
|
||||||
selectedBlockStarts.remove(player);
|
selectedBlockStarts.remove(player.getUniqueId());
|
||||||
context.setSessionData(CK.Q_START_BLOCK, null);
|
context.setSessionData(CK.Q_START_BLOCK, null);
|
||||||
return new CreateMenuPrompt();
|
return new CreateMenuPrompt();
|
||||||
|
|
||||||
|
@ -2836,7 +2836,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = questFactory.selectedKillLocations.get(player);
|
Block block = questFactory.selectedKillLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
@ -2850,7 +2850,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
locs.add(Quests.getLocationInfo(loc));
|
locs.add(Quests.getLocationInfo(loc));
|
||||||
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs);
|
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs);
|
||||||
questFactory.selectedKillLocations.remove(player);
|
questFactory.selectedKillLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("stageEditorNoBlock"));
|
player.sendMessage(RED + Lang.get("stageEditorNoBlock"));
|
||||||
@ -2861,7 +2861,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
questFactory.selectedKillLocations.remove(player);
|
questFactory.selectedKillLocations.remove(player.getUniqueId());
|
||||||
return new MobListPrompt();
|
return new MobListPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -3102,7 +3102,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdAdd"))) {
|
||||||
|
|
||||||
Block block = questFactory.selectedReachLocations.get(player);
|
Block block = questFactory.selectedReachLocations.get(player.getUniqueId());
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
@ -3116,7 +3116,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
locs.add(Quests.getLocationInfo(loc));
|
locs.add(Quests.getLocationInfo(loc));
|
||||||
context.setSessionData(pref + CK.S_REACH_LOCATIONS, locs);
|
context.setSessionData(pref + CK.S_REACH_LOCATIONS, locs);
|
||||||
questFactory.selectedReachLocations.remove(player);
|
questFactory.selectedReachLocations.remove(player.getUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(RED + Lang.get("stageEditorNoBlockSelected"));
|
player.sendMessage(RED + Lang.get("stageEditorNoBlockSelected"));
|
||||||
@ -3127,7 +3127,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
|
|
||||||
questFactory.selectedReachLocations.remove(player);
|
questFactory.selectedReachLocations.remove(player.getUniqueId());
|
||||||
return new ReachListPrompt();
|
return new ReachListPrompt();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user