20
20
21
21
package com .loohp .multichatdiscordsrvaddon .objectholders ;
22
22
23
+ import lombok .Getter ;
23
24
import net .kyori .adventure .key .Key ;
24
25
import net .kyori .adventure .text .Component ;
25
26
import net .kyori .adventure .text .format .NamedTextColor ;
26
27
27
28
import java .util .Optional ;
28
29
30
+ @ Getter
29
31
public class PaintingVariant {
30
32
31
- private static Optional < Component > getLegacyPaintingTitle (Key key ) {
32
- return Optional . of ( Component .translatable ("painting." + key .namespace () + "." + key .value () + ".title" ).color (NamedTextColor .YELLOW ) );
33
+ private static Component getLegacyPaintingTitle (Key key ) {
34
+ return Component .translatable ("painting." + key .namespace () + "." + key .value () + ".title" ).color (NamedTextColor .YELLOW );
33
35
}
34
36
35
- private static Optional < Component > getLegacyPaintingAuthor (Key key ) {
36
- return Optional . of ( Component .translatable ("painting." + key .namespace () + "." + key .value () + ".author" ).color (NamedTextColor .GRAY ) );
37
+ private static Component getLegacyPaintingAuthor (Key key ) {
38
+ return Component .translatable ("painting." + key .namespace () + "." + key .value () + ".author" ).color (NamedTextColor .GRAY );
37
39
}
38
40
39
41
private final Key key ;
@@ -42,10 +44,10 @@ private static Optional<Component> getLegacyPaintingAuthor(Key key) {
42
44
private final int blockWidth ;
43
45
private final int blockHeight ;
44
46
45
- private final Optional < Component > title ;
46
- private final Optional < Component > author ;
47
+ private final Component title ;
48
+ private final Component author ;
47
49
48
- public PaintingVariant (Key key , int offsetX , int offsetY , int blockWidth , int blockHeight , Optional < Component > title , Optional < Component > author ) {
50
+ public PaintingVariant (Key key , int offsetX , int offsetY , int blockWidth , int blockHeight , Component title , Component author ) {
49
51
this .key = key ;
50
52
this .offsetX = offsetX ;
51
53
this .offsetY = offsetY ;
@@ -55,7 +57,7 @@ public PaintingVariant(Key key, int offsetX, int offsetY, int blockWidth, int bl
55
57
this .author = author ;
56
58
}
57
59
58
- public PaintingVariant (Key key , int blockWidth , int blockHeight , Optional < Component > title , Optional < Component > author ) {
60
+ public PaintingVariant (Key key , int blockWidth , int blockHeight , Component title , Component author ) {
59
61
this (key , 0 , 0 , blockWidth , blockHeight , title , author );
60
62
}
61
63
@@ -66,40 +68,4 @@ public PaintingVariant(Key key, int offsetX, int offsetY, int blockWidth, int bl
66
68
public PaintingVariant (Key key , int blockWidth , int blockHeight ) {
67
69
this (key , blockWidth , blockHeight , getLegacyPaintingTitle (key ), getLegacyPaintingAuthor (key ));
68
70
}
69
-
70
- public Key getKey () {
71
- return key ;
72
- }
73
-
74
- public int getOffsetX () {
75
- return offsetX ;
76
- }
77
-
78
- public int getOffsetY () {
79
- return offsetY ;
80
- }
81
-
82
- public int getPixelWidth () {
83
- return blockWidth * 16 ;
84
- }
85
-
86
- public int getPixelHeight () {
87
- return blockHeight * 16 ;
88
- }
89
-
90
- public int getBlockWidth () {
91
- return blockWidth ;
92
- }
93
-
94
- public int getBlockHeight () {
95
- return blockHeight ;
96
- }
97
-
98
- public Optional <Component > getTitle () {
99
- return title ;
100
- }
101
-
102
- public Optional <Component > getAuthor () {
103
- return author ;
104
- }
105
71
}
0 commit comments