Add pathfinding range message, sort

This commit is contained in:
fullwall 2012-10-26 12:26:54 +08:00
parent 8f4be0a8e1
commit c1e0550af6
4 changed files with 36 additions and 35 deletions

View File

@ -272,9 +272,9 @@ public class EventListen implements Listener {
}
private static class ChunkCoord {
private final String name;
private final int x;
private final int z;
private final String name;
private ChunkCoord(Chunk chunk) {
this(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
@ -286,15 +286,6 @@ public class EventListen implements Listener {
this.name = worldName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = prime + ((name == null) ? 0 : name.hashCode());
result = prime * result + x;
result = prime * result + z;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@ -316,6 +307,15 @@ public class EventListen implements Listener {
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = prime + ((name == null) ? 0 : name.hashCode());
result = prime * result + x;
result = prime * result + z;
return result;
}
}
private static EventListen instance;

View File

@ -1,6 +1,7 @@
package net.citizensnpcs.util;
public class Messages {
public static final String ADDED_TO_PLAYERLIST = "citizens.commands.npc.playerlist.added";
public static final String AGE_LOCKED = "citizens.commands.npc.age.locked";
public static final String AGE_SET_ADULT = "citizens.commands.npc.age.set-adult";
public static final String AGE_SET_BABY = "citizens.commands.npc.age.set-baby";
@ -127,6 +128,7 @@ public class Messages {
public static final String PROFESSION_SET = "citizens.commands.npc.profession.set";
public static final String REMOVE_INCORRECT_SYNTAX = "citizens.commands.npc.remove.incorrect-syntax";
public static final String REMOVED_ALL_NPCS = "citizens.commands.npc.remove.removed-all";
public static final String REMOVED_FROM_PLAYERLIST = "citizens.commands.npc.playerlist.removed";
public static final String SADDLED_SET = "citizens.editors.equipment.saddled-set";
public static final String SADDLED_STOPPED = "citizens.editors.equipment.saddled-stopped";
public static final String SAVE_METHOD_SET_NOTIFICATION = "citizens.notifications.save-method-set";
@ -134,6 +136,7 @@ public class Messages {
public static final String SCRIPT_COMPILING = "citizens.commands.script.compiling";
public static final String SCRIPT_FILE_MISSING = "citizens.commands.script.file-missing";
public static final String SELECTION_PROMPT = "citizens.editors.selection.start-prompt";
public static final String SELECTION_PROMPT_INVALID_CHOICE = "citizens.conversations.selection.invalid-choice";
public static final String SHEARED_SET = "citizens.editors.equipment.sheared-set";
public static final String SHEARED_STOPPED = "citizens.editors.equipment.sheared-stopped";
public static final String SIZE_DESCRIPTION = "citizens.commands.npc.size.description";
@ -180,7 +183,4 @@ public class Messages {
public static final String WAYPOINT_PROVIDER_SET = "citizens.waypoints.set-provider";
public static final String WAYPOINT_TELEPORTING_DISABLED = "citizens.commands.waypoints.disableteleporting.disabled";
public static final String WRITING_DEFAULT_SETTING = "citizens.settings.writing-default";
public static final String ADDED_TO_PLAYERLIST = "citizens.commands.npc.playerlist.added";
public static final String REMOVED_FROM_PLAYERLIST = "citizens.commands.npc.playerlist.removed";
public static final String SELECTION_PROMPT_INVALID_CHOICE = "citizens.conversations.selection.invalid-choice";
}

View File

@ -48,6 +48,16 @@ public class NMS {
private static Field SPEED_FIELD;
private static Field THREAD_STOPPER;
public static void addOrRemoveFromPlayerList(LivingEntity bukkitEntity, boolean remove) {
EntityLiving handle = ((CraftLivingEntity) bukkitEntity).getHandle();
if (handle.world == null || !(handle instanceof EntityPlayer))
return;
if (remove)
handle.world.players.remove(handle);
else
handle.world.players.add(handle);
}
public static void attack(EntityLiving handle, EntityLiving target) {
int damage = getDamage(handle);
@ -261,14 +271,4 @@ public class NMS {
Messaging.logTr(Messages.ERROR_GETTING_ID_MAPPING, e.getMessage());
}
}
public static void addOrRemoveFromPlayerList(LivingEntity bukkitEntity, boolean remove) {
EntityLiving handle = ((CraftLivingEntity) bukkitEntity).getHandle();
if (handle.world == null || !(handle instanceof EntityPlayer))
return;
if (remove)
handle.world.players.remove(handle);
else
handle.world.players.add(handle);
}
}

View File

@ -1,10 +1,7 @@
citizens.changed-implementation=Citizens implementation changed, disabling plugin.
citizens.commands.citizens.save.help=Use the -a flag to save async (off the main server thread).
citizens.commands.console-error=Please report this error: [See console]
citizens.commands.npc.playerlist.added=Added [[{0}]] to the player list.
citizens.commands.npc.playerlist.removed=Removed [[{0}]] from the player list.
citizens.commands.help.command-missing=Command /{0} not found.
citizens.conversations.selection.invalid-choice=[[{0}]] is not a valid option.
citizens.commands.help.header=Help
citizens.commands.id-not-found=Couldn't find any NPC with ID {0}.
citizens.commands.invalid-mobtype={0} is not a valid mobtype.
@ -13,20 +10,12 @@ citizens.commands.npc.age.cannot-be-aged=The mob type {0} cannot be aged.
citizens.commands.npc.age.help=Can only be used on entities that can become babies. Use the [[-l]] flag to lock age over time (note: relogs may be required to see this).
citizens.commands.npc.age.invalid-age=Invalid age. Valid ages are adult, baby, number between -24000 and 0
citizens.commands.npc.age.locked=Age locked.
citizens.commands.npc.create.invalid-location=Spawn location could not be parsed or was not found.
citizens.commands.npc.gamemode.describe={0}'s gamemode is [[{1}]].
citizens.commands.npc.gamemode.invalid={0} is not a valid gamemode.
citizens.commands.npc.gamemode.set=Gamemode set to [[{0}]].
citizens.commands.npc.age.set-adult=[[{0}]] is now an adult.
citizens.commands.npc.age.set-baby=[[{0}]] is now a baby.
citizens.commands.npc.age.set-normal=[[{0}]] is now age [[{1}]].
citizens.commands.npc.age.set=[[{0}]] is now [[{1}]].
citizens.commands.npc.age.unlocked=Age unlocked.
citizens.commands.npc.anchor.added=Anchor added.
citizens.commands.npc.size.set={0}'s size set to [[{1}]].
citizens.commands.npc.gravity.disabled=Gravity [[disabled]].
citizens.commands.npc.gravity.enabled=Gravity [[enabled]].
citizens.commands.npc.size.description={0}'s size is [[{1}]].
citizens.commands.npc.anchor.already-exists=The anchor {0} already exists.
citizens.commands.npc.anchor.invalid-name=Invalid anchor name.
citizens.commands.npc.anchor.missing=The anchor {1} does not exist.
@ -38,10 +27,16 @@ citizens.commands.npc.controllable.not-controllable=[[{0}]] is not controllable.
citizens.commands.npc.controllable.removed=[[{0}]] can no longer be controlled.
citizens.commands.npc.controllable.set=[[{0}]] can now be controlled.
citizens.commands.npc.copy.copied=[[{0}]] has been copied.
citizens.commands.npc.create.invalid-location=Spawn location could not be parsed or was not found.
citizens.commands.npc.create.invalid-mobtype={0} is not a valid mob type. Using default type.
citizens.commands.npc.create.not-living-mobtype={0} is not a living entity type. Using default type.
citizens.commands.npc.create.npc-name-too-long=NPC names cannot be longer than 16 characters. The name has been shortened.
citizens.commands.npc.despawn.despawned=You despawned [[{0}]].
citizens.commands.npc.gamemode.describe={0}'s gamemode is [[{1}]].
citizens.commands.npc.gamemode.invalid={0} is not a valid gamemode.
citizens.commands.npc.gamemode.set=Gamemode set to [[{0}]].
citizens.commands.npc.gravity.disabled=Gravity [[disabled]].
citizens.commands.npc.gravity.enabled=Gravity [[enabled]].
citizens.commands.npc.lookclose.set=[[{0}]] will now rotate when players are nearby.
citizens.commands.npc.lookclose.stopped=[[{0}]] will no longer rotate when players are nearby.
citizens.commands.npc.mount.failed=Couldn't mount [[{0}]].
@ -52,6 +47,9 @@ citizens.commands.npc.owner.already-owner={0} is already the owner of {1}.
citizens.commands.npc.owner.owner=[[{0}]]'s owner is [[{1}]].
citizens.commands.npc.owner.set-server=[[The server]] is now the owner of {0}.
citizens.commands.npc.owner.set=[[{1}]] is now the owner of {0}.
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.invalid-name=Invalid pose name.
@ -66,6 +64,8 @@ citizens.commands.npc.remove.removed-all=You permanently removed all NPCs.
citizens.commands.npc.remove.removed=You permanently removed [[{0}]].
citizens.commands.npc.rename.renamed=You renamed [[{0}]] to [[{1}]].
citizens.commands.npc.select.already-selected=You already have that NPC selected.
citizens.commands.npc.size.description={0}'s size is [[{1}]].
citizens.commands.npc.size.set={0}'s size set to [[{1}]].
citizens.commands.npc.spawn.already-spawned={0} is already spawned at another location. Use '/npc tphere' to teleport the NPC to your location.
citizens.commands.npc.spawn.missing-npc-id=No NPC with the ID {0} exists.
citizens.commands.npc.spawn.no-location=No stored location available - command must be used ingame.
@ -98,6 +98,7 @@ citizens.commands.traitc.missing=Trait not found.
citizens.commands.traitc.not-configurable=That trait is not configurable.
citizens.commands.traitc.not-on-npc=The NPC doesn't have that trait.
citizens.commands.unknown-command=Unknown command. Did you mean:
citizens.conversations.selection.invalid-choice=[[{0}]] is not a valid option.
citizens.economy.error-loading=Unable to use economy handling. Has Vault been enabled?
citizens.economy.minimum-cost-required=Need at least {0}.
citizens.economy.money-withdrawn=Withdrew [[{0}]] for your NPC.
@ -111,6 +112,7 @@ citizens.editors.equipment.saddled-stopped=[[{0}]] is no longer saddled.
citizens.editors.equipment.sheared-set=[[{0}]] is now sheared.
citizens.editors.equipment.sheared-stopped=[[{0}]] is no longer sheared.
citizens.editors.equipment.sheep-coloured=[[{0}]] is now coloured [[{1}]].
citizens.editors.selection.start-prompt=There were multiple NPCs with the supplied name.<br>Please enter an id or number from the list below to select that NPC.
citizens.editors.text.add-prompt=Enter text to add to the NPC.
citizens.editors.text.added-entry=[[Added]] the entry [[{0}]].
citizens.editors.text.begin=<b>Entered the text editor!
@ -129,7 +131,6 @@ citizens.editors.text.realistic-looking-set=[[Realistic looking]] set to [[{0}]]
citizens.editors.text.remove-prompt=Enter the index of the entry you wish to remove or [[page]] to view more pages.
citizens.editors.text.removed-entry=[[Removed]] entry at index [[{0}]].
citizens.editors.text.start-prompt=Type [[add]] to add an entry, [[edit]] to edit entries, [[remove]] to remove entries, [[close]] to toggle the NPC as a close talker, and [[random]] to toggle the NPC as a random talker. Type [[help]] to show this again.
citizens.editors.selection.start-prompt=There were multiple NPCs with the supplied name.<br>Please enter an id or number from the list below to select that NPC.
citizens.editors.waypoints.linear.added-waypoint=[[Added]] a waypoint at ({0}) ([[{1}]], [[{2}]])
citizens.editors.waypoints.linear.begin=<b>Entered the linear waypoint editor!<br>[[Left click]] to add a waypoint, [[right click]] to remove.<br>Type [[toggle path]] to toggle showing entities at waypoints.
citizens.editors.waypoints.linear.edit-slot-set=Editing slot set to [[{0}]] ({1}).