Im an idiot...

Why did i set it every tick?
This commit is contained in:
sanjay900 2014-12-18 22:55:30 +13:00
parent 249ef8ec41
commit f1ec5a2248
3 changed files with 11 additions and 10 deletions

View File

@ -1083,7 +1083,7 @@ public class NPCCommands {
npc.destroy();
Messaging.sendTr(sender, Messages.NPC_REMOVED, npc.getName());
}
@Command(
aliases = { "npc" },
usage = "rabbittype [type]",
@ -1102,7 +1102,7 @@ public class NPCCommands {
npc.getTrait(RabbitType.class).setType(type);
Messaging.sendTr(sender, Messages.RABBIT_TYPE_SET, npc.getName(), type.name());
}
@Command(
aliases = { "npc" },
usage = "rename [name]",

View File

@ -21,17 +21,14 @@ public class RabbitType extends Trait {
rabbit = npc.getEntity() instanceof Rabbit ? (Rabbit) npc.getEntity() : null;
}
@Override
public void run() {
public void setType(RabbitTypes type) {
this.type = type;
if (rabbit != null) {
((EntityRabbit)((CraftRabbit)rabbit).getHandle()).r(type.type);
}
}
public void setType(RabbitTypes type) {
this.type = type;
}
public enum RabbitTypes {
BROWN(0),

View File

@ -83,6 +83,8 @@ citizens.commands.npc.powered.set=[[{0}]] will now be powered.
citizens.commands.npc.powered.stopped=[[{0}]] will no longer be powered.
citizens.commands.npc.profession.invalid-profession={0} is not a valid profession.
citizens.commands.npc.profession.set=[[{0}]] is now a [[{1}]].
citizens.commands.npc.rabbittype.invalid-type=Invalid rabbit type.
citizens.commands.npc.rabbittype.type-set=[[{0}]]''s rabbit type has been set to [[{1}]]
citizens.commands.npc.remove.incorrect-syntax=Incorrect syntax. /npc remove (all)
citizens.commands.npc.remove.removed-all=You permanently removed all NPCs.
citizens.commands.npc.remove.removed=You permanently removed [[{0}]].
@ -99,6 +101,8 @@ citizens.commands.npc.sound.set={0}''s sounds are now: ambient - [[{1}]] hurt -
citizens.commands.npc.sound.info={0}''s sounds are: ambient - [[{1}]] hurt - [[{2}]] and death - [[{3}]].<br><br>Valid sounds are {4}.
citizens.commands.npc.skeletontype.set={0}''s skeleton type set to [[{1}]].
citizens.commands.npc.skeletontype.invalid-type=Invalid skeleton type.
citizens.commands.npc.rabbittype.set={0}''s rabbit type set to [[{1}]].
citizens.commands.npc.rabbittype.invalid-type=Invalid rabbit Type.
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.
@ -172,7 +176,7 @@ 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! Type 'exit' to leave the editor.
citizens.editors.text.begin=<b>Entered the text editor!
citizens.editors.text.change-page-prompt=Enter a page number to view more text entries.
citizens.editors.text.close-talker-set=[[Close talker]] set to [[{0}]].
citizens.editors.text.edit-begin-prompt=Enter the index of the entry you wish to edit or [[page]] to view more pages.