Added ArmadilloMeta

This commit is contained in:
Oak 2024-06-14 12:18:16 +01:00
parent 08062bd3d5
commit 427bb61ef5
2 changed files with 25 additions and 1 deletions

View file

@ -48,7 +48,7 @@ final class MetaConverterRegistry {
MetaConverterRegistry() { MetaConverterRegistry() {
put(ABSTRACT_WIND_CHARGE, SmallFireballMeta.class, SmallFireballMeta::new); // TODO: Verify correctness put(ABSTRACT_WIND_CHARGE, SmallFireballMeta.class, SmallFireballMeta::new); // TODO: Verify correctness
put(AREA_EFFECT_CLOUD, AreaEffectCloudMeta.class, AreaEffectCloudMeta::new); put(AREA_EFFECT_CLOUD, AreaEffectCloudMeta.class, AreaEffectCloudMeta::new);
put(ARMADILLO, LivingEntityMeta.class, LivingEntityMeta::new); // TODO: Implement put(ARMADILLO, ArmadilloMeta.class, ArmadilloMeta::new); // TODO: Verify correctness
put(ARMOR_STAND, ArmorStandMeta.class, ArmorStandMeta::new); put(ARMOR_STAND, ArmorStandMeta.class, ArmorStandMeta::new);
put(ALLAY, LivingEntityMeta.class, LivingEntityMeta::new); // TODO: Implement put(ALLAY, LivingEntityMeta.class, LivingEntityMeta::new); // TODO: Implement
put(ARROW, ArrowMeta.class, ArrowMeta::new); put(ARROW, ArrowMeta.class, ArrowMeta::new);

View file

@ -0,0 +1,24 @@
package me.tofaa.entitylib.meta.mobs.passive;
import com.github.retrooper.packetevents.protocol.entity.armadillo.ArmadilloState;
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
import me.tofaa.entitylib.meta.Metadata;
import me.tofaa.entitylib.meta.types.AgeableMeta;
public class ArmadilloMeta extends AgeableMeta {
public static final byte OFFSET = AgeableMeta.MAX_OFFSET;
public static final byte MAX_OFFSET = OFFSET + 1;
public ArmadilloMeta(int entityId, Metadata metadata) {
super(entityId, metadata);
}
public ArmadilloState getState() {
return metadata.getIndex(OFFSET, ArmadilloState.IDLE);
}
public void setState(ArmadilloState state) {
super.metadata.setIndex(OFFSET, EntityDataTypes.ARMADILLO_STATE, state);
}
}