mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-29 19:41:50 +01:00
Fix case-sensitive poses
This commit is contained in:
parent
b6983ead75
commit
155022e82b
@ -738,7 +738,7 @@ public class NPCCommands {
|
||||
if (trait.addPose(args.getFlag("save"), args.getSenderLocation())) {
|
||||
Messaging.sendTr(sender, Messages.POSE_ADDED);
|
||||
} else
|
||||
throw new CommandException(Messages.POSE_ALREADY_EXISTS, args.getFlag("assume"));
|
||||
throw new CommandException(Messages.POSE_ALREADY_EXISTS, args.getFlag("save"));
|
||||
} else if (args.hasValueFlag("assume")) {
|
||||
String pose = args.getFlag("assume");
|
||||
if (pose.isEmpty())
|
||||
|
@ -25,10 +25,11 @@ public class Poses extends Trait {
|
||||
}
|
||||
|
||||
public boolean addPose(String name, Location location) {
|
||||
name = name.toLowerCase();
|
||||
Pose newPose = new Pose(name, location.getPitch(), location.getYaw());
|
||||
if (poses.containsValue(newPose) || poses.containsKey(name))
|
||||
return false;
|
||||
poses.put(name.toLowerCase(), newPose);
|
||||
poses.put(name, newPose);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -68,6 +69,7 @@ public class Poses extends Trait {
|
||||
|
||||
@Override
|
||||
public void load(DataKey key) throws NPCLoadException {
|
||||
poses.clear();
|
||||
for (DataKey sub : key.getRelative("list").getIntegerSubKeys())
|
||||
try {
|
||||
String[] parts = sub.getString("").split(";");
|
||||
|
@ -53,9 +53,9 @@ citizens.commands.npc.pathfindingrange.set=Pathfinding range set to [[{0}]].
|
||||
citizens.commands.npc.playerlist.added=Added [[{0}]] to the player list.
|
||||
citizens.commands.npc.playerlist.removed=Removed [[{0}]] from the player list.
|
||||
citizens.commands.npc.pose.added=Pose added.
|
||||
citizens.commands.npc.pose.already-exists=The pose {0} already exists.
|
||||
citizens.commands.npc.pose.already-exists=The pose [[{0}]] already exists.
|
||||
citizens.commands.npc.pose.invalid-name=Invalid pose name.
|
||||
citizens.commands.npc.pose.missing=The pose {1} does not exist.
|
||||
citizens.commands.npc.pose.missing=The pose [[{0}]] does not exist.
|
||||
citizens.commands.npc.pose.removed=Pose removed.
|
||||
citizens.commands.npc.powered.set=[[{0}]] will now be powered.
|
||||
citizens.commands.npc.powered.stopped=[[{0}]] will no longer be powered.
|
||||
|
Loading…
Reference in New Issue
Block a user