mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 19:16:34 +01:00
Add PlayerAnimation#CRIT and MAGIC_CRIT
This commit is contained in:
parent
870825d212
commit
2d973e7575
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user