add 1.17 entity meta

This commit is contained in:
Matt Worzala 2021-06-07 00:53:42 -04:00
parent 69e1dc7da1
commit 6cd0cf6bcc
No known key found for this signature in database
GPG Key ID: 439DBBE092854841
5 changed files with 74 additions and 1 deletions

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -70,5 +70,4 @@ public class ItemFrameMeta extends EntityMeta implements ObjectDataProvider {
WEST,
EAST
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}