-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerKit.java
More file actions
96 lines (74 loc) · 2.11 KB
/
Copy pathPlayerKit.java
File metadata and controls
96 lines (74 loc) · 2.11 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package net.onelitefeather.playerkits.kit;
import jakarta.persistence.*;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.onelitefeather.playerkits.kit.property.PlayerKitProperties;
import net.onelitefeather.playerkits.util.InventoryUtil;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
@Entity
@Table(name = "kits")
public final class PlayerKit {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Lob
@Column(name = "kit_content", columnDefinition = "longblob")
private byte[] contents;
@Column
private String name;
@Column(columnDefinition = "TEXT")
private String displayName;
@OneToOne
private PlayerKitProperties properties;
@NotNull
public Long getId() {
return id;
}
public void setId(@NotNull Long id) {
this.id = id;
}
public void setContents(byte[] contents) {
this.contents = contents;
}
public byte[] getContents() {
return contents;
}
@NotNull
public String getName() {
return name;
}
public void setName(@NotNull String name) {
this.name = name;
}
@NotNull
public Component displayName() {
return MiniMessage.miniMessage().deserialize(getDisplayName());
}
@NotNull
public String getDisplayName() {
return displayName != null ? displayName : name;
}
public void setDisplayName(@NotNull String displayName) {
this.displayName = displayName;
}
public void setProperties(@NotNull PlayerKitProperties properties) {
this.properties = properties;
}
@NotNull
public PlayerKitProperties getProperties() {
return properties;
}
public boolean isFirstJoin() {
return this.properties.isFirstJoin();
}
public boolean isOneTime() {
return this.properties.isOneTime();
}
public boolean isVisible() {
return this.properties.isVisible();
}
public Long getCooldownTime() {
return this.properties.getCooldownTime();
}
}