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
|
@Override
|
||||||
public void run(CommandContext context) throws CommandExecutionException {
|
public void run(CommandContext context) throws CommandExecutionException {
|
||||||
|
context.setUsage(context.getLabel() + " near <radius>");
|
||||||
Player player = context.ensureSenderIsPlayer();
|
Player player = context.ensureSenderIsPlayer();
|
||||||
int raw = context.parse(Integer.class);
|
int raw = context.parse(Integer.class);
|
||||||
double radius = Math.pow(raw, 2);
|
double radius = Math.pow(raw, 2);
|
||||||
|
|
|
@ -264,6 +264,18 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
||||||
register(new BooleanProperty("show_base", endCrystalIndex, true, false));
|
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
|
// Horse
|
||||||
if (ver.isNewerThanOrEquals(ServerVersion.V_1_8) && ver.isOlderThan(ServerVersion.V_1_9)) {
|
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()));
|
register(new EncodedByteProperty<>("horse_type", HorseType.HORSE, 19, obj -> (byte) obj.ordinal()));
|
||||||
|
|
|
@ -96,7 +96,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
|
||||||
.addEquipmentProperties());
|
.addEquipmentProperties());
|
||||||
|
|
||||||
register(builder(p, "guardian", EntityTypes.GUARDIAN)
|
register(builder(p, "guardian", EntityTypes.GUARDIAN)
|
||||||
.setHologramOffset(-1.125));
|
.setHologramOffset(-1.125)
|
||||||
|
.addProperties("is_elder", "is_retracting_spikes"));
|
||||||
|
|
||||||
register(builder(p, "horse", EntityTypes.HORSE)
|
register(builder(p, "horse", EntityTypes.HORSE)
|
||||||
.setHologramOffset(-0.375)
|
.setHologramOffset(-0.375)
|
||||||
|
|
Loading…
Reference in a new issue