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

View File

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

View File

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