forked from Minestom/Minestom
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathInteractionMeta.java
More file actions
40 lines (30 loc) · 1.14 KB
/
InteractionMeta.java
File metadata and controls
40 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 InteractionMeta extends EntityMeta {
public static final byte OFFSET = EntityMeta.MAX_OFFSET;
public static final byte MAX_OFFSET = OFFSET + 3;
public InteractionMeta(@NotNull Entity entity, @NotNull Metadata metadata) {
super(entity, metadata);
}
public float getWidth() {
return super.metadata.getIndex(OFFSET, 0f);
}
public void setWidth(float value) {
super.metadata.setIndex(OFFSET, Metadata.Float(value));
}
public float getHeight() {
return super.metadata.getIndex(OFFSET + 1, 0f);
}
public void setHeight(float value) {
super.metadata.setIndex(OFFSET + 1, Metadata.Float(value));
}
public boolean getResponse() {
return super.metadata.getIndex(OFFSET + 2, false);
}
public void setResponse(boolean response) {
super.metadata.setIndex(OFFSET + 2, Metadata.Boolean(response));
}
}