@Override public void addEventListener(IWorldEventListener listener) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { m_proxyWorld.addEventListener(listener); } else if (m_realWorld != null) { m_realWorld.addEventListener(listener); } else { super.addEventListener(listener); } }
@Override public void removeEventListener(IWorldEventListener listener) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { m_proxyWorld.removeEventListener(listener); } else if (m_realWorld != null) { m_realWorld.removeEventListener(listener); } else { super.removeEventListener(listener); } }
public static ClientBlockSystemListener get(BlockSystem world) { for (IWorldEventListener listener : world.getListeners()) { if (listener instanceof ClientBlockSystemListener) { return (ClientBlockSystemListener) listener; } } return null; }
public static ServerBlockSystemListener get(BlockSystem world) { for (IWorldEventListener listener : world.getListeners()) { if (listener instanceof ServerBlockSystemListener) { return (ServerBlockSystemListener) listener; } } return null; }
public List<IWorldEventListener> getListeners() { return this.eventListeners; }
@Override public void addEventListener(IWorldEventListener worldAccess) { }
@Override public void removeEventListener(IWorldEventListener worldAccess) { }
@Override public void addEventListener(@Nonnull IWorldEventListener listener) { wrapped.addEventListener(listener); }
@Override public void removeEventListener(@Nonnull IWorldEventListener listener) { wrapped.removeEventListener(listener); }