Java 类net.minecraft.client.resources.SimpleReloadableResourceManager 实例源码

项目:Factorization    文件:FlatMod.java   
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);
}
项目:morecommands    文件:PatchRenderGlobal.java   
@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;
    }
}
项目:Factorization    文件:IndexDocumentation.java   
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_);
}
项目:Gadomancy    文件:ClientProxy.java   
@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();
}
项目:CartLivery    文件:ClientProxy.java   
@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");
}
项目:carpentersblocks    文件:CarpentersBlocksCachedResources.java   
/**
 * 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));
}
项目:RuneCraftery    文件:SimpleReloadableResourceManagerINNER1.java   
SimpleReloadableResourceManagerINNER1(SimpleReloadableResourceManager p_i1298_1_) {
   this.field_130076_a = p_i1298_1_;
}