Updated to latest BSB API's
This commit is contained in:
parent
578b908ebb
commit
85b32b66d1
|
@ -11,12 +11,12 @@ import org.bukkit.Material;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.api.panels.ClickType;
|
||||
import us.tastybento.bskyblock.api.panels.PanelItem;
|
||||
import us.tastybento.bskyblock.api.panels.PanelItem.ClickHandler;
|
||||
import us.tastybento.bskyblock.api.panels.builders.PanelBuilder;
|
||||
import us.tastybento.bskyblock.api.panels.builders.PanelItemBuilder;
|
||||
import us.tastybento.bskyblock.api.user.User;
|
||||
|
||||
public class WarpPanelManager {
|
||||
|
||||
|
@ -105,8 +105,8 @@ public class WarpPanelManager {
|
|||
// TODO use when locales are done.
|
||||
//PanelBuilder panelBuilder = new PanelBuilder().setUser(user).setName(user.getTranslation("panel.title", "[number]", String.valueOf(index + 1)));
|
||||
PanelBuilder panelBuilder = new PanelBuilder()
|
||||
.setUser(user)
|
||||
.setName(user.getTranslation("panel.title") + " " + String.valueOf(index + 1));
|
||||
.user(user)
|
||||
.name(user.getTranslation("panel.title") + " " + String.valueOf(index + 1));
|
||||
|
||||
int i = index * PANEL_MAX_SIZE;
|
||||
for (; i < (index * PANEL_MAX_SIZE + PANEL_MAX_SIZE) && i < warps.size(); i++) {
|
||||
|
@ -114,13 +114,13 @@ public class WarpPanelManager {
|
|||
if (!cachedWarps.containsKey(owner)) {
|
||||
cachedWarps.put(owner, getPanelItem(owner));
|
||||
}
|
||||
panelBuilder.addItem(cachedWarps.get(owner));
|
||||
panelBuilder.item(cachedWarps.get(owner));
|
||||
}
|
||||
final int panelNum = index;
|
||||
// Add signs
|
||||
if (i < warps.size()) {
|
||||
// Next
|
||||
panelBuilder.addItem(new PanelItemBuilder()
|
||||
panelBuilder.item(new PanelItemBuilder()
|
||||
.name("Next")
|
||||
.icon(new ItemStack(Material.SIGN))
|
||||
.clickHandler(new ClickHandler() {
|
||||
|
@ -136,7 +136,7 @@ public class WarpPanelManager {
|
|||
}
|
||||
if (i > PANEL_MAX_SIZE) {
|
||||
// Previous
|
||||
panelBuilder.addItem(new PanelItemBuilder()
|
||||
panelBuilder.item(new PanelItemBuilder()
|
||||
.name("Previous")
|
||||
.icon(new ItemStack(Material.SIGN))
|
||||
.clickHandler(new ClickHandler() {
|
||||
|
|
|
@ -2,7 +2,6 @@ package bskyblock.addin.warps;
|
|||
|
||||
import java.beans.IntrospectionException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -38,9 +37,9 @@ import bskyblock.addin.warps.event.WarpRemoveEvent;
|
|||
import bskyblock.addon.level.Level;
|
||||
import us.tastybento.bskyblock.BSkyBlock;
|
||||
import us.tastybento.bskyblock.Constants;
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.api.user.User;
|
||||
import us.tastybento.bskyblock.database.AbstractDatabaseHandler;
|
||||
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||
import us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler;
|
||||
import us.tastybento.bskyblock.database.objects.Island;
|
||||
|
||||
/**
|
||||
|
@ -209,7 +208,7 @@ public class WarpSignsManager implements Listener {
|
|||
Bukkit.getLogger().info("DEBUG: warpList size = " + warpList.size());
|
||||
}
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||
| SecurityException | ClassNotFoundException | IntrospectionException | SQLException e) {
|
||||
| SecurityException | ClassNotFoundException | IntrospectionException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -449,7 +448,7 @@ public class WarpSignsManager implements Listener {
|
|||
try {
|
||||
handler.saveObject(new WarpsData().save(warpList));
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException
|
||||
| InstantiationException | NoSuchMethodException | IntrospectionException | SQLException e) {
|
||||
| IntrospectionException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.UUID;
|
|||
import bskyblock.addin.warps.Warp;
|
||||
import us.tastybento.bskyblock.Constants;
|
||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.api.user.User;
|
||||
|
||||
/**
|
||||
* The /is warp <name> command
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
import bskyblock.addin.warps.Warp;
|
||||
import us.tastybento.bskyblock.Constants;
|
||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.api.user.User;
|
||||
|
||||
/**
|
||||
* @author ben
|
||||
|
|
Loading…
Reference in New Issue