當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceManagerReloadListener類代碼示例

本文整理匯總了Java中net.minecraft.client.resources.IResourceManagerReloadListener的典型用法代碼示例。如果您正苦於以下問題:Java IResourceManagerReloadListener類的具體用法?Java IResourceManagerReloadListener怎麽用?Java IResourceManagerReloadListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IResourceManagerReloadListener類屬於net.minecraft.client.resources包,在下文中一共展示了IResourceManagerReloadListener類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: redrawWhenSettingsChange

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
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);
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:18,代碼來源:FlatMod.java

示例2: postInit

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public void postInit()
{
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() {
        private boolean ranOnce = false;

        public void onResourceManagerReload(IResourceManager resourcemanager) {
            if (!this.ranOnce) {
                this.ranOnce = true;
                return;
            }
            StructuralLevelClientData.loadBaseTextureData();
            if (StructuralLevel.LEVELS != null) {
                for (StructuralLevel level : StructuralLevel.LEVELS) {
                    if (level.levelNum != 0) {
                        level.clientData.generateIcons();
                        StringTranslate.inject(new ByteArrayInputStream(("item.upgrade.structural." + String.valueOf(level.levelNum) + ".name=" + StatCollector.translateToLocal("item.upgrade.structural") + " " + Utils.romanNumeral(level.levelNum) + " (" + level.clientData.getMaterialName() + ")").getBytes()));
                    }
                }
            }
            StructuralLevelClientData.unloadBaseTextureData();
        }
    });
}
 
開發者ID:Dennisbonke,項目名稱:JABBA,代碼行數:24,代碼來源:ClientProxy.java

示例3: configureFont

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
private static void configureFont() {
    Minecraft mc = Minecraft.getMinecraft();
    font = new FontRenderer(mc.gameSettings, new ResourceLocation(NAME.toLowerCase() + "/font/ascii.png"), mc.renderEngine, false);
    if (mc.gameSettings.language != null) {
        mc.fontRendererObj.setUnicodeFlag(mc.isUnicode());
        mc.fontRendererObj.setBidiFlag(mc.mcLanguageManager.isCurrentLanguageBidirectional());
    }
    mc.mcResourceManager.registerReloadListener((IResourceManagerReloadListener)font);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:Client.java

示例4: registerEventHandler

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
@Override
public void registerEventHandler() {
    MinecraftForge.EVENT_BUS.register((Object)new EventHandlerClient());
    FMLCommonHandler.instance().bus().register((Object)new EventHandlerClient());
    ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new LiquidColorRegistry());
    ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new ParticleHelperClient());
    ExtraUtils.handlesClientMethods = true;
    if (Loader.isModLoaded("ForgeMultipart")) {
        RenderBlockConnectedTextures.fakeRender = new FakeRenderBlocksMultiPart();
    }
    ClientCommandHandler.instance.registerCommand((ICommand)new CommandHologram());
    ClientCommandHandler.instance.registerCommand((ICommand)new CommandUUID());
    KeyHandler.INSTANCE.register();
    super.registerEventHandler();
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:16,代碼來源:ExtraUtilsClient.java

示例5: onResourceManagerReload

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
@Override
public void onResourceManagerReload( IResourceManager resourceManager )
{
	for( IModel model : builtInModels.values() )
	{
		if( model instanceof IResourceManagerReloadListener )
		{
			( (IResourceManagerReloadListener) model ).onResourceManagerReload( resourceManager );
		}
	}
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:12,代碼來源:BuiltinModelLoader.java

示例6: registerListener

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void registerListener() {
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener() {
        @Override
        public void onResourceManagerReload(IResourceManager resourceManager) {
            LocalizationUpdater.this.loadLangFiles();
        }
    });
}
 
開發者ID:tm1990,項目名稱:MiscUtils,代碼行數:10,代碼來源:LocalizationUpdater.java

示例7: run

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void run()
{
    //noinspection NullableProblems
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new IResourceManagerReloadListener()
    {
        @Override
        public void onResourceManagerReload(IResourceManager resourceManager)
        {
            D3LanguageInjectEvent event = new D3LanguageInjectEvent();
            MinecraftForge.EVENT_BUS.post(event);
            LanguageMap.replaceWith(event.map);
        }
    });
}
 
