Merge pull request #103 from D3v1s0m/2.X
Command usage in near command and properties
This commit is contained in:
commit
868cf1ae82
3 changed files with 15 additions and 1 deletions
|
@ -20,6 +20,7 @@ public class NearCommand implements CommandHandler {
|
|||
|
||||
@Override
|
||||
public void run(CommandContext context) throws CommandExecutionException {
|
||||
context.setUsage(context.getLabel() + " near <radius>");
|
||||
Player player = context.ensureSenderIsPlayer();
|
||||
int raw = context.parse(Integer.class);
|
||||
double radius = Math.pow(raw, 2);
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue