Dieser Commit ist enthalten in:
Ursprung
3d07e83d02
Commit
94240a10e7
@ -19,7 +19,7 @@
|
||||
|
||||
package de.steamwar.bausystem.gui;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.BauSystemPlugin;
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.gui.editor.BauGuiMapping;
|
||||
@ -51,7 +51,7 @@ public class BauGUI {
|
||||
public static ItemStack getGUI_ITEM(Player p) {
|
||||
ItemStack GUI_ITEM = new ItemStack(Material.NETHER_STAR);
|
||||
ItemMeta meta = GUI_ITEM.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.YELLOW + BauSystem.MESSAGE.parse("GUI_NAME", p));
|
||||
meta.setDisplayName(ChatColor.YELLOW + BauSystemPlugin.MESSAGE.parse("GUI_NAME", p));
|
||||
GUI_ITEM.setItemMeta(meta);
|
||||
return GUI_ITEM;
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class BauGUI {
|
||||
OPEN_INVS.add(p);
|
||||
}
|
||||
BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p);
|
||||
SWInventory inv = new SWInventory(p, mapping.getSize(), BauSystem.MESSAGE.parse("GUI_NAME", p));
|
||||
SWInventory inv = new SWInventory(p, mapping.getSize(), BauSystemPlugin.MESSAGE.parse("GUI_NAME", p));
|
||||
getITEMS().values().forEach(item -> {
|
||||
if (!mapping.isShown(item.getId())) {
|
||||
return;
|
||||
@ -81,7 +81,7 @@ public class BauGUI {
|
||||
}
|
||||
} else {
|
||||
p.closeInventory();
|
||||
BauSystem.MESSAGE.send("NO_PERMISSION", p);
|
||||
BauSystemPlugin.MESSAGE.send("NO_PERMISSION", p);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -108,9 +108,9 @@ public class BauGUI {
|
||||
if (!permission.hasPermission(p)) {
|
||||
List<String> lore = meta.getLore();
|
||||
if (lore == null) {
|
||||
lore = Collections.singletonList(BauSystem.MESSAGE.parse("NO_PERMISSION", p));
|
||||
lore = Collections.singletonList(BauSystemPlugin.MESSAGE.parse("NO_PERMISSION", p));
|
||||
} else {
|
||||
lore.add(BauSystem.MESSAGE.parse("NO_PERMISSION", p));
|
||||
lore.add(BauSystemPlugin.MESSAGE.parse("NO_PERMISSION", p));
|
||||
}
|
||||
meta.setLore(lore);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
package de.steamwar.bausystem.gui;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.BauSystemPlugin;
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
@ -41,8 +41,8 @@ public class BauGuiBauGuiItem extends BauGuiItem {
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(Player player) {
|
||||
return new SWItem(Material.NETHER_STAR, ChatColor.YELLOW + BauSystem.MESSAGE.parse("GUI_NAME", player),
|
||||
Arrays.asList(BauSystem.MESSAGE.parse("GUI_ITEM_LORE1", player), BauSystem.MESSAGE.parse("GUI_ITEM_LORE2", player)), false, clickType -> {
|
||||
return new SWItem(Material.NETHER_STAR, ChatColor.YELLOW + BauSystemPlugin.MESSAGE.parse("GUI_NAME", player),
|
||||
Arrays.asList(BauSystemPlugin.MESSAGE.parse("GUI_ITEM_LORE1", player), BauSystemPlugin.MESSAGE.parse("GUI_ITEM_LORE2", player)), false, clickType -> {
|
||||
}).getItemStack();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
package de.steamwar.bausystem.gui.editor;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.BauSystemPlugin;
|
||||
import de.steamwar.bausystem.gui.BauGUI;
|
||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
@ -54,7 +55,7 @@ public class BauGuiEditor implements Listener {
|
||||
|
||||
public static void openGuiEditor(Player p, ItemStack cursor) {
|
||||
BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p);
|
||||
Inventory inv = Bukkit.createInventory(null, mapping.getSize() + 9, BauSystem.MESSAGE.parse("GUI_EDITOR_TITLE", p));
|
||||
Inventory inv = Bukkit.createInventory(null, mapping.getSize() + 9, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_TITLE", p));
|
||||
for (Map.Entry<Integer, Integer> e : mapping.getMapping().entrySet()) {
|
||||
if (e.getValue() >= 0) {
|
||||
if (e.getValue() < mapping.getSize()) {
|
||||
@ -67,13 +68,13 @@ public class BauGuiEditor implements Listener {
|
||||
inv.setItem(j, new SWItem(Material.WHITE_STAINED_GLASS_PANE, "").getItemStack());
|
||||
}
|
||||
|
||||
inv.setItem(mapping.getSize() + 3, new SWItem(mapping.getSize() == 9 * 5 ? Material.GRAY_STAINED_GLASS_PANE : Material.LIME_STAINED_GLASS_PANE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_ROW_P", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 2, new SWItem(mapping.getSize() == 9 ? Material.GRAY_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_ROW_M", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 3, new SWItem(mapping.getSize() == 9 * 5 ? Material.GRAY_STAINED_GLASS_PANE : Material.LIME_STAINED_GLASS_PANE, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_ROW_P", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 2, new SWItem(mapping.getSize() == 9 ? Material.GRAY_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_ROW_M", p)).getItemStack());
|
||||
|
||||
inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH", p), Arrays.asList(BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH_LORE", p)), false, clickType -> {
|
||||
inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH", p), Arrays.asList(BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH_LORE", p)), false, clickType -> {
|
||||
}).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 6, new SWItem(Material.SCUTE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_MORE", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 8, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_CLOSE", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 6, new SWItem(Material.SCUTE, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_MORE", p)).getItemStack());
|
||||
inv.setItem(mapping.getSize() + 8, new SWItem(Material.ARROW, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_CLOSE", p)).getItemStack());
|
||||
|
||||
p.openInventory(inv);
|
||||
p.getOpenInventory().setCursor(cursor == null ? new SWItem().getItemStack() : cursor);
|
||||
@ -152,7 +153,7 @@ public class BauGuiEditor implements Listener {
|
||||
if (items.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
SWListInv<BauGuiItem> inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("GUI_EDITOR_TITLE_MORE", p), items, (clickType, item) -> {
|
||||
SWListInv<BauGuiItem> inv = new SWListInv<>(p, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_TITLE_MORE", p), items, (clickType, item) -> {
|
||||
openGuiEditor(p, addId(item.getItem(p), item.getId()));
|
||||
});
|
||||
inv.open();
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
package de.steamwar.bausystem.gui.editor;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.BauSystemPlugin;
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
@ -43,7 +43,7 @@ public class BauGuiEditorGuiItem extends BauGuiItem {
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(Player player) {
|
||||
return new SWItem(Material.IRON_PICKAXE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_NAME", player)).getItemStack();
|
||||
return new SWItem(Material.IRON_PICKAXE, BauSystemPlugin.MESSAGE.parse("GUI_EDITOR_ITEM_NAME", player)).getItemStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package de.steamwar.bausystem;
|
||||
|
||||
import de.steamwar.bausystem.permission.PermissionSystem;
|
||||
import de.steamwar.bausystem.region.RegionSystem;
|
||||
import de.steamwar.message.Message;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -39,6 +41,15 @@ public class BauSystemPlugin extends JavaPlugin {
|
||||
MESSAGE = new Message("BauSystem", getClassLoader());
|
||||
instance = this;
|
||||
|
||||
try {
|
||||
Bukkit.getLogger().log(Level.INFO, PermissionSystem.impl.getClass() + " impl loaded for PermissionSystem");
|
||||
Bukkit.getLogger().log(Level.INFO, RegionSystem.impl.getClass() + " impl loaded for RegionSystem");
|
||||
} catch (Exception e) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||
Bukkit.shutdown();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> clazz = Class.forName("de.steamwar.bausystem.LinkageUtils");
|
||||
Method method = clazz.getMethod("link");
|
||||
@ -58,6 +69,7 @@ public class BauSystemPlugin extends JavaPlugin {
|
||||
method.invoke(null);
|
||||
} catch (Exception e) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||
Bukkit.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren