本文整理匯總了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);
}
示例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();
}
});
}
示例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);
}
示例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();
}
示例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 );
}
}
}
示例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();
}
});
}
示例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);
}
});
}
示例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();
}
});
}
}
示例9: registerResourceReloadListener
import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void registerResourceReloadListener(IResourceManagerReloadListener listener) {
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager())
.registerReloadListener(listener);
}
示例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]);
}
示例11: registerReloadListener
import net.minecraft.client.resources.IResourceManagerReloadListener; //導入依賴的package包/類
public static void registerReloadListener(IResourceManagerReloadListener obj) {
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(obj);
}
示例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"));
}
}
示例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);
}