This commit is contained in:
marc-go
2026-01-17 18:53:05 +01:00
parent 9b1ac0aae7
commit 67eda9ace1
3 changed files with 35 additions and 29 deletions

View File

@@ -6,6 +6,7 @@ import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
@@ -24,7 +25,7 @@ public final class folterplugin extends JavaPlugin {
saveDefaultConfig(); saveDefaultConfig();
// Plugin startup logic // Plugin startup logic
getCommand("folterkammer"); getCommand("folterkammer").setExecutor(this);
getLogger().info("Folterkammer Plugin geladen!"); getLogger().info("Folterkammer Plugin geladen!");
} }
@@ -62,23 +63,23 @@ public final class folterplugin extends JavaPlugin {
switch (mode) { switch (mode) {
case "enter": case "enter":
List<?> folterkammer = getConfig().getStringList("positions.folterkammer"); ConfigurationSection folterkammer = getConfig().getConfigurationSection("positions.folterkammer");
world = Bukkit.getWorld(folterkammer.get(0).toString()); world = Bukkit.getWorld(folterkammer.getString("world"));
x = ((Number) folterkammer.get(1)).intValue(); x = folterkammer.getInt("x");
y = ((Number) folterkammer.get(2)).intValue(); y = folterkammer.getInt("y");
z = ((Number) folterkammer.get(3)).intValue(); z = folterkammer.getInt("z");
Location folter_loc = new Location(world, x, y, z); Location folter_loc = new Location(world, x, y, z);
player.teleport(folter_loc); player.teleport(folter_loc);
case "exit": case "exit":
List<?> spawn = getConfig().getStringList("positions.spawn"); ConfigurationSection spawn = getConfig().getConfigurationSection("positions.spawn");
world = Bukkit.getWorld(spawn.get(0).toString()); world = Bukkit.getWorld(spawn.getString("world"));
x = ((Number) spawn.get(1)).intValue(); x = spawn.getInt("x");
y = ((Number) spawn.get(2)).intValue(); y = spawn.getInt("y");
z = ((Number) spawn.get(3)).intValue(); z = spawn.getInt("z");
Location spawn_loc = new Location(world, x, y, z); Location spawn_loc = new Location(world, x, y, z);
player.teleport(spawn_loc); player.teleport(spawn_loc);
@@ -99,12 +100,12 @@ public final class folterplugin extends JavaPlugin {
Player target = Bukkit.getPlayer(args[1]); Player target = Bukkit.getPlayer(args[1]);
List<?> folter_spawn = getConfig().getStringList("positions.spawn"); ConfigurationSection folter_spawn = getConfig().getConfigurationSection("positions.folterkammer_player");
world = Bukkit.getWorld(folter_spawn.get(0).toString()); world = Bukkit.getWorld(folter_spawn.getString("world"));
x = ((Number) folter_spawn.get(1)).intValue(); x = folter_spawn.getInt("x");
y = ((Number) folter_spawn.get(2)).intValue(); y = folter_spawn.getInt("y");
z = ((Number) folter_spawn.get(3)).intValue(); z = folter_spawn.getInt("z");
Location folter_spawn_loc = new Location(world, x, y, z); Location folter_spawn_loc = new Location(world, x, y, z);
target.teleport(folter_spawn_loc); target.teleport(folter_spawn_loc);
@@ -144,6 +145,8 @@ public final class folterplugin extends JavaPlugin {
player.getInventory().addItem(tag2); player.getInventory().addItem(tag2);
default:
player.sendMessage("§cHast du dich vielleicht vertippt??");
} }
return true; return true;

View File

@@ -1,16 +1,16 @@
positions: positions:
folterkammer: folterkammer:
- minecraft:folterraum world: folterraum
- 21 x: 21
- 42 y: 42
- 29 z: 29
folterkammer_player: folterkammer_player:
- minecraft:folterraum world: folterraum
- 21 x: 21
- 38 y: 38
- 7 z: 7
spawn: spawn:
- minecraft:overworld world: world
- 500 x: 500
- 200 y: 200
- 494 z: 494

View File

@@ -10,4 +10,7 @@ commands:
permissions: permissions:
folter.use: folter.use:
description: Berechtigung für Folterer description: Berechtigung für Folterer
default: op default: op
folter.admin:
description: Berechtigung für Admins
default: op