| Total Complexity | 5 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package de.kleiner3.lasertag.lasertaggame.management.blocktick; |
||
| 15 | public class LasertagBlockTickManager implements IManager { |
||
| 16 | |||
| 17 | private final List<LasertagCustomBlockTickable> blockEntityTickers; |
||
| 18 | private final MinecraftServer server; |
||
| 19 | |||
| 20 | public LasertagBlockTickManager(MinecraftServer server) { |
||
| 21 | this.blockEntityTickers = new ArrayList<>(); |
||
| 22 | this.server = server; |
||
| 23 | } |
||
| 24 | |||
| 25 | public void registerTicker(LasertagCustomBlockTickable ticker) { |
||
| 26 | blockEntityTickers.add(ticker); |
||
| 27 | } |
||
| 28 | |||
| 29 | public void clear() { |
||
| 30 | this.blockEntityTickers.clear(); |
||
| 31 | } |
||
| 32 | |||
| 33 | public void tick() { |
||
| 34 | blockEntityTickers.forEach(ticker -> ticker.serverTick(this.server.getOverworld())); |
||
| 35 | } |
||
| 36 | |||
| 37 | @Override |
||
| 38 | public void dispose() { |
||
| 39 | // Nothing to dispose |
||
| 42 |