|
7 | 7 | import org.machinemc.scriptive.events.HoverEvent;
|
8 | 8 | import org.machinemc.scriptive.formatify.exceptions.ParseException;
|
9 | 9 | import org.machinemc.scriptive.formatify.parameter.*;
|
10 |
| -import org.machinemc.scriptive.serialization.ComponentProperties; |
11 | 10 | import org.machinemc.scriptive.style.Colour;
|
12 | 11 |
|
13 | 12 | import java.util.Arrays;
|
14 | 13 | import java.util.Optional;
|
15 | 14 | import java.util.Set;
|
16 | 15 | import java.util.UUID;
|
17 | 16 |
|
| 17 | +@SuppressWarnings("unchecked") |
18 | 18 | public interface DefaultTags {
|
19 | 19 |
|
20 | 20 | TagResolver COLOR = TagResolver.builder()
|
@@ -77,22 +77,19 @@ public interface DefaultTags {
|
77 | 77 | HoverEvent<?> hoverEvent;
|
78 | 78 | if (action == HoverEvent.SHOW_TEXT) {
|
79 | 79 | Component value = arguments.pollOr(arguments.formatify()::parse, "'value' is not specified");
|
80 |
| - //noinspection unchecked |
81 | 80 | hoverEvent = new HoverEvent<>((HoverEvent.Action<HoverEvent.Text>) action, value);
|
82 | 81 | } else if (action == HoverEvent.SHOW_ITEM) {
|
83 | 82 | String id = arguments.pollOr("'id' is not specified");
|
84 | 83 | int amount = arguments.pollOrDefault(new IntegerParameter()::parse, 1);
|
85 | 84 | String tag = arguments.poll();
|
86 |
| - //noinspection unchecked |
87 | 85 | hoverEvent = new HoverEvent<>(
|
88 | 86 | (HoverEvent.Action<HoverEvent.Item>) action,
|
89 | 87 | new HoverEvent.Item(id, amount, tag)
|
90 | 88 | );
|
91 | 89 | } else {
|
92 | 90 | UUID id = arguments.pollOr(UUID::fromString, "'id' is not specified");
|
93 | 91 | String type = arguments.poll();
|
94 |
| - ComponentProperties name = arguments.poll(arguments.formatify()::parse).getProperties(); |
95 |
| - //noinspection unchecked |
| 92 | + Component name = arguments.poll(arguments.formatify()::parse); |
96 | 93 | hoverEvent = new HoverEvent<>(
|
97 | 94 | (HoverEvent.Action<HoverEvent.Entity>) action,
|
98 | 95 | new HoverEvent.Entity(id, type, name)
|
|
0 commit comments