mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-11 09:51:35 +01:00
Small fixes to MetadataDef (#2476)
This commit is contained in:
parent
1cced68722
commit
01099597c0
@ -34,7 +34,6 @@ public sealed class MetadataDef {
|
||||
public static final Entry<Byte> ENTITY_FLAGS = index(0, Metadata::Byte, (byte) 0);
|
||||
public static final Entry<Boolean> IS_ON_FIRE = bitMask(0, (byte) 0x01, false);
|
||||
public static final Entry<Boolean> IS_CROUCHING = bitMask(0, (byte) 0x02, false);
|
||||
public static final Entry<Boolean> UNUSED_RIDING = bitMask(0, (byte) 0x04, false);
|
||||
public static final Entry<Boolean> IS_SPRINTING = bitMask(0, (byte) 0x08, false);
|
||||
public static final Entry<Boolean> IS_SWIMMING = bitMask(0, (byte) 0x10, false);
|
||||
public static final Entry<Boolean> IS_INVISIBLE = bitMask(0, (byte) 0x20, false);
|
||||
@ -296,7 +295,6 @@ public sealed class MetadataDef {
|
||||
|
||||
public static sealed class AbstractHorse extends AgeableMob {
|
||||
public static final Entry<Byte> ABSTRACT_HORSE_FLAGS = index(0, Metadata::Byte, (byte) 0);
|
||||
public static final Entry<Boolean> UNUSED = bitMask(0, (byte) 0x01, false);
|
||||
public static final Entry<Boolean> IS_TAME = bitMask(0, (byte) 0x02, false);
|
||||
public static final Entry<Boolean> IS_SADDLED = bitMask(0, (byte) 0x04, false);
|
||||
public static final Entry<Boolean> HAS_BRED = bitMask(0, (byte) 0x08, false);
|
||||
@ -429,7 +427,6 @@ public sealed class MetadataDef {
|
||||
public static sealed class TameableAnimal extends AgeableMob {
|
||||
public static final Entry<Byte> TAMEABLE_ANIMAL_FLAGS = index(0, Metadata::Byte, (byte) 0);
|
||||
public static final Entry<Boolean> IS_SITTING = bitMask(0, (byte) 0x01, false);
|
||||
public static final Entry<Boolean> UNUSED = bitMask(0, (byte) 0x02, false);
|
||||
public static final Entry<Boolean> IS_TAMED = bitMask(0, (byte) 0x04, false);
|
||||
public static final Entry<@Nullable UUID> OWNER = index(1, Metadata::OptUUID, null);
|
||||
}
|
||||
@ -554,7 +551,6 @@ public sealed class MetadataDef {
|
||||
|
||||
public static final class Zombie extends Mob {
|
||||
public static final Entry<Boolean> IS_BABY = index(0, Metadata::Boolean, false);
|
||||
public static final Entry<Integer> UNUSED = index(1, Metadata::VarInt, 0);
|
||||
public static final Entry<Boolean> IS_BECOMING_DROWNED = index(2, Metadata::Boolean, false);
|
||||
}
|
||||
|
||||
|
@ -31,11 +31,11 @@ public class FoxMeta extends AnimalMeta {
|
||||
}
|
||||
|
||||
public boolean isFoxSneaking() {
|
||||
return metadata.get(MetadataDef.Fox.IS_SITTING);
|
||||
return metadata.get(MetadataDef.Fox.IS_CROUCHING);
|
||||
}
|
||||
|
||||
public void setFoxSneaking(boolean value) {
|
||||
metadata.set(MetadataDef.Fox.IS_SITTING, value);
|
||||
metadata.set(MetadataDef.Fox.IS_CROUCHING, value);
|
||||
}
|
||||
|
||||
public boolean isInterested() {
|
||||
|
@ -1,12 +1,24 @@
|
||||
package net.minestom.server.entity.metadata.item;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.MetadataDef;
|
||||
import net.minestom.server.entity.MetadataHolder;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EyeOfEnderMeta extends ThrownItemProjectileMeta {
|
||||
public class EyeOfEnderMeta extends EntityMeta {
|
||||
public EyeOfEnderMeta(@NotNull Entity entity, @NotNull MetadataHolder metadata) {
|
||||
super(entity, metadata);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ItemStack getItem() {
|
||||
return metadata.get(MetadataDef.EyeOfEnder.ITEM);
|
||||
}
|
||||
|
||||
public void setItem(@NotNull ItemStack value) {
|
||||
metadata.set(MetadataDef.EyeOfEnder.ITEM, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user