ghast attacking property
This commit is contained in:
parent
923926b0b4
commit
83b654fd76
8 changed files with 10 additions and 39 deletions
|
@ -113,9 +113,6 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
// Frog
|
||||
registerType("frog_variant", FrogVariant.TEMPERATE);
|
||||
|
||||
// Ghast
|
||||
registerType("attacking", false);
|
||||
|
||||
// Guardian
|
||||
registerType("is_elder", false); // TODO: ensure it only works till 1.10. Note: index is wrong on wiki.vg
|
||||
|
||||
|
@ -207,6 +204,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
|
||||
public void registerTypes(PacketFactory packetFactory) {
|
||||
ServerVersion ver = PacketEvents.getAPI().getServerManager().getVersion();
|
||||
boolean legacyBooleans = ver.isOlderThan(ServerVersion.V_1_9);
|
||||
|
||||
register(new EquipmentProperty(packetFactory, "helmet", EquipmentSlot.HELMET));
|
||||
register(new EquipmentProperty(packetFactory, "chestplate", EquipmentSlot.CHEST_PLATE));
|
||||
|
@ -228,7 +226,7 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
register(new SimpleBitsetProperty("invisible", 0, 0x20));
|
||||
linkProperties("glow", "fire", "invisible");
|
||||
|
||||
register(new SimpleBooleanProperty("silent", 4, false, ver.isOlderThan(ServerVersion.V_1_9)));
|
||||
register(new SimpleBooleanProperty("silent", 4, false, legacyBooleans));
|
||||
|
||||
final int armorStandIndex;
|
||||
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) armorStandIndex = 15;
|
||||
|
@ -271,6 +269,14 @@ public class EntityPropertyRegistryImpl implements EntityPropertyRegistry {
|
|||
register(new RotationProperty("left_leg_rotation", armorStandRotationIndex++, new Vector3f(-1, 0, -1)));
|
||||
register(new RotationProperty("right_leg_rotation", armorStandRotationIndex, new Vector3f(1, 0, 1)));
|
||||
|
||||
final int ghastAttackingIndex;
|
||||
if (ver.isNewerThanOrEquals(ServerVersion.V_1_17)) ghastAttackingIndex = 16;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_15)) ghastAttackingIndex = 15;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_14)) ghastAttackingIndex = 14;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_10)) ghastAttackingIndex = 12;
|
||||
else if (ver.isNewerThanOrEquals(ServerVersion.V_1_9)) ghastAttackingIndex = 11;
|
||||
else ghastAttackingIndex = 16;
|
||||
register(new SimpleBooleanProperty("attacking", ghastAttackingIndex, false, legacyBooleans));
|
||||
}
|
||||
|
||||
private void registerSerializer(PropertySerializer<?> serializer) {
|
||||
|
|
|
@ -73,15 +73,10 @@ public interface MetadataFactory {
|
|||
// Frog
|
||||
EntityData frogVariant(int variant);
|
||||
|
||||
// Ghast
|
||||
EntityData ghastAttacking(boolean attacking);
|
||||
|
||||
// Goat
|
||||
EntityData goatHasLeftHorn(boolean hasLeftHorn);
|
||||
EntityData goatHasRightHorn(boolean hasRightHorn);
|
||||
|
||||
// Guardian
|
||||
|
||||
// Hoglin
|
||||
EntityData hoglinImmuneToZombification(boolean immuneToZombification);
|
||||
|
||||
|
|
|
@ -42,11 +42,6 @@ public class V1_10MetadataFactory extends V1_9MetadataFactory {
|
|||
return newEntityData(13, EntityDataTypes.BOOLEAN, charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(12, EntityDataTypes.BOOLEAN, attacking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData villagerData(int type, int profession, int level) {
|
||||
return newEntityData(13, EntityDataTypes.INT, profession);
|
||||
|
|
|
@ -92,11 +92,6 @@ public class V1_14MetadataFactory extends V1_13MetadataFactory {
|
|||
return newEntityData(16, EntityDataTypes.BYTE, (byte) ((sitting ? 0x01 : 0) | (crouching ? 0x04 : 0) | (sleeping ? 0x20 : 0)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(14, EntityDataTypes.BOOLEAN, attacking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData villagerData(int type, int profession, int level) {
|
||||
return newEntityData(16, EntityDataTypes.VILLAGER_DATA, new VillagerData(type, profession, level));
|
||||
|
|
|
@ -80,11 +80,6 @@ public class V1_15MetadataFactory extends V1_14MetadataFactory {
|
|||
return newEntityData(17, EntityDataTypes.BYTE, (byte) ((sitting ? 0x01 : 0) | (crouching ? 0x04 : 0) | (sleeping ? 0x20 : 0) | (facePlanted ? 0x40 : 0)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(15, EntityDataTypes.BOOLEAN, attacking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData villagerData(int type, int profession, int level) {
|
||||
return newEntityData(17, EntityDataTypes.VILLAGER_DATA, new VillagerData(type, profession, level));
|
||||
|
|
|
@ -131,11 +131,6 @@ public class V1_17MetadataFactory extends V1_16MetadataFactory {
|
|||
return newEntityData(18, EntityDataTypes.BYTE, (byte) ((sitting ? 0x01 : 0) | (crouching ? 0x04 : 0) | (sleeping ? 0x20 : 0) | (facePlanted ? 0x40 : 0)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(16, EntityDataTypes.BOOLEAN, attacking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData goatHasLeftHorn(boolean hasLeftHorn) {
|
||||
return newEntityData(18, EntityDataTypes.BOOLEAN, hasLeftHorn);
|
||||
|
|
|
@ -145,11 +145,6 @@ public class V1_8MetadataFactory implements MetadataFactory {
|
|||
throw new UnsupportedOperationException("The frog variant entity data isn't supported on this version");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(16, EntityDataTypes.BYTE, (byte) (attacking ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData goatHasLeftHorn(boolean hasLeftHorn) {
|
||||
throw new UnsupportedOperationException("The goat horn entity data isn't supported on this version");
|
||||
|
|
|
@ -32,11 +32,6 @@ public class V1_9MetadataFactory extends V1_8MetadataFactory {
|
|||
return newEntityData(12, EntityDataTypes.BOOLEAN, charged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData ghastAttacking(boolean attacking) {
|
||||
return newEntityData(11, EntityDataTypes.BOOLEAN, attacking);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityData villagerData(int type, int profession, int level) {
|
||||
return newEntityData(12, EntityDataTypes.INT, profession);
|
||||
|
|
Loading…
Reference in a new issue