開發者ID:DoubleDoorDevelopment,項目名稱:D3Core,代碼行數:15,代碼來源:LanguageHelper.java

示例8: init

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void init()
{
    IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
    if (rm instanceof IReloadableResourceManager)
    {
        ((IReloadableResourceManager) rm).registerReloadListener(new IResourceManagerReloadListener()
        {
            @Override
            public void onResourceManagerReload(IResourceManager ignored)
            {
                loadedModels.clear();
            }
        });
    }
}
 
開發者ID:TeamDmfMM,項目名稱:Extra-Food,代碼行數:16,代碼來源:OBJRender.java

示例9: registerResourceReloadListener

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void registerResourceReloadListener(IResourceManagerReloadListener listener) {
	((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager())
			.registerReloadListener(listener);
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:5,代碼來源:ClientProxy.java

示例10: register

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public void register() {
    final List<IResourcePack> packs = this.getiResourcePacks();
    packs.add((IResourcePack)this);
    ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)this);
    LogHelper.info("Registered TCon Resource Pack (" + this.name + ") - " + this.getClass().getSimpleName(), new Object[0]);
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:7,代碼來源:TConTextureResourcePackBase.java

示例11: registerReloadListener

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void registerReloadListener(IResourceManagerReloadListener obj) {
  ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(obj);
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:4,代碼來源:RenderUtil.java

示例12: preInit

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
@Override
public void preInit() {
	ModelLoaderRegistry.registerLoader(ModelLoader.INSTANCE);

	IResourceManager resManager = Minecraft.getMinecraft().getResourceManager();
	if (resManager instanceof IReloadableResourceManager) {
		IReloadableResourceManager registry = (IReloadableResourceManager) resManager;
		registry.registerReloadListener(new IResourceManagerReloadListener() {
			@Override
			public void onResourceManagerReload(IResourceManager p_110549_1_) {
				ClientProxy.reload();
			}
		});
	} else {
		MCAnm.logger()
				.warn("Couldn't register reload managers. Models will not be reloaded on switching resource pack");
	}

	if (MCAnm.isDebug) {
		ResourceLocation modelSrc = new ResourceLocation("mcanm:models/Cube/Cube.mcmd");
		@SuppressWarnings("deprecation")
		ISkeleton skeleton = CommonLoader.loadLegacySkeleton(modelSrc);
		IModel model = ClientLoader.loadModel(modelSrc, skeleton);
		IRenderFactory<CubeEntity> renderer = RenderAnimatedModel.fromModel(model, 1.0f);

		ResourceLocation model2Src = new ResourceLocation("mcanm:models/CubeV2/Cube.mcmd");
		IModel model2 = ClientLoader.loadModel(model2Src, ISkeleton.EMPTY);
		IRenderFactory<CubeEntityV2> renderer2 = RenderAnimatedModel
				.fromModel(makeAnimator("mcanm:textures/models/Cube/Untitled.png"), model2, 1.0f);

		RenderingRegistry.registerEntityRenderingHandler(CubeEntity.class, renderer);
		RenderingRegistry.registerEntityRenderingHandler(CubeEntityV2.class, renderer2);

		Item debug = new Item();
		debug.addPropertyOverride(new ResourceLocation("test"), new IItemPropertyGetter() {
			@Override
			public float apply(ItemStack stack, World worldIn, EntityLivingBase entityIn) {
				return (entityIn.ticksExisted / 100f) % 1f;
			}
		});
		GameRegistry.register(debug.setFull3D().setRegistryName("debug_item"));
		net.minecraftforge.client.model.ModelLoader.setCustomModelResourceLocation(
				debug,
				0,
				new ModelResourceLocation("mcanm:models/item/debug_item.mcmdl#inventory"));
	}
}
 
開發者ID:WorldSEnder,項目名稱:MCAnm,代碼行數:48,代碼來源:ClientProxy.java

示例13: registerReloadListener

import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
/**
 * Registers a IResourceManagerReloadListener to MC's resource manager.
 *
 * @param reloadListener The listener.
 */
public static void registerReloadListener(IResourceManagerReloadListener reloadListener) {
    //If this crashes people need to stop using reflection..
    getResourceManager().registerReloadListener(reloadListener);
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:10,代碼來源:ResourceUtils.java


注:本文中的net.minecraft.client.resources.IResourceManagerReloadListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。