mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Fix shulker meta (#80)
This commit is contained in:
parent
ccdc5535e3
commit
d798a8128e
@ -1,6 +1,5 @@
|
||||
package net.minestom.server.entity.metadata.golem;
|
||||
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.utils.Direction;
|
||||
@ -8,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ShulkerMeta extends AbstractGolemMeta {
|
||||
public static final byte OFFSET = AbstractGolemMeta.MAX_OFFSET;
|
||||
public static final byte MAX_OFFSET = OFFSET + 4;
|
||||
public static final byte MAX_OFFSET = OFFSET + 3;
|
||||
|
||||
public ShulkerMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
|
||||
super(entity, metadata);
|
||||
@ -22,28 +21,20 @@ public class ShulkerMeta extends AbstractGolemMeta {
|
||||
super.metadata.setIndex(OFFSET, Metadata.Direction(value));
|
||||
}
|
||||
|
||||
public Point getAttachmentPosition() {
|
||||
return super.metadata.getIndex(OFFSET + 1, null);
|
||||
}
|
||||
|
||||
public void setAttachmentPosition(Point value) {
|
||||
super.metadata.setIndex(OFFSET + 1, Metadata.OptPosition(value));
|
||||
}
|
||||
|
||||
public byte getShieldHeight() {
|
||||
return super.metadata.getIndex(OFFSET + 2, (byte) 0);
|
||||
return super.metadata.getIndex(OFFSET + 1, (byte) 0);
|
||||
}
|
||||
|
||||
public void setShieldHeight(byte value) {
|
||||
super.metadata.setIndex(OFFSET + 2, Metadata.Byte(value));
|
||||
super.metadata.setIndex(OFFSET + 1, Metadata.Byte(value));
|
||||
}
|
||||
|
||||
public byte getColor() {
|
||||
return super.metadata.getIndex(OFFSET + 3, (byte) 10);
|
||||
return super.metadata.getIndex(OFFSET + 2, (byte) 10);
|
||||
}
|
||||
|
||||
public void setColor(byte value) {
|
||||
super.metadata.setIndex(OFFSET + 3, Metadata.Byte(value));
|
||||
super.metadata.setIndex(OFFSET + 2, Metadata.Byte(value));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user