merged chestEx into environmentex
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 3m39s
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 3m39s
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
#Sun Jul 20 16:03:35 CEST 2025
|
|
||||||
gradle.version=8.14.2
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
plugins {
|
|
||||||
`java-library`
|
|
||||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
|
|
||||||
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
|
|
||||||
}
|
|
||||||
group = "de.hessj.chestex"
|
|
||||||
version = "1.0-SNAPSHOT"
|
|
||||||
description = "chestex"
|
|
||||||
|
|
||||||
tasks.withType<Jar> {
|
|
||||||
destinationDirectory.set(file("../"))
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
//implementation(files("../craftbukkit.jar"))
|
|
||||||
implementation(files("../helper-1.0-SNAPSHOT.jar"))
|
|
||||||
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
// Configure reobfJar to run when invoking the build task
|
|
||||||
assemble {
|
|
||||||
dependsOn(reobfJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
compileJava {
|
|
||||||
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
|
|
||||||
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
|
|
||||||
// See https://openjdk.java.net/jeps/247 for more information.
|
|
||||||
options.release.set(21)
|
|
||||||
}
|
|
||||||
javadoc {
|
|
||||||
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
}
|
|
||||||
processResources {
|
|
||||||
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
val props = mapOf(
|
|
||||||
"name" to project.name,
|
|
||||||
"version" to project.version,
|
|
||||||
"description" to project.description,
|
|
||||||
"apiVersion" to "1.21"
|
|
||||||
)
|
|
||||||
inputs.properties(props)
|
|
||||||
filesMatching("plugin.yml") {
|
|
||||||
expand(props)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
rootProject.name = "chestex"
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
package de.hessj.chestex;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.NamespacedKey;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.RecipeChoice;
|
|
||||||
import org.bukkit.inventory.ShapedRecipe;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
|
|
||||||
public class App extends JavaPlugin {
|
|
||||||
public static App main;
|
|
||||||
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();
|
|
||||||
public NamespacedKey nskLockedChest = new NamespacedKey(this, "R3SLockedChest");
|
|
||||||
public NamespacedKey nskLockedChestRecipe = new NamespacedKey(this, "R3SLockedChestRecipe");
|
|
||||||
public ItemStack lockedChest;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
getLogger().info("Plugin enabled!");
|
|
||||||
main = this;
|
|
||||||
|
|
||||||
|
|
||||||
lockedChest = new ItemStack(Material.CHEST);
|
|
||||||
ItemMeta imlockedChest = lockedChest.getItemMeta();
|
|
||||||
imlockedChest.displayName(Component.translatable(ChatColor.AQUA + "Verschlossene Truhe"));
|
|
||||||
imlockedChest.getPersistentDataContainer().set(nskLockedChest, PersistentDataType.STRING, "R3S_LockedChest");
|
|
||||||
lockedChest.setItemMeta(imlockedChest);
|
|
||||||
ShapedRecipe safechestRecipe = new ShapedRecipe(nskLockedChestRecipe, lockedChest);
|
|
||||||
RecipeChoice rc = new RecipeChoice.MaterialChoice(Material.OAK_LOG, Material.SPRUCE_LOG, Material.BIRCH_LOG,
|
|
||||||
Material.JUNGLE_LOG, Material.ACACIA_LOG, Material.DARK_OAK_LOG);
|
|
||||||
safechestRecipe.shape("LLL", "LKL", "III");
|
|
||||||
safechestRecipe.setIngredient('L', rc);
|
|
||||||
safechestRecipe.setIngredient('K', Material.TRIPWIRE_HOOK);
|
|
||||||
safechestRecipe.setIngredient('I', Material.IRON_INGOT);
|
|
||||||
if (getServer().getRecipe(nskLockedChestRecipe) == null) {
|
|
||||||
App.main.getServer().addRecipe(safechestRecipe);
|
|
||||||
}
|
|
||||||
listenerRegistration();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable() {
|
|
||||||
getLogger().info("Plugin disabled!");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listenerRegistration() {
|
|
||||||
PluginManager pM = Bukkit.getPluginManager();
|
|
||||||
pM.registerEvents(new SafeChestListener(), this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
main: de.hessj.chestex.App
|
|
||||||
name: ChestExPlugin
|
|
||||||
version: 0.1
|
|
||||||
api-version: 1.21
|
|
||||||
depend: [HelperPlugin]
|
|
||||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
Command: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -Xmx1G -classpath /Users/janik/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.11.1/6c1f29838864ba8f495855edfc8ef17706fedb5d/tiny-remapper-0.11.1-fat.jar net.fabricmc.tinyremapper.Main /Users/janik/Desktop/MCPlugins/environmentex-1.0-SNAPSHOT.jar /Users/janik/Desktop/MCPlugins/environmentex/build/libs/environmentex-1.0-SNAPSHOT-reobf.jar /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/reobfMappings.tiny mojang spigot /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/mappedServerJar.jar --threads=1
|
Command: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -Xmx1G -classpath /Users/janik/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.11.1/6c1f29838864ba8f495855edfc8ef17706fedb5d/tiny-remapper-0.11.1-fat.jar net.fabricmc.tinyremapper.Main /Users/janik/Desktop/MCPlugins/environmentex-1.0-SNAPSHOT.jar /Users/janik/Desktop/MCPlugins/environmentex/build/libs/environmentex-1.0-SNAPSHOT-reobf.jar /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/reobfMappings.tiny mojang spigot /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/mappedServerJar.jar --threads=1
|
||||||
[INFO] Finished after 880,98 ms.
|
[INFO] Finished after 974,94 ms.
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -650,7 +650,7 @@ code + .copy-button {
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function configurationCacheProblems() { return (
|
function configurationCacheProblems() { return (
|
||||||
// begin-report-data
|
// begin-report-data
|
||||||
{"diagnostics":[{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java"},{"taskPath":":compileJava"}],"problem":[{"text":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: /Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}],"contextualLabel":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.filename","displayName":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}]},{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"contextualLabel":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}]}],"problemsReport":{"totalProblemCount":2,"buildName":"environmentex","requestedTasks":"build","documentationLink":"https://docs.gradle.org/8.14.2/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
|
{"diagnostics":[{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/MobHeads.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}],"contextualLabel":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.plural","displayName":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}]},{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/MobHeads.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"contextualLabel":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}]}],"problemsReport":{"totalProblemCount":2,"buildName":"environmentex","requestedTasks":"build","documentationLink":"https://docs.gradle.org/8.14.2/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
|
||||||
// end-report-data
|
// end-report-data
|
||||||
);}
|
);}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Binary file not shown.
@@ -59,7 +59,9 @@ public class App extends JavaPlugin {
|
|||||||
public File tpYml = new File(this.getDataFolder() + "/texturepack.yml");
|
public File tpYml = new File(this.getDataFolder() + "/texturepack.yml");
|
||||||
public FileConfiguration tpConfig = YamlConfiguration.loadConfiguration(tpYml);
|
public FileConfiguration tpConfig = YamlConfiguration.loadConfiguration(tpYml);
|
||||||
|
|
||||||
|
public NamespacedKey nskLockedChest = new NamespacedKey(this, "R3SLockedChest");
|
||||||
|
public NamespacedKey nskLockedChestRecipe = new NamespacedKey(this, "R3SLockedChestRecipe");
|
||||||
|
public ItemStack lockedChest;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -76,6 +78,26 @@ public class App extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
SquidPrevention.removeSquidReceipes();
|
SquidPrevention.removeSquidReceipes();
|
||||||
SquidPrevention.addCustomSquidRecipes();
|
SquidPrevention.addCustomSquidRecipes();
|
||||||
|
|
||||||
|
main = this;
|
||||||
|
lockedChest = new ItemStack(Material.CHEST);
|
||||||
|
ItemMeta imlockedChest = lockedChest.getItemMeta();
|
||||||
|
imlockedChest.displayName(Component.translatable(ChatColor.AQUA + "Verschlossene Truhe"));
|
||||||
|
imlockedChest.getPersistentDataContainer().set(nskLockedChest, PersistentDataType.STRING, "R3S_LockedChest");
|
||||||
|
lockedChest.setItemMeta(imlockedChest);
|
||||||
|
ShapedRecipe safechestRecipe = new ShapedRecipe(nskLockedChestRecipe, lockedChest);
|
||||||
|
RecipeChoice rc = new RecipeChoice.MaterialChoice(Material.OAK_LOG, Material.SPRUCE_LOG, Material.BIRCH_LOG,
|
||||||
|
Material.JUNGLE_LOG, Material.ACACIA_LOG, Material.DARK_OAK_LOG);
|
||||||
|
safechestRecipe.shape("LLL", "LKL", "III");
|
||||||
|
safechestRecipe.setIngredient('L', rc);
|
||||||
|
safechestRecipe.setIngredient('K', Material.TRIPWIRE_HOOK);
|
||||||
|
safechestRecipe.setIngredient('I', Material.IRON_INGOT);
|
||||||
|
if (getServer().getRecipe(nskLockedChestRecipe) == null) {
|
||||||
|
App.main.getServer().addRecipe(safechestRecipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getServer().recipeIterator().forEachRemaining(recipe -> {
|
getServer().recipeIterator().forEachRemaining(recipe -> {
|
||||||
if (recipe instanceof ShapelessRecipe) {
|
if (recipe instanceof ShapelessRecipe) {
|
||||||
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
|
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
|
||||||
@@ -94,7 +116,7 @@ public class App extends JavaPlugin {
|
|||||||
}, 1000 * 20 / 1000, 1000 * 20 / 1000);
|
}, 1000 * 20 / 1000, 1000 * 20 / 1000);
|
||||||
|
|
||||||
getLogger().info("Plugin enabled!");
|
getLogger().info("Plugin enabled!");
|
||||||
main = this;
|
|
||||||
|
|
||||||
|
|
||||||
// if(App.main.getServer().getPort() == 25588){
|
// if(App.main.getServer().getPort() == 25588){
|
||||||
@@ -460,6 +482,7 @@ public class App extends JavaPlugin {
|
|||||||
pM.registerEvents(new SquidPrevention(), this);
|
pM.registerEvents(new SquidPrevention(), this);
|
||||||
pM.registerEvents(new EntityMuter(), this);
|
pM.registerEvents(new EntityMuter(), this);
|
||||||
pM.registerEvents(new BetterHoes(), this);
|
pM.registerEvents(new BetterHoes(), this);
|
||||||
|
pM.registerEvents(new ChestEx(), this);
|
||||||
getCommand("test").setExecutor(new EnvironmentExCommands());
|
getCommand("test").setExecutor(new EnvironmentExCommands());
|
||||||
getCommand("y").setExecutor(new EnvironmentExCommands());
|
getCommand("y").setExecutor(new EnvironmentExCommands());
|
||||||
getCommand("n").setExecutor(new EnvironmentExCommands());
|
getCommand("n").setExecutor(new EnvironmentExCommands());
|
||||||
|
|||||||
634
chestex/src/main/java/de/hessj/chestex/SafeChestListener.java → environmentex/src/main/java/de/hessj/environmentex/ChestEx.java
Executable file → Normal file
634
chestex/src/main/java/de/hessj/chestex/SafeChestListener.java → environmentex/src/main/java/de/hessj/environmentex/ChestEx.java
Executable file → Normal file
@@ -1,318 +1,318 @@
|
|||||||
package de.hessj.chestex;
|
package de.hessj.environmentex;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Chest;
|
import org.bukkit.block.Chest;
|
||||||
import org.bukkit.block.DoubleChest;
|
import org.bukkit.block.DoubleChest;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import de.hessj.helper.Helper.Type;
|
import de.hessj.helper.Helper.Type;
|
||||||
|
|
||||||
public class SafeChestListener implements Listener {
|
public class ChestEx implements Listener {
|
||||||
public Boolean lastPlacedIsSafeChest = false;
|
public Boolean lastPlacedIsSafeChest = false;
|
||||||
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();
|
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent e) {
|
public void onJoin(PlayerJoinEvent e) {
|
||||||
e.getPlayer().discoverRecipe(App.main.nskLockedChestRecipe);
|
e.getPlayer().discoverRecipe(App.main.nskLockedChestRecipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInteract(PlayerInteractEvent e) {
|
public void onInteract(PlayerInteractEvent e) {
|
||||||
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && !helper.isInteractable(e.getClickedBlock())) {
|
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && !helper.isInteractable(e.getClickedBlock())) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand() != null
|
if (e.getPlayer().getInventory().getItemInMainHand() != null
|
||||||
&& e.getPlayer().getInventory().getItemInMainHand().hasItemMeta() && e.getPlayer().getInventory()
|
&& e.getPlayer().getInventory().getItemInMainHand().hasItemMeta() && e.getPlayer().getInventory()
|
||||||
.getItemInMainHand().getItemMeta().getPersistentDataContainer() != null) {
|
.getItemInMainHand().getItemMeta().getPersistentDataContainer() != null) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer()
|
if (e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer()
|
||||||
.has(App.main.nskLockedChest, PersistentDataType.STRING)) {
|
.has(App.main.nskLockedChest, PersistentDataType.STRING)) {
|
||||||
lastPlacedIsSafeChest = true;
|
lastPlacedIsSafeChest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (e.getAction() == Action.RIGHT_CLICK_BLOCK && helper.isInteractable(e.getClickedBlock())) {
|
} else if (e.getAction() == Action.RIGHT_CLICK_BLOCK && helper.isInteractable(e.getClickedBlock())) {
|
||||||
Location loc = e.getClickedBlock().getLocation();
|
Location loc = e.getClickedBlock().getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
||||||
.contains(locStr)) {
|
.contains(locStr)) {
|
||||||
// is meine truhe
|
// is meine truhe
|
||||||
} else {
|
} else {
|
||||||
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
||||||
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
||||||
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
||||||
if (chestList.contains(locStr)) {
|
if (chestList.contains(locStr)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Dies ist nicht deine Truhe!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Dies ist nicht deine Truhe!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlace(BlockPlaceEvent e) {
|
public void onPlace(BlockPlaceEvent e) {
|
||||||
if (e.getBlockPlaced().getType().equals(Material.CHEST) && lastPlacedIsSafeChest) {
|
if (e.getBlockPlaced().getType().equals(Material.CHEST) && lastPlacedIsSafeChest) {
|
||||||
|
|
||||||
Chest chest = (Chest) e.getBlock().getState();
|
Chest chest = (Chest) e.getBlock().getState();
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(App.main, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(App.main, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
InventoryHolder holder = chest.getInventory().getHolder();
|
InventoryHolder holder = chest.getInventory().getHolder();
|
||||||
|
|
||||||
if (holder instanceof DoubleChest) {
|
if (holder instanceof DoubleChest) {
|
||||||
DoubleChest doubleChest = ((DoubleChest) holder);
|
DoubleChest doubleChest = ((DoubleChest) holder);
|
||||||
Chest leftChest = (Chest) doubleChest.getLeftSide();
|
Chest leftChest = (Chest) doubleChest.getLeftSide();
|
||||||
Chest rightChest = (Chest) doubleChest.getRightSide();
|
Chest rightChest = (Chest) doubleChest.getRightSide();
|
||||||
|
|
||||||
// WENN HIER DIE EINE IN CONFIG GEHÖRT PLAYER
|
// WENN HIER DIE EINE IN CONFIG GEHÖRT PLAYER
|
||||||
|
|
||||||
if (leftChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
if (leftChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
||||||
// rechte checken
|
// rechte checken
|
||||||
Location loc = rightChest.getLocation();
|
Location loc = rightChest.getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
|
|
||||||
if (!App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
if (!App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
||||||
.contains(locStr)) {
|
.contains(locStr)) {
|
||||||
e.getBlockPlaced().setType(Material.AIR);
|
e.getBlockPlaced().setType(Material.AIR);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
// HIER
|
// HIER
|
||||||
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(
|
e.getPlayer().getInventory().setItemInOffHand(
|
||||||
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
} else if (e.getHand() == EquipmentSlot.HAND) {
|
} else if (e.getHand() == EquipmentSlot.HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(
|
e.getPlayer().getInventory().setItemInMainHand(
|
||||||
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst diese Truhe nicht mit einer verschlossenen Truhe erweitern!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst diese Truhe nicht mit einer verschlossenen Truhe erweitern!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (rightChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
} else if (rightChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
||||||
// linke checken
|
// linke checken
|
||||||
Location loc = leftChest.getLocation();
|
Location loc = leftChest.getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
|
|
||||||
if (!App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
if (!App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
||||||
.contains(locStr)) {
|
.contains(locStr)) {
|
||||||
e.getBlockPlaced().setType(Material.AIR);
|
e.getBlockPlaced().setType(Material.AIR);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
// HIER
|
// HIER
|
||||||
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(
|
e.getPlayer().getInventory().setItemInOffHand(
|
||||||
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
} else if (e.getHand() == EquipmentSlot.HAND) {
|
} else if (e.getHand() == EquipmentSlot.HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(
|
e.getPlayer().getInventory().setItemInMainHand(
|
||||||
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst diese Truhe nicht mit einer verschlossenen Truhe erweitern!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst diese Truhe nicht mit einer verschlossenen Truhe erweitern!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HIER IN DING EINTRAGEN
|
// HIER IN DING EINTRAGEN
|
||||||
Location loc = e.getBlockPlaced().getLocation();
|
Location loc = e.getBlockPlaced().getLocation();
|
||||||
List<String> chestList = App.main.getConfig()
|
List<String> chestList = App.main.getConfig()
|
||||||
.getStringList("chests." + e.getPlayer().getUniqueId().toString());
|
.getStringList("chests." + e.getPlayer().getUniqueId().toString());
|
||||||
chestList.add(loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ());
|
chestList.add(loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ());
|
||||||
App.main.getConfig().set("chests." + e.getPlayer().getUniqueId().toString(), chestList);
|
App.main.getConfig().set("chests." + e.getPlayer().getUniqueId().toString(), chestList);
|
||||||
|
|
||||||
App.main.saveConfig();
|
App.main.saveConfig();
|
||||||
|
|
||||||
lastPlacedIsSafeChest = false;
|
lastPlacedIsSafeChest = false;
|
||||||
}
|
}
|
||||||
}, 1L);
|
}, 1L);
|
||||||
|
|
||||||
} else if (e.getBlockPlaced().getType().equals(Material.CHEST) && !lastPlacedIsSafeChest) {
|
} else if (e.getBlockPlaced().getType().equals(Material.CHEST) && !lastPlacedIsSafeChest) {
|
||||||
Chest chest = (Chest) e.getBlock().getState();
|
Chest chest = (Chest) e.getBlock().getState();
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(App.main, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(App.main, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
InventoryHolder holder = chest.getInventory().getHolder();
|
InventoryHolder holder = chest.getInventory().getHolder();
|
||||||
|
|
||||||
if (holder instanceof DoubleChest) {
|
if (holder instanceof DoubleChest) {
|
||||||
DoubleChest doubleChest = ((DoubleChest) holder);
|
DoubleChest doubleChest = ((DoubleChest) holder);
|
||||||
Chest leftChest = (Chest) doubleChest.getLeftSide();
|
Chest leftChest = (Chest) doubleChest.getLeftSide();
|
||||||
Chest rightChest = (Chest) doubleChest.getRightSide();
|
Chest rightChest = (Chest) doubleChest.getRightSide();
|
||||||
|
|
||||||
// WENN HIER DIE EINE IN CONFIG GEHÖRT PLAYER
|
// WENN HIER DIE EINE IN CONFIG GEHÖRT PLAYER
|
||||||
|
|
||||||
if (leftChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
if (leftChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
||||||
// rechte checken
|
// rechte checken
|
||||||
Location loc = rightChest.getLocation();
|
Location loc = rightChest.getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
|
|
||||||
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
||||||
.contains(locStr)) {
|
.contains(locStr)) {
|
||||||
e.getBlockPlaced().setType(Material.AIR);
|
e.getBlockPlaced().setType(Material.AIR);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
// HIER
|
// HIER
|
||||||
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(
|
e.getPlayer().getInventory().setItemInOffHand(
|
||||||
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
} else if (e.getHand() == EquipmentSlot.HAND) {
|
} else if (e.getHand() == EquipmentSlot.HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(
|
e.getPlayer().getInventory().setItemInMainHand(
|
||||||
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst eine verschlossene Truhe nicht mit einer anderen Truhe erweitern!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst eine verschlossene Truhe nicht mit einer anderen Truhe erweitern!"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (rightChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
} else if (rightChest.getLocation().equals(e.getBlockPlaced().getLocation())) {
|
||||||
// linke checken
|
// linke checken
|
||||||
Location loc = leftChest.getLocation();
|
Location loc = leftChest.getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
|
|
||||||
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString())
|
||||||
.contains(locStr)) {
|
.contains(locStr)) {
|
||||||
e.getBlockPlaced().setType(Material.AIR);
|
e.getBlockPlaced().setType(Material.AIR);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
// HIER
|
// HIER
|
||||||
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
if (e.getHand() == EquipmentSlot.OFF_HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInOffHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(
|
e.getPlayer().getInventory().setItemInOffHand(
|
||||||
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
e.getPlayer().getInventory().getItemInOffHand().add(1));
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInOffHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
} else if (e.getHand() == EquipmentSlot.HAND) {
|
} else if (e.getHand() == EquipmentSlot.HAND) {
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
if (e.getPlayer().getInventory().getItemInMainHand().getAmount() > 0) {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(
|
e.getPlayer().getInventory().setItemInMainHand(
|
||||||
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
e.getPlayer().getInventory().getItemInMainHand().add(1));
|
||||||
} else {
|
} else {
|
||||||
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
e.getPlayer().getInventory().setItemInMainHand(App.main.lockedChest);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst eine verschlossene Truhe nicht mit einer anderen Truhe erweitern!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Du kannst eine verschlossene Truhe nicht mit einer anderen Truhe erweitern!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1L);
|
}, 1L);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityExplodeEvent(EntityExplodeEvent event) {
|
public void onEntityExplodeEvent(EntityExplodeEvent event) {
|
||||||
List<Block> safelist = new ArrayList<Block>();
|
List<Block> safelist = new ArrayList<Block>();
|
||||||
for (Block block : event.blockList()) {
|
for (Block block : event.blockList()) {
|
||||||
if (block.getType() == Material.CHEST) {
|
if (block.getType() == Material.CHEST) {
|
||||||
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
||||||
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
||||||
if (chestList.contains(locStr)) {
|
if (chestList.contains(locStr)) {
|
||||||
safelist.add(block);
|
safelist.add(block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Block b : safelist) {
|
for (Block b : safelist) {
|
||||||
event.blockList().remove(b);
|
event.blockList().remove(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDestroy(BlockBreakEvent e) {
|
public void onDestroy(BlockBreakEvent e) {
|
||||||
if (!e.getBlock().getType().equals(Material.CHEST)) {
|
if (!e.getBlock().getType().equals(Material.CHEST)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location loc = e.getBlock().getLocation();
|
Location loc = e.getBlock().getLocation();
|
||||||
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
String locStr = loc.getBlockX() + "~" + loc.getBlockY() + "~" + loc.getBlockZ();
|
||||||
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString()).contains(locStr)) {
|
if (App.main.getConfig().getStringList("chests." + e.getPlayer().getUniqueId().toString()).contains(locStr)) {
|
||||||
List<String> chestList = App.main.getConfig()
|
List<String> chestList = App.main.getConfig()
|
||||||
.getStringList("chests." + e.getPlayer().getUniqueId().toString());
|
.getStringList("chests." + e.getPlayer().getUniqueId().toString());
|
||||||
chestList.remove(locStr);
|
chestList.remove(locStr);
|
||||||
App.main.getConfig().set("chests." + e.getPlayer().getUniqueId().toString(), chestList);
|
App.main.getConfig().set("chests." + e.getPlayer().getUniqueId().toString(), chestList);
|
||||||
App.main.saveConfig();
|
App.main.saveConfig();
|
||||||
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
Chest c = (Chest) e.getBlock().getState();
|
Chest c = (Chest) e.getBlock().getState();
|
||||||
|
|
||||||
for (ItemStack is : c.getBlockInventory()) {
|
for (ItemStack is : c.getBlockInventory()) {
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
|
|
||||||
e.getBlock().getWorld().dropItemNaturally(loc, is);
|
e.getBlock().getWorld().dropItemNaturally(loc, is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.getBlock().setType(Material.AIR);
|
e.getBlock().setType(Material.AIR);
|
||||||
|
|
||||||
e.getBlock().getWorld().dropItem(loc, App.main.lockedChest);
|
e.getBlock().getWorld().dropItem(loc, App.main.lockedChest);
|
||||||
} else {
|
} else {
|
||||||
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
if (App.main.getConfig().getConfigurationSection("chests") != null) {
|
||||||
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
for (String uuid : App.main.getConfig().getConfigurationSection("chests").getKeys(false)) {
|
||||||
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
List<String> chestList = App.main.getConfig().getStringList("chests." + uuid);
|
||||||
if (chestList.contains(locStr)) {
|
if (chestList.contains(locStr)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Dies ist nicht deine Truhe!"));
|
e.getPlayer().sendMessage(helper.R3SMessage(Type.ERROR, "[ChestEx] Dies ist nicht deine Truhe!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user