feat: add wolf variants
This commit is contained in:
parent
30bd847ac0
commit
b7b69c3637
1 changed files with 13 additions and 1 deletions
|
|
@ -1,19 +1,31 @@
|
||||||
package me.tofaa.entitylib.meta.mobs.tameable;
|
package me.tofaa.entitylib.meta.mobs.tameable;
|
||||||
|
|
||||||
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
|
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
|
||||||
|
import com.github.retrooper.packetevents.protocol.entity.wolfvariant.WolfVariant;
|
||||||
|
import com.github.retrooper.packetevents.protocol.entity.wolfvariant.WolfVariants;
|
||||||
import me.tofaa.entitylib.extras.DyeColor;
|
import me.tofaa.entitylib.extras.DyeColor;
|
||||||
import me.tofaa.entitylib.meta.Metadata;
|
import me.tofaa.entitylib.meta.Metadata;
|
||||||
import me.tofaa.entitylib.meta.types.TameableMeta;
|
import me.tofaa.entitylib.meta.types.TameableMeta;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class WolfMeta extends TameableMeta {
|
public class WolfMeta extends TameableMeta {
|
||||||
|
|
||||||
public static final byte OFFSET = TameableMeta.MAX_OFFSET;
|
public static final byte OFFSET = TameableMeta.MAX_OFFSET;
|
||||||
public static final byte MAX_OFFSET = OFFSET + 3;
|
public static final byte MAX_OFFSET = OFFSET + 5;
|
||||||
|
|
||||||
public WolfMeta(int entityId, Metadata metadata) {
|
public WolfMeta(int entityId, Metadata metadata) {
|
||||||
super(entityId, metadata);
|
super(entityId, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public WolfVariant getVariant() {
|
||||||
|
return super.metadata.getIndex(offset(OFFSET, 3), WolfVariants.PALE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVariant(@NotNull WolfVariant value) {
|
||||||
|
super.metadata.setIndex(offset(OFFSET, 3), EntityDataTypes.TYPED_WOLF_VARIANT, value);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isBegging() {
|
public boolean isBegging() {
|
||||||
return super.metadata.getIndex(OFFSET, false);
|
return super.metadata.getIndex(OFFSET, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue