From 5c950368309abfedb2362875868124fa1f2b9ca9 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 24 Apr 2021 17:35:17 +0200 Subject: [PATCH 01/15] Improved Countdown start and scoreboard Signed-off-by: Lixfel --- .../fightsystem/countdown/Countdown.java | 9 ++++-- .../fightsystem/listener/FightScoreboard.java | 30 ++++++++----------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java index 6d224d1..4626f17 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java @@ -77,6 +77,7 @@ public abstract class Countdown { time = totalTime; task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::count, 20, 20); currentCountdowns.add(this); + show(); } public void disable() { @@ -97,9 +98,10 @@ public abstract class Countdown { smallestTime = countdown.time; } - smallestTime -= 2; + smallestTime--; for(Countdown countdown : currentCountdowns){ countdown.time -= smallestTime; + countdown.show(); } Bukkit.broadcastMessage(FightSystem.PREFIX + "§aBeide Teams waren damit einverstanden, zum nächsten Event zu beschleunigen!"); @@ -116,9 +118,12 @@ public abstract class Countdown { return time; } - void count(){ + void count() { time--; + show(); + } + private void show(){ switch (time) { case 900: case 600: case 300: case 180: case 120: broadcast("§rNoch §a" + time / 60 + " §rMinuten " + countdownCounting()); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/FightScoreboard.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/FightScoreboard.java index 7b98067..f0ceb64 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/FightScoreboard.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/FightScoreboard.java @@ -69,14 +69,6 @@ public class FightScoreboard implements Listener, ScoreboardCallback { SWScoreboard.removeScoreboard(event.getPlayer()); } - private void teamScoreboard(FightTeam fightTeam){ - setTitle(fightTeam.getColoredName()); - fightTeam.getPlayers().forEach(fp -> { - if(fp.isLiving()) - addScore(fightTeam.getPrefix() + fp.getPlayer().getName(), (int) Math.ceil(fp.getPlayer().getHealth())); - }); - } - private void generalScoreboard(){ setTitle("§eKampf"); List scoreList = new ArrayList<>(); @@ -105,17 +97,21 @@ public class FightScoreboard implements Listener, ScoreboardCallback { } } + private void teamScoreboard(FightTeam fightTeam){ + fightTeam.getPlayers().forEach(fp -> { + if(fp.isLiving()) + addScore(fightTeam.getPrefix() + fp.getPlayer().getName(), (int) Math.ceil(fp.getPlayer().getHealth())); + }); + } + private void updateScoreboard() { scores.clear(); - switch((index++ / 10) % 3){ - case 0: - generalScoreboard(); - break; - case 1: - teamScoreboard(Fight.getBlueTeam()); - break; - case 2: - teamScoreboard(Fight.getRedTeam()); + if ((index++ / 5) % 2 == 0) { + generalScoreboard(); + } else { + setTitle(Fight.getBlueTeam().getColoredName() + " " + Fight.getRedTeam().getColoredName()); + teamScoreboard(Fight.getBlueTeam()); + teamScoreboard(Fight.getRedTeam()); } } From 8cc92c5ac437542dae8e0fcb7907e402b01134e9 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 24 Apr 2021 20:18:39 +0200 Subject: [PATCH 02/15] Fix enterskip Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/countdown/Countdown.java | 4 ++-- .../de/steamwar/fightsystem/countdown/EnternCountdown.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java index 4626f17..35ef83b 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/Countdown.java @@ -118,12 +118,12 @@ public abstract class Countdown { return time; } - void count() { + private void count() { time--; show(); } - private void show(){ + void show(){ switch (time) { case 900: case 600: case 300: case 180: case 120: broadcast("§rNoch §a" + time / 60 + " §rMinuten " + countdownCounting()); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/EnternCountdown.java b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/EnternCountdown.java index 925bf69..f08a8fe 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/countdown/EnternCountdown.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/countdown/EnternCountdown.java @@ -52,9 +52,7 @@ public class EnternCountdown extends Countdown { } @Override - void count(){ - time--; - + void show(){ Player player = fightPlayer.getPlayer(); switch (time) { case 900: case 600: case 300: case 180: case 120: From dd61e67517c62d4fde49fa2311720df59344f9b4 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 26 Apr 2021 21:14:53 +0200 Subject: [PATCH 03/15] Speedy recoloring Signed-off-by: Lixfel --- .../fightsystem/fight/FightTeam_12.java | 34 ++++++---- .../fightsystem/fight/FightTeam_14.java | 65 ++++++++++++------- .../fightsystem/fight/FightTeam_8.java | 54 ++++++++------- .../fightsystem/fight/FightSchematic.java | 25 +++---- 4 files changed, 105 insertions(+), 73 deletions(-) diff --git a/FightSystem_12/src/de/steamwar/fightsystem/fight/FightTeam_12.java b/FightSystem_12/src/de/steamwar/fightsystem/fight/FightTeam_12.java index 5d382d9..0f3b5c6 100644 --- a/FightSystem_12/src/de/steamwar/fightsystem/fight/FightTeam_12.java +++ b/FightSystem_12/src/de/steamwar/fightsystem/fight/FightTeam_12.java @@ -19,12 +19,10 @@ package de.steamwar.fightsystem.fight; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.regions.CuboidRegion; -import de.steamwar.fightsystem.utils.Region; +import com.sk89q.worldedit.extent.clipboard.Clipboard; import org.bukkit.ChatColor; import org.bukkit.DyeColor; import org.bukkit.Material; @@ -52,17 +50,25 @@ class FightTeam_12 { team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OWN_TEAM); } + static void replaceTeamColor(Clipboard clipboard, DyeColor c) throws WorldEditException { + FightTeam_8.replaceTeamColor(clipboard, c); - @SuppressWarnings("deprecation") - static void replaceTeamColor(EditSession e, DyeColor c, Region r){ - FightTeam_8.replaceTeamColor(e, c, r); - CuboidRegion region = new CuboidRegion(new Vector(r.getMinX(), r.getMinY(), r.getMinZ()), new Vector(r.getMaxX(), r.getMaxY(), r.getMaxZ())); - try { - e.replaceBlocks(region, CONCRETE_SET, new BaseBlock(CONCRETE.getId(), c.getWoolData())); - e.replaceBlocks(region, CONCRETE_POWDER_SET, new BaseBlock(CONCRETE_POWDER.getId(), c.getWoolData())); - } catch (MaxChangedBlocksException ex) { - //ignored + Vector minimum = clipboard.getRegion().getMinimumPoint(); + BaseBlock concrete = new BaseBlock(CONCRETE.getId(), c.getWoolData()); + BaseBlock concretePowder = new BaseBlock(CONCRETE_POWDER.getId(), c.getWoolData()); + + for(int x = 0; x < clipboard.getDimensions().getX(); x++){ + for(int y = 0; y < clipboard.getDimensions().getY(); y++){ + for(int z = 0; z < clipboard.getDimensions().getZ(); z++){ + Vector pos = minimum.add(x, y, z); + BaseBlock block = clipboard.getBlock(pos); + if(block.equals(CONCRETE)){ + clipboard.setBlock(pos, concrete); + }else if(block.equals(CONCRETE_POWDER)){ + clipboard.setBlock(pos, concretePowder); + } + } + } } - e.flushQueue(); } } diff --git a/FightSystem_14/src/de/steamwar/fightsystem/fight/FightTeam_14.java b/FightSystem_14/src/de/steamwar/fightsystem/fight/FightTeam_14.java index 7a2b1ac..d648d9b 100644 --- a/FightSystem_14/src/de/steamwar/fightsystem/fight/FightTeam_14.java +++ b/FightSystem_14/src/de/steamwar/fightsystem/fight/FightTeam_14.java @@ -20,7 +20,6 @@ package de.steamwar.fightsystem.fight; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.bukkit.BukkitWorld; @@ -50,43 +49,60 @@ import org.bukkit.scoreboard.Team; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.util.Collections; import java.util.Objects; -import java.util.Set; public class FightTeam_14 { private FightTeam_14(){} - private static final Set WOOL_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_WOOL).getDefaultState().toBaseBlock()); - private static final Set CLAY_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_TERRACOTTA).getDefaultState().toBaseBlock()); - private static final Set GLASS_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS).getDefaultState().toBaseBlock()); - private static final Set GLASS_PANE_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS_PANE).getDefaultState().toBaseBlock()); - private static final Set CONCRETE_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_CONCRETE).getDefaultState().toBaseBlock()); - private static final Set CONCRETE_POWDER_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock()); - private static final Set CARPET_SET = Collections.singleton(Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock()); + private static final BaseBlock WOOL = Objects.requireNonNull(BlockTypes.PINK_WOOL).getDefaultState().toBaseBlock(); + private static final BaseBlock CLAY = Objects.requireNonNull(BlockTypes.PINK_TERRACOTTA).getDefaultState().toBaseBlock(); + private static final BaseBlock GLASS = Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS).getDefaultState().toBaseBlock(); + private static final BaseBlock GLASS_PANE = Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS_PANE).getDefaultState().toBaseBlock(); + private static final BaseBlock CONCRETE = Objects.requireNonNull(BlockTypes.PINK_CONCRETE).getDefaultState().toBaseBlock(); + private static final BaseBlock CONCRETE_POWDER = Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock(); + private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock(); static void setTeamColor(Team team, ChatColor color){ team.setColor(color); team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OWN_TEAM); } - static void replaceTeamColor(EditSession e, DyeColor c, Region r){ - CuboidRegion region = new CuboidRegion(BlockVector3.at(r.getMinX(), r.getMinY(), r.getMinZ()), BlockVector3.at(r.getMaxX(), r.getMaxY(), r.getMaxZ())); - try { - e.replaceBlocks(region, WOOL_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_wool")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, CARPET_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_carpet")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, CLAY_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_terracotta")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, GLASS_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_stained_glass")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, GLASS_PANE_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_stained_glass_pane")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, CONCRETE_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_concrete")).getDefaultState().toBaseBlock()); - e.replaceBlocks(region, CONCRETE_POWDER_SET, Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_concrete_powder")).getDefaultState().toBaseBlock()); - } catch (MaxChangedBlocksException ex) { - //ignored + static void replaceTeamColor(Clipboard clipboard, DyeColor c) throws WorldEditException { + BlockVector3 minimum = clipboard.getRegion().getMinimumPoint(); + BaseBlock wool = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_wool")).getDefaultState().toBaseBlock(); + BaseBlock clay = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_terracotta")).getDefaultState().toBaseBlock(); + BaseBlock glass = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_stained_glass")).getDefaultState().toBaseBlock(); + BaseBlock glassPane = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_stained_glass_pane")).getDefaultState().toBaseBlock(); + BaseBlock carpet = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_carpet")).getDefaultState().toBaseBlock(); + BaseBlock concrete = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_concrete")).getDefaultState().toBaseBlock(); + BaseBlock concretePowder = Objects.requireNonNull(BlockTypes.get(c.name().toLowerCase() + "_concrete_powder")).getDefaultState().toBaseBlock(); + + for(int x = 0; x < clipboard.getDimensions().getX(); x++){ + for(int y = 0; y < clipboard.getDimensions().getY(); y++){ + for(int z = 0; z < clipboard.getDimensions().getZ(); z++){ + BlockVector3 pos = minimum.add(x, y, z); + BaseBlock block = clipboard.getFullBlock(pos); + if(block.equals(WOOL)){ + clipboard.setBlock(pos, wool); + }else if(block.equals(CLAY)){ + clipboard.setBlock(pos, clay); + }else if(block.equals(GLASS)){ + clipboard.setBlock(pos, glass); + }else if(block.equals(GLASS_PANE)){ + clipboard.setBlock(pos, glassPane); + }else if(block.equals(CARPET)){ + clipboard.setBlock(pos, carpet); + }else if(block.equals(CONCRETE)){ + clipboard.setBlock(pos, concrete); + }else if(block.equals(CONCRETE_POWDER)){ + clipboard.setBlock(pos, concretePowder); + } + } + } } - e.flushSession(); } - static EditSession pasteSchematic(Clipboard clipboard, Region region, boolean rotate) throws Schematic.WrongVersionException, IOException, NoClipboardException { + static void pasteSchematic(Clipboard clipboard, Region region, boolean rotate) throws NoClipboardException { BlockVector3 paste = BlockVector3.at(region.centerX(), region.getMinY(), region.centerZ()); World w = new BukkitWorld(Bukkit.getWorlds().get(0)); @@ -116,7 +132,6 @@ public class FightTeam_14 { ch.setTransform(aT); Operations.completeBlindly(ch.createPaste(e).to(v).build()); e.flushSession(); - return e; } public static boolean checkPistonMoving(Block block){ diff --git a/FightSystem_8/src/de/steamwar/fightsystem/fight/FightTeam_8.java b/FightSystem_8/src/de/steamwar/fightsystem/fight/FightTeam_8.java index 54812ff..2894747 100644 --- a/FightSystem_8/src/de/steamwar/fightsystem/fight/FightTeam_8.java +++ b/FightSystem_8/src/de/steamwar/fightsystem/fight/FightTeam_8.java @@ -19,7 +19,10 @@ package de.steamwar.fightsystem.fight; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; @@ -45,8 +48,6 @@ import org.bukkit.scoreboard.Team; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.util.Collections; -import java.util.Set; public class FightTeam_8 { private FightTeam_8(){} @@ -65,32 +66,40 @@ public class FightTeam_8 { @SuppressWarnings("deprecation") private static final BaseBlock CARPET = new BaseBlock(Material.CARPET.getId(), COLOR_TO_REPLACE); - private static final Set WOOL_SET = Collections.singleton(WOOL); - private static final Set CLAY_SET = Collections.singleton(CLAY); - private static final Set GLASS_SET = Collections.singleton(GLASS); - private static final Set GLASS_PANE_SET = Collections.singleton(GLASS_PANE); - private static final Set CARPET_SET = Collections.singleton(CARPET); - static void setTeamColor(Team team, ChatColor color){ team.setPrefix("§" + color.getChar()); } - @SuppressWarnings("deprecation") - static void replaceTeamColor(EditSession e, DyeColor c, Region r){ - CuboidRegion region = new CuboidRegion(new Vector(r.getMinX(), r.getMinY(), r.getMinZ()), new Vector(r.getMaxX(), r.getMaxY(), r.getMaxZ())); - try { - e.replaceBlocks(region, WOOL_SET, new BaseBlock(WOOL.getId(), c.getWoolData())); - e.replaceBlocks(region, CLAY_SET, new BaseBlock(CLAY.getId(), c.getWoolData())); - e.replaceBlocks(region, GLASS_SET, new BaseBlock(GLASS.getId(), c.getWoolData())); - e.replaceBlocks(region, GLASS_PANE_SET, new BaseBlock(GLASS_PANE.getId(), c.getWoolData())); - e.replaceBlocks(region, CARPET_SET, new BaseBlock(CARPET.getId(), c.getWoolData())); - } catch (MaxChangedBlocksException ex) { - // ignore, will never occur + static void replaceTeamColor(Clipboard clipboard, DyeColor c) throws WorldEditException { + Vector minimum = clipboard.getRegion().getMinimumPoint(); + BaseBlock wool = new BaseBlock(WOOL.getId(), c.getWoolData()); + BaseBlock clay = new BaseBlock(CLAY.getId(), c.getWoolData()); + BaseBlock glass = new BaseBlock(GLASS.getId(), c.getWoolData()); + BaseBlock glassPane = new BaseBlock(GLASS_PANE.getId(), c.getWoolData()); + BaseBlock carpet = new BaseBlock(CARPET.getId(), c.getWoolData()); + + for(int x = 0; x < clipboard.getDimensions().getX(); x++){ + for(int y = 0; y < clipboard.getDimensions().getY(); y++){ + for(int z = 0; z < clipboard.getDimensions().getZ(); z++){ + Vector pos = minimum.add(x, y, z); + BaseBlock block = clipboard.getBlock(pos); + if(block.equals(WOOL)){ + clipboard.setBlock(pos, wool); + }else if(block.equals(CLAY)){ + clipboard.setBlock(pos, clay); + }else if(block.equals(GLASS)){ + clipboard.setBlock(pos, glass); + }else if(block.equals(GLASS_PANE)){ + clipboard.setBlock(pos, glassPane); + }else if(block.equals(CARPET)){ + clipboard.setBlock(pos, carpet); + } + } + } } - e.flushQueue(); } - static EditSession pasteSchematic(Clipboard clipboard, Region paste, boolean rotate) throws Schematic.WrongVersionException, IOException, NoClipboardException { + static void pasteSchematic(Clipboard clipboard, Region paste, boolean rotate) throws NoClipboardException { World w = new BukkitWorld(Bukkit.getWorlds().get(0)); Vector dimensions = clipboard.getDimensions(); Vector v = new Vector(paste.centerX(), paste.getMinY(), paste.centerZ()); @@ -118,7 +127,6 @@ public class FightTeam_8 { ch.setTransform(aT); Operations.completeBlindly(ch.createPaste(e, w.getWorldData()).to(v).build()); e.flushQueue(); - return e; } public static boolean checkPistonMoving(Block block){ diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java index 7a76a2c..fb63943 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java @@ -19,7 +19,7 @@ package de.steamwar.fightsystem.fight; -import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.clipboard.Clipboard; import de.steamwar.core.VersionedRunnable; import de.steamwar.fightsystem.ArenaMode; @@ -33,7 +33,10 @@ import de.steamwar.fightsystem.utils.ColorConverter; import de.steamwar.fightsystem.utils.Region; import de.steamwar.sql.NoClipboardException; import de.steamwar.sql.Schematic; -import org.bukkit.*; +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; @@ -120,23 +123,23 @@ public class FightSchematic extends StateDependent { try { VersionedRunnable.call(new VersionedRunnable(() -> { try { - EditSession e = FightTeam_8.pasteSchematic(clipboard, region, rotate); - FightTeam_8.replaceTeamColor(e, c, region); - } catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) { + FightTeam_8.replaceTeamColor(clipboard, c); + FightTeam_8.pasteSchematic(clipboard, region, rotate); + } catch (NoClipboardException | WorldEditException ex) { throw new SecurityException("Error pasting arena in schematic", ex); } }, 8), new VersionedRunnable(() -> { try { - EditSession e = FightTeam_8.pasteSchematic(clipboard, region, rotate); - FightTeam_12.replaceTeamColor(e, c, region); - } catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) { + FightTeam_12.replaceTeamColor(clipboard, c); + FightTeam_8.pasteSchematic(clipboard, region, rotate); + } catch (NoClipboardException | WorldEditException ex) { throw new SecurityException("Error pasting arena in schematic", ex); } }, 12), new VersionedRunnable(() -> { try { - EditSession e = FightTeam_14.pasteSchematic(clipboard, region, rotate); - FightTeam_14.replaceTeamColor(e, c, region); - } catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) { + FightTeam_14.replaceTeamColor(clipboard, c); + FightTeam_14.pasteSchematic(clipboard, region, rotate); + } catch (NoClipboardException | WorldEditException ex) { throw new SecurityException("Error pasting arena in schematic", ex); } }, 14)); From fd9ed60c0a91bca27b5e59d53ddfbbeda557c246 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 6 May 2021 17:49:20 +0200 Subject: [PATCH 04/15] Fix Piston retract with Block on Region Floor and Piston above --- FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java index 470b8d0..7f0f860 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java @@ -144,7 +144,7 @@ public class Region { } public boolean inRegion(Block block){ - return in2dRegion(block) && minY <= block.getY() && block.getY() < maxY; + return in2dRegion(block) && minY < block.getY() && block.getY() < maxY; } public interface TriConsumer{ From 17ec28170acae915f35ca25851275d8eb400b3ee Mon Sep 17 00:00:00 2001 From: Zeanon Date: Thu, 6 May 2021 20:33:10 +0200 Subject: [PATCH 05/15] Fixed the fix --- FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java index 7f0f860..77a7e55 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java @@ -144,7 +144,7 @@ public class Region { } public boolean inRegion(Block block){ - return in2dRegion(block) && minY < block.getY() && block.getY() < maxY; + return in2dRegion(block) && block.getY() >= minY - 1 && block.getY() < maxY; } public interface TriConsumer{ From f62ac6a1ce3903f60599185b8af76b9c0aca6fc2 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 8 May 2021 01:31:30 +0200 Subject: [PATCH 06/15] Now it works --- .../src/de/steamwar/fightsystem/utils/Region.java | 6 +++--- .../de/steamwar/fightsystem/listener/PistonListener.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java index 77a7e55..e31673f 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java @@ -37,7 +37,7 @@ public class Region { public Region(int minX, int minY, int minZ, int sizeX, int sizeY, int sizeZ, int extendX, int extendZ) { this(minX - extendX, minY, minZ - extendZ, - sizeX + extendX * 2, sizeY, sizeZ + extendZ * 2); + sizeX + extendX * 2, sizeY, sizeZ + extendZ * 2); } public Region(int minX, int minY, int minZ, int sizeX, int sizeY, int sizeZ) { @@ -96,7 +96,7 @@ public class Region { public boolean chunkOutside(int cX, int cZ) { return getMinChunkX() > cX || cX > getMaxChunkX() || - getMinChunkZ() > cZ || cZ > getMaxChunkZ(); + getMinChunkZ() > cZ || cZ > getMaxChunkZ(); } public void forEachChunk(ObjIntConsumer executor) { @@ -144,7 +144,7 @@ public class Region { } public boolean inRegion(Block block){ - return in2dRegion(block) && block.getY() >= minY - 1 && block.getY() < maxY; + return in2dRegion(block) && minY <= block.getY() && block.getY() < maxY; } public interface TriConsumer{ diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PistonListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PistonListener.java index a905508..5be57c1 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PistonListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PistonListener.java @@ -39,9 +39,8 @@ public class PistonListener implements Listener { @EventHandler public void handlePistonExtend(BlockPistonExtendEvent e){ - BlockFace b = e.getDirection().getOppositeFace(); for(Block block : e.getBlocks()){ - if(!Config.BlueExtendRegion.inRegion(block.getRelative(b)) && !Config.RedExtendRegion.inRegion(block.getRelative(b))){ + if(!Config.BlueExtendRegion.inRegion(block) && !Config.RedExtendRegion.inRegion(block)){ e.setCancelled(true); return; } @@ -50,9 +49,8 @@ public class PistonListener implements Listener { @EventHandler public void handlePistonRetract(BlockPistonRetractEvent e){ - BlockFace b = e.getDirection().getOppositeFace(); for(Block block : e.getBlocks()){ - if(!Config.BlueExtendRegion.inRegion(block.getRelative(b)) && !Config.RedExtendRegion.inRegion(block.getRelative(b))) { + if(!Config.BlueExtendRegion.inRegion(block) && !Config.RedExtendRegion.inRegion(block)) { e.setCancelled(true); return; } From 7ddd8052c8fc46f7eed0137e77b6a909bd54c24e Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 8 May 2021 14:56:29 +0200 Subject: [PATCH 07/15] Fix Dispenser Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/listener/InFightInventory.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java index c72a812..3dd0274 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java @@ -29,6 +29,7 @@ import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryDragEvent; @@ -123,4 +124,10 @@ public class InFightInventory implements Listener { e.setCancelled(true); } } + + @EventHandler + public void onBlockDispense(BlockDispenseEvent e) { + if(e.getItem().getType() == Material.TNT) + e.setCancelled(true); + } } From 5945f3c14830125fd5e3274b006cb87b1c614335 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 08:36:25 +0200 Subject: [PATCH 08/15] Fix prepare recoloring Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/fight/FightSchematic.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java index fb63943..4e5790d 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java @@ -118,7 +118,7 @@ public class FightSchematic extends StateDependent { private void paste(){ FreezeWorld freezer = new FreezeWorld(); - DyeColor c = ColorConverter.chat2dye(team.getColor()); + DyeColor c = ArenaMode.AntiPrepare.contains(Config.mode) ? ColorConverter.chat2dye(team.getColor()) : DyeColor.PINK; try { VersionedRunnable.call(new VersionedRunnable(() -> { @@ -126,25 +126,25 @@ public class FightSchematic extends StateDependent { FightTeam_8.replaceTeamColor(clipboard, c); FightTeam_8.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 8), new VersionedRunnable(() -> { try { FightTeam_12.replaceTeamColor(clipboard, c); FightTeam_8.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 12), new VersionedRunnable(() -> { try { FightTeam_14.replaceTeamColor(clipboard, c); FightTeam_14.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 14)); } catch (SecurityException securityException) { - team.broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + FightSystem.shutdown(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); throw securityException; } From 27d853af19d9847e9b04ed3a8fc595841b4e8cb0 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 08:51:08 +0200 Subject: [PATCH 09/15] Fix ranked player does not join arena Signed-off-by: Lixfel --- .../steamwar/fightsystem/fight/FightTeam.java | 4 ++++ .../fightsystem/utils/FightStatistics.java | 20 +++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java index bc0dfc7..f2a477f 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -94,6 +94,10 @@ public class FightTeam implements IFightTeam{ team.setAllowFriendlyFire(false); } + public UUID getDesignatedLeader(){ + return designatedLeader; + } + public Region getSchemRegion() { return schemRegion; } diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java index ade520e..4e7928f 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java @@ -50,12 +50,8 @@ public class FightStatistics { public static void saveStats(FightTeam winner, String windescription){ String gameMode = Config.SchematicType.toDB(); - int blueLeader = 0; - int redLeader = 0; - if(Fight.getBlueTeam().getLeader() != null) - blueLeader = SteamwarUser.get(Fight.getBlueTeam().getLeader().getPlayer().getUniqueId()).getId(); - if(Fight.getRedTeam().getLeader() != null) - redLeader = SteamwarUser.get(Fight.getRedTeam().getLeader().getPlayer().getUniqueId()).getId(); + int blueLeader = getLeader(Fight.getBlueTeam()); + int redLeader = getLeader(Fight.getRedTeam()); int win = 0; double blueResult; @@ -109,11 +105,19 @@ public class FightStatistics { int newRedElo = (int) Math.round(redElo + K * (1 - blueResult - redWinExpectation)); Elo.setElo(blueLeader, gameMode, newBlueElo); Elo.setElo(redLeader, gameMode, newRedElo); - Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getBlueTeam().getPrefix() + Fight.getBlueTeam().getLeader().getPlayer().getName() + "§8: §7" + blueElo + "§8»§e" + newBlueElo); - Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getRedTeam().getPrefix() + Fight.getRedTeam().getLeader().getPlayer().getName() + "§8: §7" + redElo + "§8»§e" + newRedElo); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getBlueTeam().getPrefix() + SteamwarUser.get(blueLeader).getUserName() + "§8: §7" + blueElo + "§8»§e" + newBlueElo); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getRedTeam().getPrefix() + SteamwarUser.get(redLeader).getUserName() + "§8: §7" + redElo + "§8»§e" + newRedElo); } } + private static int getLeader(FightTeam team){ + if(team.getLeader() != null) + return SteamwarUser.get(team.getLeader().getPlayer().getUniqueId()).getId(); + else if(team.getDesignatedLeader() != null) + return SteamwarUser.get(team.getDesignatedLeader()).getId(); + return 0; + } + private static void savePlayerStats(FightPlayer fp, int fightId){ SteamwarUser user = SteamwarUser.get(fp.getPlayer().getUniqueId()); de.steamwar.sql.FightPlayer.create(fightId, user.getId(), fp.getTeam().isBlue(), fp.getKit().getName(), fp.getKills(), !fp.isLiving()); From 9cef84f7b3f38ce86cfd557084d69d8ca5a68fe6 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 08:54:25 +0200 Subject: [PATCH 10/15] Fix spectators below (M)WGs Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/listener/ArenaBorder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArenaBorder.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArenaBorder.java index d0ceee8..5c39bd4 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArenaBorder.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArenaBorder.java @@ -51,8 +51,11 @@ public class ArenaBorder implements Listener { } FightTeam team = Fight.getPlayerTeam(player); - if(team == null || player.getGameMode() == GameMode.SPECTATOR) + if(team == null || player.getGameMode() == GameMode.SPECTATOR){ + if(to.getY() <= Config.ArenaRegion.getMinY()) + reset(event); return; + } if(to.getY() <= Config.ArenaRegion.getMinY()) { if(FightState.infight()) From fa8f6c4265c7c20d7f742a56d124b7866eefd817 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 08:57:34 +0200 Subject: [PATCH 11/15] Remove debug output Signed-off-by: Lixfel --- FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java index e31673f..a4f9953 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/utils/Region.java @@ -19,12 +19,10 @@ package de.steamwar.fightsystem.utils; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.Block; import java.util.function.ObjIntConsumer; -import java.util.logging.Level; public class Region { @@ -41,7 +39,6 @@ public class Region { } public Region(int minX, int minY, int minZ, int sizeX, int sizeY, int sizeZ) { - Bukkit.getLogger().log(Level.INFO, minX + " " + minY + " " + minZ + " " + sizeX + " " + sizeY + " " + sizeZ); this.minX = minX; this.minY = minY; this.minZ = minZ; From 14986aedd8e0732a6a82c4fb700341ad02693a7d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 09:06:00 +0200 Subject: [PATCH 12/15] Dont db-log players moving into team area anymore Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/listener/TeamArea.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/TeamArea.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/TeamArea.java index b397645..db88f9f 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/TeamArea.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/TeamArea.java @@ -82,7 +82,7 @@ public class TeamArea implements Listener { private void checkInInnerArea(Player player, Location to, FightTeam team){ if(team.getSchemRegion().playerInRegion(to) && Config.PreperationArea >= 5){ // Preventing false positives due to small extension player.kickPlayer(null); - Bukkit.getLogger().log(Level.SEVERE, player.getName() + " ist in einen Teambereich eingedrungen."); + Bukkit.getLogger().log(Level.INFO, player.getName() + " ist in einen Teambereich eingedrungen."); } } From e408aac608a7745437a3dabd9815b6150804bfd8 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 09:31:58 +0200 Subject: [PATCH 13/15] Make it harder to accidentialy move/equip items in the HotbarGUI Signed-off-by: Lixfel --- .../listener/DenyWorldInteraction_10.java | 32 +++++++++++++++++++ .../listener/DenyWorldInteraction.java | 10 ++++-- .../fightsystem/listener/HotbarGUI.java | 4 +-- .../listener/PersonalKitCreator.java | 4 +-- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 FightSystem_10/src/de/steamwar/fightsystem/listener/DenyWorldInteraction_10.java diff --git a/FightSystem_10/src/de/steamwar/fightsystem/listener/DenyWorldInteraction_10.java b/FightSystem_10/src/de/steamwar/fightsystem/listener/DenyWorldInteraction_10.java new file mode 100644 index 0000000..5a805c9 --- /dev/null +++ b/FightSystem_10/src/de/steamwar/fightsystem/listener/DenyWorldInteraction_10.java @@ -0,0 +1,32 @@ +/* + This file is a part of the SteamWar software. + + Copyright (C) 2020 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.listener; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerSwapHandItemsEvent; + +public class DenyWorldInteraction_10 implements Listener { + + @EventHandler + public void onSwapItems(PlayerSwapHandItemsEvent event) { + event.setCancelled(true); + } +} diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/DenyWorldInteraction.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/DenyWorldInteraction.java index ca0d01c..78b5d50 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/DenyWorldInteraction.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/DenyWorldInteraction.java @@ -19,6 +19,7 @@ package de.steamwar.fightsystem.listener; +import de.steamwar.core.Core; import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; @@ -39,6 +40,11 @@ public class DenyWorldInteraction implements Listener { public DenyWorldInteraction() { new StateDependentListener(ArenaMode.Test, FightState.PreRunning, this); new StateDependentListener(ArenaMode.AntiTest, FightState.AntiRunning, this); + if(Core.getVersion() > 9){ + Listener listener = new DenyWorldInteraction_10(); + new StateDependentListener(ArenaMode.Test, FightState.PreRunning, listener); + new StateDependentListener(ArenaMode.AntiTest, FightState.AntiRunning, listener); + } } @EventHandler @@ -68,13 +74,13 @@ public class DenyWorldInteraction implements Listener { @EventHandler public void onInventoryClick(InventoryClickEvent event) { - if(PersonalKitCreator.notInKitCreator(event.getWhoClicked())) + if(!PersonalKitCreator.inKitCreator(event.getWhoClicked())) event.setCancelled(true); } @EventHandler public void onInventoryDrag(InventoryDragEvent event) { - if(PersonalKitCreator.notInKitCreator(event.getWhoClicked())) + if(!PersonalKitCreator.inKitCreator(event.getWhoClicked())) event.setCancelled(true); } diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java index 2827c50..6b52db4 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java @@ -42,9 +42,10 @@ public class HotbarGUI implements Listener { public void handlePlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); - if(!PersonalKitCreator.notInKitCreator(player)) + if(PersonalKitCreator.inKitCreator(player)) return; + event.setCancelled(true); if(event.getItem() == null) return; @@ -52,7 +53,6 @@ public class HotbarGUI implements Listener { if(fightTeam == null) return; - event.setCancelled(true); ItemMeta itemMeta = event.getItem().getItemMeta(); String displayName = itemMeta.getDisplayName(); diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java index 3007ee1..297834f 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java @@ -61,8 +61,8 @@ public class PersonalKitCreator implements Listener { BasicListener.toActionbar(player, TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!")); } - public static boolean notInKitCreator(HumanEntity player){ - return !openKitCreators.containsKey(player); + public static boolean inKitCreator(HumanEntity player){ + return openKitCreators.containsKey(player); } public static void closeIfInKitCreator(HumanEntity player){ From 3b2857d60d806b59007e7710ccbb658285054779 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 09:47:32 +0200 Subject: [PATCH 14/15] Set to preschemstate Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/fight/FightSchematic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java index 4e5790d..172a8b7 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java @@ -144,7 +144,8 @@ public class FightSchematic extends StateDependent { } }, 14)); } catch (SecurityException securityException) { - FightSystem.shutdown(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + Bukkit.getScheduler().runTask(FightSystem.getPlugin(), FightSystem::setPreSchemState); throw securityException; } From 394ccc251e5e54d303d81ecd905fced1695c300c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 15:24:07 +0200 Subject: [PATCH 15/15] Hotfix hotbargui Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/listener/HotbarGUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java index 6b52db4..94ff28a 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/HotbarGUI.java @@ -45,10 +45,10 @@ public class HotbarGUI implements Listener { if(PersonalKitCreator.inKitCreator(player)) return; - event.setCancelled(true); if(event.getItem() == null) return; + event.setCancelled(true); FightTeam fightTeam = Fight.getPlayerTeam(player); if(fightTeam == null) return;