Add PlayerAnimation#CRIT and MAGIC_CRIT

This commit is contained in:
fullwall 2013-07-12 20:32:10 +08:00
parent 870825d212
commit 2d973e7575
3 changed files with 16 additions and 5 deletions

View File

@ -867,10 +867,8 @@ public class NPCCommands {
@Requirements(selected = true, ownership = true, types = { EntityType.VILLAGER })
public void profession(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
String profession = args.getString(1);
Profession parsed;
try {
parsed = Profession.valueOf(profession.toUpperCase());
} catch (IllegalArgumentException ex) {
Profession parsed = Util.matchEnum(Profession.values(), profession.toUpperCase());
if (parsed == null) {
throw new CommandException(Messages.INVALID_PROFESSION);
}
npc.getTrait(VillagerProfession.class).setProfession(parsed);

View File

@ -19,6 +19,13 @@ public enum PlayerAnimation {
sendPacketNearby(packet, player, radius);
}
},
CRIT {
@Override
protected void playAnimation(EntityPlayer player, int radius) {
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 6);
sendPacketNearby(packet, player, radius);
}
},
HURT {
@Override
protected void playAnimation(EntityPlayer player, int radius) {
@ -26,6 +33,13 @@ public enum PlayerAnimation {
sendPacketNearby(packet, player, radius);
}
},
MAGIC_CRIT {
@Override
protected void playAnimation(EntityPlayer player, int radius) {
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 7);
sendPacketNearby(packet, player, radius);
}
},
SIT {
@Override
protected void playAnimation(EntityPlayer player, int radius) {

View File

@ -6,7 +6,6 @@ import net.citizensnpcs.api.util.Colorizer;
import org.bukkit.ChatColor;
public class StringHelper {
public static String capitalize(Object string) {
String capitalize = string.toString();
return capitalize.length() == 0 ? "" : Character.toUpperCase(capitalize.charAt(0))