Small improvements
This commit is contained in:
parent
f28519b19f
commit
7614f5adb5
3 changed files with 8 additions and 10 deletions
4
pom.xml
4
pom.xml
|
@ -110,7 +110,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.19-R0.1-SNAPSHOT</version>
|
<version>1.19.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.cryptomorin</groupId>
|
<groupId>com.github.cryptomorin</groupId>
|
||||||
<artifactId>XSeries</artifactId>
|
<artifactId>XSeries</artifactId>
|
||||||
<version>8.8.0</version>
|
<version>9.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.fierioziy.particlenativeapi</groupId>
|
<groupId>com.github.fierioziy.particlenativeapi</groupId>
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.bukkit.entity.Player;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static nl.sbdeveloper.showapi.utils.MainUtil.__;
|
import static nl.sbdeveloper.showapi.utils.MainUtil.__;
|
||||||
|
|
||||||
|
@ -34,12 +33,11 @@ public class ShowCueGUI extends Inventory {
|
||||||
Pagination pagination = contents.pagination();
|
Pagination pagination = contents.pagination();
|
||||||
|
|
||||||
List<ClickableItem> items = new ArrayList<>();
|
List<ClickableItem> items = new ArrayList<>();
|
||||||
for (ShowCue cue : Shows.getPoints(showName).stream().sorted(Comparator.comparing(ShowCue::getTime)).collect(Collectors.toList())) {
|
Shows.getPoints(showName).stream().sorted(Comparator.comparing(ShowCue::getTime))
|
||||||
items.add(ClickableItem.of(MainUtil.pointToItem(cue), e -> {
|
.forEach(cue -> items.add(ClickableItem.of(MainUtil.pointToItem(cue), e -> {
|
||||||
Shows.removePoint(showName, cue);
|
Shows.removePoint(showName, cue);
|
||||||
open(player, pagination.getPage());
|
open(player, pagination.getPage());
|
||||||
}));
|
})));
|
||||||
}
|
|
||||||
|
|
||||||
ClickableItem[] itemsArray = new ClickableItem[items.size()];
|
ClickableItem[] itemsArray = new ClickableItem[items.size()];
|
||||||
itemsArray = items.toArray(itemsArray);
|
itemsArray = items.toArray(itemsArray);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class MainUtil {
|
||||||
try {
|
try {
|
||||||
Constructor<? extends TriggerTask> ctor = type.getTrigger().getConstructor(String[].class);
|
Constructor<? extends TriggerTask> ctor = type.getTrigger().getConstructor(String[].class);
|
||||||
if (dataSplitter.length < type.getMinArgs()) return null;
|
if (dataSplitter.length < type.getMinArgs()) return null;
|
||||||
return ctor.newInstance(new Object[] { dataSplitterNew });
|
return ctor.newInstance(dataSplitterNew);
|
||||||
} catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
|
} catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue