1
1
package dev .klash .caramel .items ;
2
2
3
+ import dev .klash .caramel .items .components .CIComponent ;
3
4
import net .kyori .adventure .text .Component ;
4
5
import org .bukkit .Material ;
6
+ import org .jetbrains .annotations .ApiStatus ;
5
7
8
+ import java .util .Arrays ;
9
+ import java .util .Collections ;
6
10
import java .util .List ;
7
11
8
- public record CaramelItemDetail (String id , Component itemName , List <String > lore , int defaultStack , int modelData , Material itemBase , FoodProperties food ) {
9
-
12
+ public record CaramelItemDetail (String id , Component itemName , List <String > lore , int defaultStack , int modelData , Material itemBase , FoodProperties food , List <CIComponent > components ) {
10
13
public static class Builder {
11
14
private String id ;
12
15
private Component itemName ;
13
16
private List <String > lore ;
14
- private int defaultStack ;
17
+ private int defaultStack = 1 ;
15
18
private int modelData ;
16
19
private Material itemBase ;
17
- private FoodProperties food = null ;
20
+ @ ApiStatus .Experimental private FoodProperties food = null ;
21
+ @ ApiStatus .Experimental private List <CIComponent > components = Collections .emptyList ();
18
22
19
23
public Builder id (String id ) {
20
24
this .id = id ;
@@ -36,6 +40,7 @@ public Builder defaultStack(int defaultStack) {
36
40
return this ;
37
41
}
38
42
43
+ @ ApiStatus .Experimental
39
44
public Builder food (FoodProperties food ) {
40
45
this .food = food ;
41
46
return this ;
@@ -51,8 +56,20 @@ public Builder itemBase(Material itemBase) {
51
56
return this ;
52
57
}
53
58
59
+ @ ApiStatus .Experimental
60
+ public Builder components (List <CIComponent > components ) {
61
+ this .components = components ;
62
+ return this ;
63
+ }
64
+
65
+ @ ApiStatus .Experimental
66
+ public Builder components (CIComponent ... components ) {
67
+ this .components = Arrays .asList (components );
68
+ return this ;
69
+ }
70
+
54
71
public CaramelItemDetail build () {
55
- return new CaramelItemDetail (id , itemName , lore , defaultStack , modelData , itemBase , food );
72
+ return new CaramelItemDetail (id , itemName , lore , defaultStack , modelData , itemBase , food , components );
56
73
}
57
74
}
58
75
0 commit comments