RedstoneWincondition #274
@ -62,7 +62,7 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements
|
|||||||
private int currentBlocks;
|
private int currentBlocks;
|
||||||
|
|
||||||
YoyoNow markierte diese Unterhaltung als gelöst
Veraltet
|
|||||||
public TeamPercent(FightTeam team) {
|
public TeamPercent(FightTeam team) {
|
||||||
super(Winconditions.RELATIVE_PERCENT, FightState.Running);
|
super(Winconditions.RELATIVE_REDSTONE_PERCENT, FightState.Running);
|
||||||
this.team = team;
|
this.team = team;
|
||||||
this.currentBlocks = 1;
|
this.currentBlocks = 1;
|
||||||
register();
|
register();
|
||||||
@ -71,7 +71,7 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements
|
|||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
blockCount = currentBlocks();
|
blockCount = currentBlocks();
|
||||||
YoyoNow markierte diese Unterhaltung als gelöst
Veraltet
Lixfel
hat
Der Code hier liest sich wie Copy+Paste aus der RelativeWincondition. Codeduplication bitte entfernen (aka generalisieren) Der Code hier liest sich wie Copy+Paste aus der RelativeWincondition. Codeduplication bitte entfernen (aka generalisieren)
|
|||||||
task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::check, 400, 400);
|
task = Bukkit.getScheduler().runTaskTimer(FightSystem.getPlugin(), this::check, 100, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -97,10 +97,6 @@ public class WinconditionRelativeRedstonePercent extends Wincondition implements
|
|||||||
return (blockCount - currentBlocks) * 100 / (double) blockCount;
|
return (blockCount - currentBlocks) * 100 / (double) blockCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockCount() {
|
|
||||||
return blockCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int currentBlocks() {
|
private int currentBlocks() {
|
||||||
// Entern active
|
// Entern active
|
||||||
if (!Config.EnterStages.isEmpty() && Config.EnterStages.get(0) >= Wincondition.getTimeOverCountdown().getTimeLeft())
|
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 NOTE_BLOCK:
|
||||||
case REDSTONE_BLOCK:
|
case REDSTONE_BLOCK:
|
||||||
case REDSTONE:
|
case REDSTONE:
|
||||||
case REPEATER:
|
|
||||||
case COMPARATOR:
|
|
||||||
case OBSERVER:
|
|
||||||
case HOPPER:
|
case HOPPER:
|
||||||
case REDSTONE_LAMP:
|
case REDSTONE_LAMP:
|
||||||
case REDSTONE_TORCH:
|
case REDSTONE_TORCH:
|
||||||
case REDSTONE_WALL_TORCH:
|
case REDSTONE_WALL_TORCH:
|
||||||
case REDSTONE_WIRE:
|
|
||||||
currentBlocks++;
|
currentBlocks++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Den Listener kannst du weglassen, was möchtest du damit überhaupt? Es sind eh nur die zyklischen Prüfungen relevant.
Nein, wenn ein Block plaziert wurde, darf man keine Prozente zurückbekommen.
Dann wäre allerdings der explosionsbasierte Messansatz besser als der zeitbasiert prüfende.