From 08ef10a3d8c607d127c4ed4d3398f17e95dc52be Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 9 May 2021 14:39:55 +0200 Subject: [PATCH] Add WinconditionRelativeRedstonePercent --- .../WinconditionRelativeRedstonePercent.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java index e763385..7b1026e 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java @@ -62,7 +62,7 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements private int currentBlocks; public TeamPercent(FightTeam team) { - super(Winconditions.RELATIVE_PERCENT, FightState.Running); + super(Winconditions.RELATIVE_REDSTONE_PERCENT, FightState.Running); this.team = team; this.currentBlocks = 1; register(); @@ -71,7 +71,7 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements @Override public void enable() { blockCount = currentBlocks(); - task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::check, 400, 400); + task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::check, 100, 100); } @Override @@ -97,10 +97,6 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements return (blockCount - currentBlocks) * 100 / (double) blockCount; } - public int getBlockCount() { - return blockCount; - } - private int currentBlocks() { // Entern active if (!Config.EnterStages.isEmpty() && Config.EnterStages.get(0) >= Wincondition.getTimeOverCountdown().getTimeLeft()) @@ -125,14 +121,10 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements case NOTE_BLOCK: case REDSTONE_BLOCK: case REDSTONE: - case REPEATER: - case COMPARATOR: - case OBSERVER: case HOPPER: case REDSTONE_LAMP: case REDSTONE_TORCH: case REDSTONE_WALL_TORCH: - case REDSTONE_WIRE: currentBlocks++; break; default: