From 13219dc35258bdfe7fbae638edd33288099283f6 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 11 May 2020 13:25:45 +0200 Subject: [PATCH 1/4] Adding option for F3+N Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/listener/TestListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/TestListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/TestListener.java index f8636de..04c8464 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/TestListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/TestListener.java @@ -9,7 +9,6 @@ import de.steamwar.fightsystem.states.FightState; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.permissions.PermissionAttachment; import java.util.EnumSet; @@ -37,7 +36,8 @@ public class TestListener extends BasicListener { countdown = null; } - PermissionAttachment attachment = player.addAttachment(FightSystem.getPlugin()); + player.setOp(true); + /*PermissionAttachment attachment = player.addAttachment(FightSystem.getPlugin()); attachment.setPermission("fawe.permpack.basic", true); attachment.setPermission("minecraft.command.gamemode", true); attachment.setPermission("minecraft.command.tp", true); @@ -169,6 +169,6 @@ public class TestListener extends BasicListener { attachment.setPermission("worldedit.green", true); attachment.setPermission("worldedit.extinguish", true); attachment.setPermission("worldedit.calc", true); - attachment.setPermission("worldedit.fill", true); + attachment.setPermission("worldedit.fill", true);*/ } } From 1608f895a88e4ab7977bb42cb283e0126075b4d5 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 16 May 2020 16:59:35 +0200 Subject: [PATCH 2/4] Improving size of spectator space Signed-off-by: Lixfel --- .../fightsystem/listener/PlayerMoveListener.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java index 5abe77f..61aa744 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java @@ -40,13 +40,18 @@ public class PlayerMoveListener extends BasicListener { boolean inBlueArea = inArenaY && Region.isIn2DRange(to, Config.TeamBlueCornerX, Config.TeamBlueCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); boolean inRedArea = inArenaY && Region.isIn2DRange(to, Config.TeamRedCornerX, Config.TeamRedCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); - if(inBlueArea || inRedArea) { + if(inBlueArea){ if(fightTeam == null) reset(event, DENY_TEAM); - }else if(fightTeam != null && ( - FightSystem.getFightState() != FightState.ENTERN || player.getGameMode() == GameMode.SPECTATOR)){ + else if(fightTeam == Fight.getRedTeam() && player.getGameMode() == GameMode.SPECTATOR) + reset(event, DENY_ENTERN); + }else if(inRedArea){ + if(fightTeam == null) + reset(event, DENY_TEAM); + else if(fightTeam == Fight.getBlueTeam() && player.getGameMode() == GameMode.SPECTATOR) + reset(event, DENY_ENTERN); + }else if(fightTeam != null && FightSystem.getFightState() != FightState.ENTERN && player.getGameMode() != GameMode.SPECTATOR) reset(event, DENY_ENTERN); - } } @EventHandler From aeda617a55c6b5c8910bd0844f34efe988227151 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 21 May 2020 08:42:39 +0200 Subject: [PATCH 3/4] Make it possible to walk on the floor in prefight stage Signed-off-by: Lixfel --- FightSystem_API/src/de/steamwar/fightsystem/Config.java | 2 ++ .../steamwar/fightsystem/listener/PlayerMoveListener.java | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index 88bb7dc..afc767a 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -58,6 +58,7 @@ public class Config { public static final int ArenaMinZ; public static final int ArenaMaxX; public static final int ArenaMaxZ; + public static final boolean GroundWalkable; //schematic parameter public static final boolean OnlyPublicSchematics; @@ -154,6 +155,7 @@ public class Config { BorderFromSchematic = worldconfig.getInt("Arena.BorderFromSchematic"); AlignWater = worldconfig.getBoolean("Arena.AlignWater"); WaterDepth = worldconfig.getInt("Arena.WaterDepth"); + GroundWalkable = config.getBoolean("Arena.GroundWalkable"); SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType")); IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly"); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java index 61aa744..2584a99 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java @@ -70,14 +70,12 @@ public class PlayerMoveListener extends BasicListener { boolean inArenaY = to.getY() + 1.8 <= Config.upperArenaBorder; if(to.getY() <= Config.underArenaBorder) { - if(player.getGameMode() == GameMode.SPECTATOR){ + if(player.getGameMode() == GameMode.SPECTATOR || team == null) reset(event, DENY_ARENA); - }else if(FightSystem.getFightState() == FightState.RUNNING || FightSystem.getFightState() == FightState.ENTERN) + else if(FightSystem.getFightState().infight()) player.damage(2); - else if(team != null){ + else if(!Config.GroundWalkable) player.teleport(team.getSpawn()); - }else - reset(event, DENY_ARENA); }else if(team != null && !inArenaY){ reset(event, DENY_ARENA); } From 4fd9a6a2f8cef08deafaf8074f555d95337ef72b Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 21 May 2020 09:28:50 +0200 Subject: [PATCH 4/4] Choosable spawn offset Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/Config.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index afc767a..308d85c 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -156,6 +156,9 @@ public class Config { AlignWater = worldconfig.getBoolean("Arena.AlignWater"); WaterDepth = worldconfig.getInt("Arena.WaterDepth"); GroundWalkable = config.getBoolean("Arena.GroundWalkable"); + double teamBlueSpawnOffsetX = worldconfig.getDouble("Arena.SpawnOffset.x"); + double teamBlueSpawnOffsetY = worldconfig.getDouble("Arena.SpawnOffset.y"); + double teamBlueSpawnOffsetZ = worldconfig.getDouble("Arena.SpawnOffset.z"); SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType")); IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly"); @@ -245,8 +248,14 @@ public class Config { TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ; World world = Bukkit.getWorlds().get(0); - TeamBlueSpawn = new Location(world, TeamBluePasteX + 0.5, TeamBlueCornerY + (double)SchemsizeY + 0.5, TeamBluePasteZ + 0.5); - TeamRedSpawn = new Location(world, TeamRedPasteX + 0.5, TeamRedCornerY + (double)SchemsizeY + 0.5, TeamRedPasteZ + 0.5); + TeamBlueSpawn = new Location(world, + TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX, + TeamBlueCornerY + 0.5 + teamBlueSpawnOffsetY, + TeamBluePasteZ + 0.5 + teamBlueSpawnOffsetZ); + TeamRedSpawn = new Location(world, + TeamRedPasteX + 0.5 - teamBlueSpawnOffsetX, + TeamRedCornerY + 0.5 + teamBlueSpawnOffsetY, + TeamRedPasteZ + 0.5 - teamBlueSpawnOffsetZ); SpecSpawn = new Location(world, TeamBluePasteX + TeamBluetoReddistanceX/2.0, TeamBlueCornerY + TeamBluetoReddistanceY/2.0 + SchemsizeY/2.0,