mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-12 11:21:05 +01:00
Add /npc guardian
This commit is contained in:
parent
20dcfd0a22
commit
b1d74c50c8
@ -19,6 +19,7 @@ import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Ageable;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.entity.Horse.Color;
|
||||
import org.bukkit.entity.Horse.Style;
|
||||
import org.bukkit.entity.Horse.Variant;
|
||||
@ -509,6 +510,23 @@ public class NPCCommands {
|
||||
Messaging.sendTr(sender, key, npc.getName());
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "guardian --elder [true|false]",
|
||||
desc = "Changes guardian modifiers",
|
||||
modifiers = { "guardian" },
|
||||
min = 1,
|
||||
max = 2,
|
||||
permission = "citizens.npc.guardian")
|
||||
@Requirements(selected = true, ownership = true, types = { EntityType.GUARDIAN })
|
||||
public void guardian(CommandContext args, CommandSender sender, NPC npc) {
|
||||
Guardian guardian = (Guardian) npc.getEntity();
|
||||
if (args.hasValueFlag("elder")) {
|
||||
guardian.setElder(args.getFlag("elder", "false").equals("true") ? true : false);
|
||||
Messaging.sendTr(sender, guardian.isElder() ? Messages.ELDER_SET : Messages.ELDER_UNSET, npc.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "horse (--color color) (--type type) (--style style) (-cb)",
|
||||
|
@ -52,6 +52,8 @@ public class Messages {
|
||||
public static final String CURRENT_WAYPOINT_PROVIDER = "citizens.waypoints.current-provider";
|
||||
public static final String DATABASE_CONNECTION_FAILED = "citizens.notifications.database-connection-failed";
|
||||
public static final String DELAY_TRIGGER_PROMPT = "citizens.editors.waypoints.triggers.delay.prompt";
|
||||
public static final String ELDER_SET = "citizens.commands.npc.guardian.elder-set";
|
||||
public static final String ELDER_UNSET = "citizens.commands.npc.guardian.elder-unset";
|
||||
public static final String ENTITY_TYPE_SET = "citizens.commands.npc.type.set";
|
||||
public static final String EQUIPMENT_EDITOR_ALL_ITEMS_REMOVED = "citizens.editors.equipment.all-items-removed";
|
||||
public static final String EQUIPMENT_EDITOR_BEGIN = "citizens.editors.equipment.begin";
|
||||
|
@ -42,6 +42,8 @@ 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.guardian.elder-unset=[[{0}]] is no longer an elder guardian.
|
||||
citizens.commands.npc.guardian.elder-set=[[{0}]] is now an elder guardian.
|
||||
citizens.commands.npc.horse.chest-set=The horse is now carrying a chest.
|
||||
citizens.commands.npc.horse.chest-unset=The horse is no longer carrying a chest.
|
||||
citizens.commands.npc.horse.color-set=The horse''s color was set to [[{0}]].
|
||||
|
Loading…
Reference in New Issue
Block a user