From 2e7228835bfa5ab25cf79e528a086843a63f0f00 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 13 May 2021 13:22:11 +0200 Subject: [PATCH] Update WinconditionRelativeRedstonePercent --- .../WinconditionRelativeRedstonePercent.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java index 684f2a4..2d67e3a 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/winconditions/WinconditionRelativeRedstonePercent.java @@ -31,7 +31,8 @@ public class WinconditionRelativeRedstonePercent extends PercentWincondition imp public void enable() { super.enable(); teamMap.forEach((team, percent) -> { - percent.currentBlocks = 0; + percent.totalBlocks = 0; + percent.currentBlocks = 1; }); } }; @@ -56,14 +57,23 @@ public class WinconditionRelativeRedstonePercent extends PercentWincondition imp return Config.Blocks.contains(block.getType()); } - public class TeamPercent extends PercentWincondition.TeamPercent { + public class TeamPercent extends StateDependentTeamPercent { public TeamPercent(FightTeam team) { - super(team); + super(team, Winconditions.RELATIVE_REDSTONE_PERCENT); + } + + @Override + public void enable() { totalBlocks = currentBlocks(); currentBlocks = totalBlocks; } + @Override + public void disable() { + + } + private void check(EntityExplodeEvent event) { if (!team.getExtendRegion().inRegion(event.getEntity().getLocation())) { return;