| Total Complexity | 4 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package de.pewpewproject.lasertag.lasertaggame.state.management.server.implementation; |
||
| 15 | public class BlockTickManager implements IBlockTickManager { |
||
| 16 | private final List<LasertagCustomBlockTickable> blockEntityTickers; |
||
| 17 | private final MinecraftServer server; |
||
| 18 | |||
| 19 | public BlockTickManager(MinecraftServer server) { |
||
| 20 | this.blockEntityTickers = new ArrayList<>(); |
||
| 21 | this.server = server; |
||
| 22 | } |
||
| 23 | |||
| 24 | public synchronized void registerTicker(LasertagCustomBlockTickable ticker) { |
||
| 25 | blockEntityTickers.add(ticker); |
||
| 26 | } |
||
| 27 | |||
| 28 | public synchronized void clear() { |
||
| 29 | this.blockEntityTickers.clear(); |
||
| 30 | } |
||
| 31 | |||
| 32 | public synchronized void tick() { |
||
| 33 | blockEntityTickers.forEach(ticker -> ticker.serverTick(this.server.getOverworld())); |
||
| 34 | } |
||
| 36 |