mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
add 1.17 entity meta
This commit is contained in:
parent
69e1dc7da1
commit
6cd0cf6bcc
@ -0,0 +1,22 @@
|
||||
package net.minestom.server.entity.metadata.animal;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GoatMeta extends AnimalMeta {
|
||||
public static final byte OFFSET = AnimalMeta.MAX_OFFSET;
|
||||
public static final byte MAX_OFFSET = OFFSET + 1;
|
||||
|
||||
protected GoatMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
|
||||
super(entity, metadata);
|
||||
}
|
||||
|
||||
public boolean isScreaming() {
|
||||
return metadata.getIndex(OFFSET, false);
|
||||
}
|
||||
|
||||
public void setScreaming(boolean screaming) {
|
||||
metadata.setIndex(OFFSET, Metadata.Boolean(screaming));
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GlowFrameMeta extends ItemFrameMeta {
|
||||
public static final byte OFFSET = ItemFrameMeta.MAX_OFFSET;
|
||||
public static final byte MAX_OFFSET = OFFSET + 0;
|
||||
|
||||
public GlowFrameMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
|
||||
super(entity, metadata);
|
||||
}
|
||||
}
|
@ -70,5 +70,4 @@ public class ItemFrameMeta extends EntityMeta implements ObjectDataProvider {
|
||||
WEST,
|
||||
EAST
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MarkerMeta extends EntityMeta {
|
||||
public static final byte OFFSET = EntityMeta.MAX_OFFSET;
|
||||
public static final byte MAX_OFFSET = OFFSET + 0;
|
||||
|
||||
public MarkerMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
|
||||
super(entity, metadata);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package net.minestom.server.entity.metadata.water;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GlowSquidMeta extends WaterAnimalMeta {
|
||||
public static final byte OFFSET = WaterAnimalMeta.MAX_OFFSET;
|
||||
public static final byte MAX_OFFSET = OFFSET + 1;
|
||||
|
||||
public GlowSquidMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
|
||||
super(entity, metadata);
|
||||
}
|
||||
|
||||
private int getDarkTicksRemaining() {
|
||||
return metadata.getIndex(OFFSET, 0);
|
||||
}
|
||||
|
||||
private void setDarkTicksRemaining(int ticks) {
|
||||
metadata.setIndex(OFFSET, Metadata.VarInt(ticks));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user