Skip to content

Commit e0d609c

Browse files
committed
updated formatify to the new component properties serialization changes
1 parent b47d54e commit e0d609c

File tree

1 file changed

+2
-5
lines changed
  • scriptive-formatify/src/main/java/org/machinemc/scriptive/formatify/tag

1 file changed

+2
-5
lines changed

scriptive-formatify/src/main/java/org/machinemc/scriptive/formatify/tag/DefaultTags.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
import org.machinemc.scriptive.events.HoverEvent;
88
import org.machinemc.scriptive.formatify.exceptions.ParseException;
99
import org.machinemc.scriptive.formatify.parameter.*;
10-
import org.machinemc.scriptive.serialization.ComponentProperties;
1110
import org.machinemc.scriptive.style.Colour;
1211

1312
import java.util.Arrays;
1413
import java.util.Optional;
1514
import java.util.Set;
1615
import java.util.UUID;
1716

17+
@SuppressWarnings("unchecked")
1818
public interface DefaultTags {
1919

2020
TagResolver COLOR = TagResolver.builder()
@@ -77,22 +77,19 @@ public interface DefaultTags {
7777
HoverEvent<?> hoverEvent;
7878
if (action == HoverEvent.SHOW_TEXT) {
7979
Component value = arguments.pollOr(arguments.formatify()::parse, "'value' is not specified");
80-
//noinspection unchecked
8180
hoverEvent = new HoverEvent<>((HoverEvent.Action<HoverEvent.Text>) action, value);
8281
} else if (action == HoverEvent.SHOW_ITEM) {
8382
String id = arguments.pollOr("'id' is not specified");
8483
int amount = arguments.pollOrDefault(new IntegerParameter()::parse, 1);
8584
String tag = arguments.poll();
86-
//noinspection unchecked
8785
hoverEvent = new HoverEvent<>(
8886
(HoverEvent.Action<HoverEvent.Item>) action,
8987
new HoverEvent.Item(id, amount, tag)
9088
);
9189
} else {
9290
UUID id = arguments.pollOr(UUID::fromString, "'id' is not specified");
9391
String type = arguments.poll();
94-
ComponentProperties name = arguments.poll(arguments.formatify()::parse).getProperties();
95-
//noinspection unchecked
92+
Component name = arguments.poll(arguments.formatify()::parse);
9693
hoverEvent = new HoverEvent<>(
9794
(HoverEvent.Action<HoverEvent.Entity>) action,
9895
new HoverEvent.Entity(id, type, name)

0 commit comments

Comments
 (0)