@Override public void setData(String dataID, WorldSavedData worldSavedDataIn) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { m_proxyWorld.setData(dataID, worldSavedDataIn); } else if (m_realWorld != null) { m_realWorld.setData(dataID, worldSavedDataIn); } else { super.setData(dataID, worldSavedDataIn); } }
@Override public WorldSavedData loadData(Class<? extends WorldSavedData> clazz, String dataID) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { return m_proxyWorld.loadData(clazz, dataID); } else if (m_realWorld != null) { return m_realWorld.loadData(clazz, dataID); } else { return super.loadData(clazz, dataID); } }
public static ILoginTracker getTracker(World world) { WorldSavedData data = world.getMapStorage().getOrLoadData(SavedData.class, SAVED_DATA_NAME); if (data == null) { data = new SavedData(SAVED_DATA_NAME); world.getMapStorage().setData(SAVED_DATA_NAME, data); } return ((ILoginTracker) data); }
public static IOrganiserStorage getStorage(World world) { WorldSavedData data = world.getMapStorage().getOrLoadData(SavedData.class, SAVED_DATA_NAME); if (data == null) { data = new SavedData(SAVED_DATA_NAME); world.getMapStorage().setData(SAVED_DATA_NAME, data); } return ((IOrganiserStorage) data); }
@Override public void setData(String dataID, WorldSavedData worldSavedDataIn) { // NO-OP }
@Override @Nullable public WorldSavedData loadData(Class <? extends WorldSavedData > clazz, String dataID) { return null; }