Implemented Bat properties
This commit is contained in:
parent
dd3c88efce
commit
2dceea6fe7
9 changed files with 40 additions and 2 deletions
|
@ -43,4 +43,7 @@ public interface MetadataFactory {
|
||||||
// Axolotl
|
// Axolotl
|
||||||
EntityData axolotlVariant(int variant);
|
EntityData axolotlVariant(int variant);
|
||||||
EntityData playingDead(boolean playingDead);
|
EntityData playingDead(boolean playingDead);
|
||||||
|
|
||||||
|
// Bat
|
||||||
|
EntityData batHanging(boolean hanging);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,4 +59,9 @@ public class V1_10MetadataFactory extends V1_9MetadataFactory {
|
||||||
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
||||||
return createRotations(17, rightLegRotation);
|
return createRotations(17, rightLegRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(12, EntityDataTypes.BYTE, (byte) (hanging ? 0x01 : 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,4 +65,9 @@ public class V1_14MetadataFactory extends V1_13MetadataFactory {
|
||||||
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
||||||
return createRotations(19, rightLegRotation);
|
return createRotations(19, rightLegRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(14, EntityDataTypes.BYTE, (byte) (hanging ? 0x01 : 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,9 @@ public class V1_15MetadataFactory extends V1_14MetadataFactory {
|
||||||
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
public EntityData armorStandRightLegRotation(Vector3f rightLegRotation) {
|
||||||
return createRotations(20, rightLegRotation);
|
return createRotations(20, rightLegRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(15, EntityDataTypes.BYTE, (byte) (hanging ? 0x01 : 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,4 +79,9 @@ public class V1_17MetadataFactory extends V1_16MetadataFactory {
|
||||||
public EntityData playingDead(boolean playingDead) {
|
public EntityData playingDead(boolean playingDead) {
|
||||||
return newEntityData(18, EntityDataTypes.BOOLEAN, playingDead);
|
return newEntityData(18, EntityDataTypes.BOOLEAN, playingDead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(16, EntityDataTypes.BYTE, (byte) (hanging ? 0x01 : 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,11 @@ public class V1_8MetadataFactory implements MetadataFactory {
|
||||||
throw new UnsupportedOperationException("The playing dead entity data isn't supported on this version");
|
throw new UnsupportedOperationException("The playing dead entity data isn't supported on this version");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(16, EntityDataTypes.BYTE, (byte) (hanging ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityData silent(boolean enabled) {
|
public EntityData silent(boolean enabled) {
|
||||||
return newEntityData(4, EntityDataTypes.BYTE, (byte) (enabled ? 1 : 0));
|
return newEntityData(4, EntityDataTypes.BYTE, (byte) (enabled ? 1 : 0));
|
||||||
|
|
|
@ -27,6 +27,11 @@ public class V1_9MetadataFactory extends V1_8MetadataFactory {
|
||||||
return newEntityData(8, EntityDataTypes.BOOLEAN, ambient);
|
return newEntityData(8, EntityDataTypes.BOOLEAN, ambient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityData batHanging(boolean hanging) {
|
||||||
|
return newEntityData(11, EntityDataTypes.BYTE, (byte) (hanging ? 0x01 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityData name(Component name) {
|
public EntityData name(Component name) {
|
||||||
return newEntityData(2, EntityDataTypes.STRING, AdventureSerializer.getGsonSerializer().serialize(name));
|
return newEntityData(2, EntityDataTypes.STRING, AdventureSerializer.getGsonSerializer().serialize(name));
|
||||||
|
|
|
@ -46,7 +46,8 @@ public class NpcTypeRegistryImpl implements NpcTypeRegistry {
|
||||||
.addProperties("small", "arms", "base_plate", "head_rotation", "body_rotation", "left_arm_rotation", "right_arm_rotation", "left_leg_rotation", "right_leg_rotation"));
|
.addProperties("small", "arms", "base_plate", "head_rotation", "body_rotation", "left_arm_rotation", "right_arm_rotation", "left_leg_rotation", "right_leg_rotation"));
|
||||||
|
|
||||||
register(builder(p, "bat", EntityTypes.BAT)
|
register(builder(p, "bat", EntityTypes.BAT)
|
||||||
.setHologramOffset(-1.075));
|
.setHologramOffset(-1.075)
|
||||||
|
.addProperties("hanging"));
|
||||||
|
|
||||||
register(builder(p, "blaze", EntityTypes.BLAZE)
|
register(builder(p, "blaze", EntityTypes.BLAZE)
|
||||||
.setHologramOffset(-0.175));
|
.setHologramOffset(-0.175));
|
||||||
|
|
|
@ -163,10 +163,14 @@ public class V1_8PacketFactory implements PacketFactory {
|
||||||
add(data, metadataFactory.armorStandRightArmRotation(properties.getProperty(propertyRegistry.getByName("right_arm_rotation", Vector3f.class))));
|
add(data, metadataFactory.armorStandRightArmRotation(properties.getProperty(propertyRegistry.getByName("right_arm_rotation", Vector3f.class))));
|
||||||
add(data, metadataFactory.armorStandLeftLegRotation(properties.getProperty(propertyRegistry.getByName("left_leg_rotation", Vector3f.class))));
|
add(data, metadataFactory.armorStandLeftLegRotation(properties.getProperty(propertyRegistry.getByName("left_leg_rotation", Vector3f.class))));
|
||||||
add(data, metadataFactory.armorStandRightLegRotation(properties.getProperty(propertyRegistry.getByName("right_leg_rotation", Vector3f.class))));
|
add(data, metadataFactory.armorStandRightLegRotation(properties.getProperty(propertyRegistry.getByName("right_leg_rotation", Vector3f.class))));
|
||||||
} else if (entity.getType().equals(EntityTypes.AXOLOTL)) {
|
}
|
||||||
|
else if (entity.getType().equals(EntityTypes.AXOLOTL)) {
|
||||||
add(data, metadataFactory.axolotlVariant(properties.getProperty(propertyRegistry.getByName("axolotl_variant", Integer.class))));
|
add(data, metadataFactory.axolotlVariant(properties.getProperty(propertyRegistry.getByName("axolotl_variant", Integer.class))));
|
||||||
add(data, metadataFactory.playingDead(properties.getProperty(propertyRegistry.getByName("playing_dead", Boolean.class))));
|
add(data, metadataFactory.playingDead(properties.getProperty(propertyRegistry.getByName("playing_dead", Boolean.class))));
|
||||||
}
|
}
|
||||||
|
else if (entity.getType().equals(EntityTypes.BAT)) {
|
||||||
|
add(data, metadataFactory.batHanging(properties.getProperty(propertyRegistry.getByName("hanging", Boolean.class))));
|
||||||
|
}
|
||||||
if (properties.hasProperty(propertyRegistry.getByName("name"))) {
|
if (properties.hasProperty(propertyRegistry.getByName("name"))) {
|
||||||
add(data, metadataFactory.name(PapiUtil.set(textSerializer, player, properties.getProperty(propertyRegistry.getByName("name", Component.class)))));
|
add(data, metadataFactory.name(PapiUtil.set(textSerializer, player, properties.getProperty(propertyRegistry.getByName("name", Component.class)))));
|
||||||
add(data, metadataFactory.nameShown());
|
add(data, metadataFactory.nameShown());
|
||||||
|
|
Loading…
Reference in a new issue