diff --git a/FightSystem_Core/src/config.yml b/FightSystem_Core/src/config.yml index 0df080e..f0129eb 100644 --- a/FightSystem_Core/src/config.yml +++ b/FightSystem_Core/src/config.yml @@ -108,7 +108,7 @@ WinConditions: # defaults to none if missing # - PUMPKIN_TECH_KO # - HELLS_BELLS - # - METEOR + - METEOR WinConditionParams: # The time of any of the timeout win conditions in seconds diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/event/Meteor.java b/FightSystem_Core/src/de/steamwar/fightsystem/event/Meteor.java index b4b9e96..29f7de9 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/event/Meteor.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/event/Meteor.java @@ -31,6 +31,7 @@ import de.steamwar.fightsystem.winconditions.Winconditions; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Fireball; +import org.bukkit.entity.LargeFireball; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -58,7 +59,7 @@ public class Meteor implements Listener { private BukkitTask currentDropping; public void startCountdown() { - if (current == Meteor.State.PRE) { + if (current == Meteor.State.PRE || current == Meteor.State.FIRST) { Bukkit.getOnlinePlayers().forEach(player -> { player.sendMessage("Starting"); }); @@ -76,7 +77,7 @@ public class Meteor implements Listener { currentCountdown.enable(); } - @EventHandler + //@EventHandler public void explode(ProjectileHitEvent event) { if (event.getEntity() instanceof Fireball) { TNTPrimed tnt = world.spawn(event.getEntity().getLocation(), TNTPrimed.class); @@ -106,13 +107,13 @@ public class Meteor implements Listener { vector.setX(random.nextDouble() - 0.5); vector.setZ(random.nextDouble() - 0.5); - Fireball fireballRed = world.spawn(redStart.toLocation(world), Fireball.class); + LargeFireball fireballRed = world.spawn(redStart.toLocation(world), LargeFireball.class); fireballRed.setDirection(vector); fireballRed.setBounce(false); fireballRed.setIsIncendiary(false); fireballRed.setYield(current.explosionSize); - Fireball fireballBlue = world.spawn(blueStart.toLocation(world), Fireball.class); + LargeFireball fireballBlue = world.spawn(blueStart.toLocation(world), LargeFireball.class); vector.setZ(vector.getZ() * -1); fireballBlue.setDirection(vector); fireballBlue.setBounce(false); @@ -167,11 +168,11 @@ public class Meteor implements Listener { private enum State { PRE(60, 80, 1, 0, 0, 0), - FIRST(25, 35, 6, 2, 2, 4), - SECOND(20, 30, 7, 4, 3, 6), - THIRD(15, 25, 7, 4, 4, 8), - FOURTH(10, 20, 8, 6, 6, 11), - LAST(5, 10, 0, 6, 8, 16); + FIRST(25, 35, 6, 2, 3, 6), + SECOND(20, 30, 7, 4, 4, 8), + THIRD(15, 25, 7, 4, 5, 10), + FOURTH(10, 20, 8, 6, 7, 14), + LAST(5, 10, 0, 6, 9, 18); State(int minTime, int maxTime, int switchAfter, int explosionSize, int minAmount, int maxAmount) { diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/PercentWincondition.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/PercentWincondition.java index c47c2a9..75554d2 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/PercentWincondition.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/PercentWincondition.java @@ -29,6 +29,7 @@ import de.steamwar.fightsystem.utils.Message; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; @@ -105,17 +106,19 @@ public class PercentWincondition extends Wincondition implements PrintableWincon @EventHandler public void onEntityExplode(EntityExplodeEvent event) { - if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) { - return; - } - - event.blockList().forEach(block -> { - if (testBlock.test(block.getType())) { - currentBlocks--; + if (event.getEntityType() != EntityType.FIREBALL) { + if (explosionFilter.getAsBoolean() || !team.getExtendRegion().inRegion(event.getEntity().getLocation())) { + return; } - }); - checkWin.accept(team); + event.blockList().forEach(block -> { + if (testBlock.test(block.getType())) { + currentBlocks--; + } + }); + + checkWin.accept(team); + } } private void enable() {