public void registerModels() { if(Loader.instance().hasReachedState(LoaderState.INITIALIZATION)) { TConstruct.log.error( "Proxy.registerModels has to be called during preInit. Otherwise the models wont be found on first load."); } }
@Override public void transform(BookData book, SectionData data) { ContentListing listing = new ContentListing(); listing.title = book.translate(sectionName); addPage(data, sectionName, "", listing); // don't do stuff during preinit etc, we only want to fill it once everything is added if(!Loader.instance().hasReachedState(LoaderState.POSTINITIALIZATION)) { return; } MATERIAL_TYPES_ON_DISPLAY.forEach(type -> { int pageIndex = data.pages.size(); generateContent(type, data); if(pageIndex < data.pages.size()) { listing.addEntry(getStatName(type), data.pages.get(pageIndex)); } }); }
/** * Registers a top level package to be searched for {@link Handler} classes. Not needed if your {@code @Mod} class implements {@link IEnderMod} * * @param packageName * @deprecated This is not needed, period. */ @Deprecated public static void addPackage(String packageName) { if (Loader.instance().hasReachedState(LoaderState.INITIALIZATION)) { throw new RuntimeException("This method must only be called in preinit"); } EnderCore.logger.info("Adding package " + packageName + " to handler search."); packageSet.add(packageName); }
private boolean checkGameState() { return restartReq == RestartReqs.NONE || (restartReq == RestartReqs.REQUIRES_WORLD_RESTART && FMLCommonHandler.instance().getMinecraftServerInstance() == null) || !Loader.instance().hasReachedState(LoaderState.AVAILABLE); }
@Nonnull @Override public IKnowledgeProvider getKnowledgeProviderFor(@Nonnull UUID playerUUID) { if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { Preconditions.checkState(PECore.proxy.getClientPlayer() != null, "Client player doesn't exist!"); return PECore.proxy.getClientTransmutationProps(); } else { Preconditions.checkNotNull(playerUUID); Preconditions.checkState(Loader.instance().hasReachedState(LoaderState.SERVER_STARTED), "Server must be running to query knowledge!"); EntityPlayer player = findOnlinePlayer(playerUUID); if (player != null) { return player.getCapability(ProjectEAPI.KNOWLEDGE_CAPABILITY, null); } else { return TransmutationOffline.forPlayer(playerUUID); } } }
}else if(message.isNBTMessage() && Loader.instance().hasReachedState(LoaderState.PREINITIALIZATION)&& !Loader.instance().hasReachedState(LoaderState.INITIALIZATION) && BattlegearConfig.initItemFromNBT(message.getNBTValue())){ success = true;