fix: resolve 266/375 checkstyle violations, add lolib jar
This commit is contained in:
parent
7df0c13ac4
commit
bfeecb0866
79 changed files with 773 additions and 292 deletions
|
|
@ -51,7 +51,10 @@ public class SingleLeaderboardMenu extends LPMenu {
|
|||
OfflinePlayer op = org.bukkit.Bukkit.getOfflinePlayer(entry.getKey());
|
||||
if (op.getName() != null && !op.getName().startsWith(".")) {
|
||||
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
||||
if (meta != null) { meta.setOwningPlayer(op); skull.setItemMeta(meta); }
|
||||
if (meta != null) {
|
||||
meta.setOwningPlayer(op);
|
||||
skull.setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ import org.jetbrains.annotations.NotNull;
|
|||
*
|
||||
* Real LoLib API:
|
||||
* InventoryGUI.create().title(String).rows(n).fill(item).setItem(slot, item, Consumer<InventoryClickEvent>).open(player)
|
||||
* ScrollableGUI.create().title(String).rows(n).addItem(item, Consumer<InventoryClickEvent>).scrollUpButton(item,slot).scrollDownButton(item,slot).open(player)
|
||||
* ScrollableGUI.create().title(String).rows(n).addItem(item, Consumer<InventoryClickEvent>)
|
||||
* .scrollUpButton(item,slot).scrollDownButton(item,slot).open(player)
|
||||
*
|
||||
* cancelAllClicks = true by default — items cannot be taken out automatically.
|
||||
* Handlers receive Consumer<InventoryClickEvent>, event is already cancelled before handler runs.
|
||||
|
|
@ -81,7 +82,9 @@ public abstract class LPMenu {
|
|||
|
||||
protected int[] distributeEvenly(int count, int start, int end) {
|
||||
int[] result = new int[count];
|
||||
if (count == 0) return result;
|
||||
if (count == 0) {
|
||||
return result;
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
result[i] = start + Math.round((float) i * (end - start) / Math.max(count - 1, 1));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ import dev.loki.loparkour.menu.settings.LangMenu;
|
|||
import dev.loki.loparkour.menu.settings.ParkourSettingsMenu;
|
||||
import dev.loki.loparkour.menu.settings.SettingsMenu;
|
||||
|
||||
public class Menus {
|
||||
public final class Menus {
|
||||
|
||||
private Menus() {
|
||||
}
|
||||
|
||||
// main
|
||||
public static MainMenu MAIN = new MainMenu();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,10 @@ public class PlayerManagementMenu extends LPMenu {
|
|||
if (!ParkourUser.isBedrockPlayer(other.player)
|
||||
&& other.getName() != null && !other.getName().startsWith(".")) {
|
||||
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
||||
if (meta != null) { meta.setOwningPlayer(other.player); skull.setItemMeta(meta); }
|
||||
if (meta != null) {
|
||||
meta.setOwningPlayer(other.player);
|
||||
skull.setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
|
||||
boolean muted = session.isMuted(other);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,10 @@ public class SpectatorMenu extends LPMenu {
|
|||
if (!ParkourUser.isBedrockPlayer(player)
|
||||
&& pp.getName() != null && !pp.getName().startsWith(".")) {
|
||||
SkullMeta meta = (SkullMeta) skull.getItemMeta();
|
||||
if (meta != null) { meta.setOwningPlayer(pp.player); skull.setItemMeta(meta); }
|
||||
if (meta != null) {
|
||||
meta.setOwningPlayer(pp.player);
|
||||
skull.setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
sessions.add(session);
|
||||
items.add(skull);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class LangMenu extends LPMenu {
|
|||
}
|
||||
gui = gui.setItem(10 + i, item, e -> {
|
||||
pp.locale = lang;
|
||||
pp._locale = lang;
|
||||
pp.locale = lang;
|
||||
pp.updateHotbar(); // Update hotbar with new language
|
||||
Menus.SETTINGS.open(player);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -158,7 +158,10 @@ public class ParkourSettingsMenu extends LPMenu {
|
|||
|
||||
ItemStack item = new ItemStack(style.getNext());
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) { meta.setDisplayName(ColorUtil.color("&#A020F0" + name)); item.setItemMeta(meta); }
|
||||
if (meta != null) {
|
||||
meta.setDisplayName(ColorUtil.color("&#A020F0" + name));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
|
||||
final Style s = style;
|
||||
gui = gui.setItem(slot++, item, e -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue