diff --git a/CommonCore/SQL/src/de/steamwar/sql/CheckedSchematic.java b/CommonCore/SQL/src/de/steamwar/sql/CheckedSchematic.java index 59ed8d2f..aa1e0986 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/CheckedSchematic.java +++ b/CommonCore/SQL/src/de/steamwar/sql/CheckedSchematic.java @@ -28,6 +28,7 @@ import lombok.Getter; import java.sql.Timestamp; import java.util.List; +import java.util.concurrent.CompletableFuture; @AllArgsConstructor public class CheckedSchematic { diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index 7bac2bee..11a2a07d 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -59,6 +59,7 @@ public class Config { public static final Region RedExtendRegion; public static final Region ArenaRegion; public static final Region PlayerRegion; + public static final Region BlueInsetRegion; public static final Location TeamBlueSpawn; public static final Location TeamRedSpawn; @@ -193,6 +194,11 @@ public class Config { ReplaceWithBlockupdates = config.getBoolean("Schematic.ReplaceWithBlockupdates", false); UnlimitedPrepare = config.getBoolean("Schematic.UnlimitedPrepare", false); + int schemInsetX = config.getInt("Schematic.Inset.x", 0); + int schemInsetZ = config.getInt("Schematic.Inset.z", 0); + int schemInsetBottom = config.getInt("Schematic.Inset.bottom", 0); + int schemInsetTop = config.getInt("Schematic.Inset.top", 0); + GameName = config.getString("GameName", "WarGear"); TeamChatDetection = config.getString("TeamChatPrefix", "+"); @@ -318,6 +324,8 @@ public class Config { ArenaRegion = Region.withExtension(arenaMinX, blueCornerY, arenaMinZ, arenaMaxX - arenaMinX, schemsizeY, arenaMaxZ - arenaMinZ, 0, PreperationArea, 0); PlayerRegion = new Region(arenaMinX, underBorder, arenaMinZ, arenaMaxX, world.getMaxHeight(), arenaMaxZ); + BlueInsetRegion = new Region(BluePasteRegion.getMinX() + schemInsetX, BluePasteRegion.getMinY() + schemInsetBottom, BluePasteRegion.getMinZ() + schemInsetZ, BluePasteRegion.getMaxX() - schemInsetX, BluePasteRegion.getMaxY() - schemInsetTop, BluePasteRegion.getMaxZ() - schemInsetZ); + int eventKampfID = Integer.parseInt(System.getProperty("fightID", "0")); if(eventKampfID >= 1){ EventKampf = EventFight.get(eventKampfID); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index bff38170..ce47ee34 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -177,6 +177,8 @@ public class FightSystem extends JavaPlugin { Fight.getRedTeam().setSchem(unpreparedSchematicNode); } } + + new TechareaCommand(); }else if(Config.mode == ArenaMode.PREPARE) { Fight.getUnrotated().setSchem(SchematicNode.getSchematicNode(Config.PrepareSchemID)); } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/TechareaCommand.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/TechareaCommand.java new file mode 100644 index 00000000..64eb1105 --- /dev/null +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/TechareaCommand.java @@ -0,0 +1,49 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2025 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.commands; + +import de.steamwar.command.SWCommand; +import de.steamwar.entity.CWireframe; +import de.steamwar.entity.REntityServer; +import de.steamwar.fightsystem.Config; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +public class TechareaCommand extends SWCommand { + private final REntityServer server = new REntityServer(); + private final CWireframe wireframe = new CWireframe(server); + + public TechareaCommand() { + super("techarea"); + + wireframe.setPos1(Config.BlueInsetRegion.getMinLocation(Config.world)); + wireframe.setPos2(Config.BlueInsetRegion.getMaxLocation(Config.world)); + wireframe.setBlock(Material.RED_CONCRETE.createBlockData()); + } + + @Register + public void genericCommand(Player player) { + if (server.getPlayers().contains(player)) { + server.removePlayer(player); + } else { + server.addPlayer(player); + } + } +} diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java index 60d37be8..2d881513 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Region.java @@ -23,6 +23,7 @@ import de.steamwar.techhider.ProtocolUtils; import lombok.AllArgsConstructor; import lombok.Getter; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.block.Block; import java.util.function.ObjIntConsumer; @@ -77,6 +78,14 @@ public class Region { return ProtocolUtils.posToChunk(maxZ); } + public Location getMinLocation(World world) { + return new Location(world, minX, minY, minZ); + } + + public Location getMaxLocation(World world) { + return new Location(world, maxX, maxY, maxZ); + } + public boolean chunkOutside(int cX, int cZ) { return getMinChunkX() > cX || cX > getMaxChunkX() || getMinChunkZ() > cZ || cZ > getMaxChunkZ();