Small improvements

This commit is contained in:
SBDeveloper 2022-12-28 21:00:11 +01:00
parent f28519b19f
commit 7614f5adb5
3 changed files with 8 additions and 10 deletions

View file

@ -110,7 +110,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -122,7 +122,7 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>8.8.0</version>
<version>9.0.0</version>
</dependency>
<dependency>
<groupId>com.github.fierioziy.particlenativeapi</groupId>

View file

@ -16,7 +16,6 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import static nl.sbdeveloper.showapi.utils.MainUtil.__;
@ -34,12 +33,11 @@ public class ShowCueGUI extends Inventory {
Pagination pagination = contents.pagination();
List<ClickableItem> items = new ArrayList<>();
for (ShowCue cue : Shows.getPoints(showName).stream().sorted(Comparator.comparing(ShowCue::getTime)).collect(Collectors.toList())) {
items.add(ClickableItem.of(MainUtil.pointToItem(cue), e -> {
Shows.getPoints(showName).stream().sorted(Comparator.comparing(ShowCue::getTime))
.forEach(cue -> items.add(ClickableItem.of(MainUtil.pointToItem(cue), e -> {
Shows.removePoint(showName, cue);
open(player, pagination.getPage());
}));
}
})));
ClickableItem[] itemsArray = new ClickableItem[items.size()];
itemsArray = items.toArray(itemsArray);

View file

@ -50,7 +50,7 @@ public class MainUtil {
try {
Constructor<? extends TriggerTask> ctor = type.getTrigger().getConstructor(String[].class);
if (dataSplitter.length < type.getMinArgs()) return null;
return ctor.newInstance(new Object[] { dataSplitterNew });
return ctor.newInstance(dataSplitterNew);
} catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
return null;
}