Code example for EventBus

0
import java.util.List;
import java.util.Map;
 
public final class ChunkMonitor { 
 
    private static final EventBus EVENT_BUS = new EventBus("ChunkMonitor");
    private static final Map<Vector3i, ChunkMonitorEntry> CHUNKS = Maps.newConcurrentMap();
 
    private ChunkMonitor() { 
    } 
 
    private static void post(Object event) { 
        EVENT_BUS.post(event);
    } 
 
    private static synchronized ChunkMonitorEntry registerChunk(Chunk chunk) {
        Preconditions.checkNotNull(chunk, "The parameter 'chunk' must not be null");
        final Vector3i pos = chunk.getPosition();
        ChunkMonitorEntry entry = CHUNKS.get(pos);
        if (entry == null) {