private void redrawWhenSettingsChange() { IResourceManagerReloadListener redrawFlats = new IResourceManagerReloadListener() { @Override public void onResourceManagerReload(IResourceManager resourceManager) { if (mc.theWorld == null) return; IChunkProvider cp = mc.theWorld.getChunkProvider(); if (cp instanceof ChunkProviderClient) { ChunkProviderClient cpc = (ChunkProviderClient) cp; for (Chunk chunk : cpc.chunkListing) { FlatChunkLayer fcl = ((IExtraChunkData) chunk).getFlatLayer(); fcl.renderInfo.markDirty(null); } } } }; ((SimpleReloadableResourceManager) mc.getResourceManager()).registerReloadListener(redrawFlats); }
@Override public <T extends FMLStateEvent> boolean applyStateEventPatch(T event) { try { SimpleReloadableResourceManager resourceManager = (SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); Field reloadListenerList = ReflectionHelper.getField(ObfuscatedField.SimpleReloadableResourceManager_reloadListeners); List<?> reloadListeners = (List<?>) reloadListenerList.get(resourceManager); reloadListeners.remove(Minecraft.getMinecraft().renderGlobal); Minecraft.getMinecraft().renderGlobal = new RenderGlobal(Minecraft.getMinecraft()); resourceManager.registerReloadListener(Minecraft.getMinecraft().renderGlobal); PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, true); return true; } catch (Exception ex) { PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, false); return false; } }
static IResourceManager getMinecraftResources() { final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); return new SimpleReloadableResourceManager(metadataSerializer_); }
@Override public void postInitalize() { IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); if(manager instanceof SimpleReloadableResourceManager) { SimpleReloadableResourceManager rm = (SimpleReloadableResourceManager) manager; rm.registerReloadListener(ResourceReloadListener.getInstance()); } MinecraftForge.EVENT_BUS.register(EffectHandler.getInstance()); MinecraftForge.EVENT_BUS.register(new RenderEventHandler()); FMLCommonHandler.instance().bus().register(new ClientHandler()); super.postInitalize(); }
@Override public void init() { super.init(); ((SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new LiveryTextureRegistry()); ModCartLivery.log.info(I18n.format("message.cartlivery.overwriteModel")); if (Loader.isModLoaded("Railcraft")) { replaceRailcraftCartModel(); } else { replaceMinecraftCartModel(); } FMLInterModComms.sendMessage("Waila", "register", "mods.cartlivery.integration.waila.CartLiveryWailaModule.register"); }
/** * Initializes */ public void init() { FMLClientHandler.instance().addModAsResource(this); // Add resource pack to global list without triggering a full refresh ((SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).reloadResourcePack(FMLClientHandler.instance().getResourcePackFor(MODID)); }
SimpleReloadableResourceManagerINNER1(SimpleReloadableResourceManager p_i1298_1_) { this.field_130076_a = p_i1298_1_; }