diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/commands/NearCommand.java b/plugin/src/main/java/lol/pyr/znpcsplus/commands/NearCommand.java index f9588cc..27d7f0a 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/commands/NearCommand.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/commands/NearCommand.java @@ -20,6 +20,7 @@ public class NearCommand implements CommandHandler { @Override public void run(CommandContext context) throws CommandExecutionException { + context.setUsage(context.getLabel() + " near "); Player player = context.ensureSenderIsPlayer(); int raw = context.parse(Integer.class); double radius = Math.pow(raw, 2); diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java b/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java index 15fe88f..11e6fdb 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/entity/EntityPropertyRegistryImpl.java @@ -264,6 +264,18 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry { register(new BooleanProperty("show_base", endCrystalIndex, true, false)); } + // Guardian + if (ver.isOlderThan(ServerVersion.V_1_11)) { + int guardianIndex; + if (ver.isNewerThanOrEquals(ServerVersion.V_1_10)) guardianIndex = 12; + else if (ver.isNewerThanOrEquals(ServerVersion.V_1_9)) guardianIndex = 11; + else guardianIndex = 16; + register(new BitsetProperty("is_elder", guardianIndex, 0x04, false, legacyBooleans)); + register(new BitsetProperty("is_retracting_spikes", guardianIndex++, 0x02, false, legacyBooleans)); + linkProperties("is_elder", "is_retracting_spikes"); + // TODO: add guardian beam target + } + // Horse if (ver.isNewerThanOrEquals(ServerVersion.V_1_8) && ver.isOlderThan(ServerVersion.V_1_9)) { register(new EncodedByteProperty<>("horse_type", HorseType.HORSE, 19, obj -> (byte) obj.ordinal())); diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/npc/NpcTypeRegistryImpl.java b/plugin/src/main/java/lol/pyr/znpcsplus/npc/NpcTypeRegistryImpl.java index 5048100..5e8bb6f 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/npc/NpcTypeRegistryImpl.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/npc/NpcTypeRegistryImpl.java @@ -96,7 +96,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry { .addEquipmentProperties()); register(builder(p, "guardian", EntityTypes.GUARDIAN) - .setHologramOffset(-1.125)); + .setHologramOffset(-1.125) + .addProperties("is_elder", "is_retracting_spikes")); register(builder(p, "horse", EntityTypes.HORSE) .setHologramOffset(-0.375)