SteamWar/FightSystem
Archiviert
13
1

Multi stage entern and non tnt kits #167

Manuell gemergt
Lixfel hat 5 Commits von multi-stage-entern nach master 2020-07-11 07:30:09 +02:00 zusammengeführt
Nur Änderungen aus Commit 669a822bd6 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -16,11 +16,19 @@ public class WaterRemover {
private static final Map<Location, Integer> explodedBlocks = Collections.synchronizedMap(new HashMap<>()); private static final Map<Location, Integer> explodedBlocks = Collections.synchronizedMap(new HashMap<>());
private static Set<Block> waterList = new HashSet<>(); private static Set<Block> waterList = new HashSet<>();
private static boolean isRunning = false;
private static int steps = 1;
public static void init() { public static void init() {
Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), () -> { Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), () -> {
if(isRunning){
steps++;
return;
}
isRunning = true;
wateredCheck(); wateredCheck();
removeWater(); removeWater();
isRunning = false;
}, 0, 20); }, 0, 20);
} }
@ -41,13 +49,14 @@ public class WaterRemover {
it.remove(); it.remove();
continue; continue;
} }
e.setValue(e.getValue() + 1); e.setValue(e.getValue() + steps);
if(e.getValue() > 15) if(e.getValue() > 15)
it.remove(); it.remove();
} }
steps = 1;
}catch(ConcurrentModificationException e){ }catch(ConcurrentModificationException e){
wateredCheck(); steps++;
} }
} }