Fixing Some PR Stuff
Dieser Commit ist enthalten in:
Ursprung
79aab75d18
Commit
94c4d8107e
@ -27,9 +27,6 @@ class CommandDebugStick_15 {
|
|||||||
private CommandDebugStick_15(){}
|
private CommandDebugStick_15(){}
|
||||||
|
|
||||||
static void giveStick(Player player){
|
static void giveStick(Player player){
|
||||||
if(player.getInventory().getItemInMainHand().getType() == Material.AIR)
|
player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK, 1));
|
||||||
player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK));
|
|
||||||
else
|
|
||||||
player.getInventory().addItem(new ItemStack(Material.DEBUG_STICK));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.world.Detonator;
|
import de.steamwar.bausystem.world.Detonator;
|
||||||
import de.steamwar.bausystem.world.Welt;
|
import de.steamwar.bausystem.world.Welt;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -63,10 +62,7 @@ public class CommandDetonator implements CommandExecutor {
|
|||||||
case "wand":
|
case "wand":
|
||||||
case "detonator":
|
case "detonator":
|
||||||
case "item":
|
case "item":
|
||||||
if(player.getInventory().getItemInMainHand().getType() == Material.AIR)
|
|
||||||
player.getInventory().setItemInMainHand(Detonator.WAND);
|
player.getInventory().setItemInMainHand(Detonator.WAND);
|
||||||
else
|
|
||||||
player.getInventory().addItem(Detonator.WAND);
|
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
Detonator.getDetonator(player);
|
Detonator.getDetonator(player);
|
||||||
break;
|
break;
|
||||||
|
@ -138,7 +138,7 @@ public class CommandGUI implements CommandExecutor, Listener {
|
|||||||
inv.setItem(4, skull);
|
inv.setItem(4, skull);
|
||||||
}
|
}
|
||||||
|
|
||||||
inv.setItem(6, Material.BOOK, "§7Script Bücher", Arrays.asList("§7Aktuell §e" + ScriptBook.getBookCount() + " §7Bücher"), true, clickType -> {
|
inv.setItem(6, Material.BOOK, "§7Script Bücher", Arrays.asList("§7Aktuell §e" + PredefinedBook.getBookCount() + " §7Bücher"), true, clickType -> {
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
scriptBooksGUI(player);
|
scriptBooksGUI(player);
|
||||||
});
|
});
|
||||||
@ -355,12 +355,12 @@ public class CommandGUI implements CommandExecutor, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void scriptBooksGUI(Player player) {
|
private static void scriptBooksGUI(Player player) {
|
||||||
List<SWListInv.SWListEntry<ScriptBook>> entries = new ArrayList<>();
|
List<SWListInv.SWListEntry<PredefinedBook>> entries = new ArrayList<>();
|
||||||
List<ScriptBook> books = ScriptBook.getBooks();
|
List<PredefinedBook> books = PredefinedBook.getBooks();
|
||||||
books.forEach(scriptBook -> entries.add(new SWListInv.SWListEntry<>(new SWItem(scriptBook.getBookMat(), scriptBook.getName(), scriptBook.getLore(), false, clickType -> {}), scriptBook)));
|
books.forEach(predefinedBook -> entries.add(new SWListInv.SWListEntry<>(new SWItem(predefinedBook.getBookMat(), predefinedBook.getName(), predefinedBook.getLore(), false, clickType -> {}), predefinedBook)));
|
||||||
SWListInv<ScriptBook> inv = new SWListInv<>(player, "Script Bücher", entries, (clickType, scriptBook) -> {
|
SWListInv<PredefinedBook> inv = new SWListInv<>(player, "Script Bücher", entries, (clickType, predefinedBook) -> {
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
player.getInventory().addItem(scriptBook.toItemStack());
|
player.getInventory().addItem(predefinedBook.toItemStack());
|
||||||
});
|
});
|
||||||
inv.open();
|
inv.open();
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ package de.steamwar.bausystem.commands;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -47,10 +46,7 @@ public class CommandSkull implements CommandExecutor {
|
|||||||
assert sm != null;
|
assert sm != null;
|
||||||
sm.setDisplayName("§e" + args[0] + "§8s Kopf");
|
sm.setDisplayName("§e" + args[0] + "§8s Kopf");
|
||||||
is.setItemMeta(sm);
|
is.setItemMeta(sm);
|
||||||
if(p.getInventory().getItemInMainHand().getType() == Material.AIR)
|
|
||||||
p.getInventory().setItemInMainHand(is);
|
p.getInventory().setItemInMainHand(is);
|
||||||
else
|
|
||||||
p.getInventory().addItem(is);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,6 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||||||
|
|
||||||
public class CommandTNT implements CommandExecutor, Listener {
|
public class CommandTNT implements CommandExecutor, Listener {
|
||||||
|
|
||||||
private static TNTMode tntMode = Region.buildAreaEnabled() ? TNTMode.ONLY_TB : TNTMode.OFF;
|
|
||||||
|
|
||||||
public static TNTMode getTntMode() {
|
|
||||||
return tntMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum TNTMode {
|
public enum TNTMode {
|
||||||
ON("§aan"),
|
ON("§aan"),
|
||||||
ONLY_TB("§7Kein §eBaurahmen"),
|
ONLY_TB("§7Kein §eBaurahmen"),
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package de.steamwar.bausystem.world;
|
package de.steamwar.bausystem.world;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.core.VersionedCallable;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
@ -14,22 +13,22 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class ScriptBook {
|
public class PredefinedBook {
|
||||||
|
|
||||||
private static final FileConfiguration configuration;
|
private static final FileConfiguration configuration;
|
||||||
private static List<ScriptBook> bookCache;
|
private static List<PredefinedBook> bookCache;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
configuration = YamlConfiguration.loadConfiguration(new File(BauSystem.getPlugin().getDataFolder(), "books.yml"));
|
configuration = YamlConfiguration.loadConfiguration(new File(BauSystem.getPlugin().getDataFolder(), "books.yml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ScriptBook> getBooks() {
|
public static List<PredefinedBook> getBooks() {
|
||||||
if(bookCache != null)
|
if(bookCache != null)
|
||||||
return bookCache;
|
return bookCache;
|
||||||
List<ScriptBook> books = new ArrayList<>();
|
List<PredefinedBook> books = new ArrayList<>();
|
||||||
for (String book:configuration.getKeys(false)) {
|
for (String book:configuration.getKeys(false)) {
|
||||||
ConfigurationSection section = Objects.requireNonNull(configuration.getConfigurationSection(book));
|
ConfigurationSection section = Objects.requireNonNull(configuration.getConfigurationSection(book));
|
||||||
books.add(new ScriptBook(section));
|
books.add(new PredefinedBook(section));
|
||||||
}
|
}
|
||||||
bookCache = books;
|
bookCache = books;
|
||||||
return books;
|
return books;
|
||||||
@ -44,7 +43,7 @@ public class ScriptBook {
|
|||||||
private String author;
|
private String author;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
ScriptBook(ConfigurationSection section) {
|
PredefinedBook(ConfigurationSection section) {
|
||||||
this.lines = section.getStringList("lines");
|
this.lines = section.getStringList("lines");
|
||||||
this.lore = section.getStringList("lore");
|
this.lore = section.getStringList("lore");
|
||||||
this.author = section.getString("author", "§8Steam§eWar");
|
this.author = section.getString("author", "§8Steam§eWar");
|
In neuem Issue referenzieren
Einen Benutzer sperren