Плотность тумана

А это не даст нагрузки?
 
Код:
@SubscribeEvent
 public void onClientTick(TickEvent.ClientTickEvent event)
 {
 if(Minecraft.getMinecraft().theWorld.provider instanceof WorldProviderVenus)
 { 
 if (event.phase == TickEvent.Phase.START)
 {
 Minecraft.getMinecraft().gameSettings.renderDistanceChunks = 1;
 }
 
 }
 }
При такой проверки крашит клиент... Что делать?
 
Как-то так:
Код:
    @SubscribeEvent
    public void fogDistance(RenderFogEvent e) {
        if(e.entity.worldObj.provider instanceof WorldProviderVenus) {
            float f1 = e.farPlaneDistance;

            if (e.fogMode < 0) {
                GL11.glFogf(GL11.GL_FOG_START, f1);
                GL11.glFogf(GL11.GL_FOG_END, f1);
            } else {
                GL11.glFogf(GL11.GL_FOG_START, 2.0F);//Минимальная дистанция видимости
                GL11.glFogf(GL11.GL_FOG_END, 5.0F);//Максимальная дистанция видимости
            }

        }
    }
 
timaxa007 написал(а):
Как-то так:
Код:
    @SubscribeEvent
    public void fogDistance(RenderFogEvent e) {
        if(e.entity.worldObj.provider instanceof WorldProviderVenus) {
            float f1 = e.farPlaneDistance;

            if (e.fogMode < 0) {
                GL11.glFogf(GL11.GL_FOG_START, f1);
                GL11.glFogf(GL11.GL_FOG_END, f1);
            } else {
                GL11.glFogf(GL11.GL_FOG_START, 2.0F);//Минимальная дистанция видимости
                GL11.glFogf(GL11.GL_FOG_END, 5.0F);//Максимальная дистанция видимости
            }

        }
    }
Не работает....
 
Странно, у меня сработало.
 
Код:
02:24:27] [Client thread/INFO]: Baking listener list for FrameBufferListener with 0 listeners
[02:24:27] [Client thread/ERROR]: Exception caught during firing event cpw.mods.fml.common.gameevent.TickEvent$ClientTickEvent@1d5ad4a:
java.lang.NullPointerException
 at blessentumble.core.tick.TickEventBless.onClientTick(TickEventBless.java:19) ~[TickEventBless.class:?]
 at cpw.mods.fml.common.eventhandler.ASMEventHandler_127_TickEventBless_onClientTick_ClientTickEvent.invoke(.dynamic) ~[?:?]
 at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?]
 at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) [EventBus.class:?]
 at cpw.mods.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:325) [FMLCommonHandler.class:?]
 at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1576) [bao.class:?]
 at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:962) [bao.class:?]
 at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887) [bao.class:?]
 at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
 at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
 at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
 at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
[02:24:27] [Client thread/ERROR]: Index: 13 Listeners:
[02:24:27] [Client thread/ERROR]: 0: NORMAL
[02:24:27] [Client thread/ERROR]: 1: ASM: blessentumble.core.handler.SkyProviderHandlerBA@a9658 onSkyRendererTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 2: ASM: schmoller.tubes.ModTubes@20e2ec onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 3: ASM: codechicken.core.internal.CCCEventHandler@b5ea0e clientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 4: ASM: codechicken.nei.ClientHandler@135b6bd tickEvent(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 5: ASM: bspkrs.statuseffecthud.fml.SEHGameTicker@dbd4ec onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 6: ASM: bspkrs.armorstatushud.fml.ASHGameTicker@122f4ed onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 7: ASM: bspkrs.treecapitator.TCClientTicker@2ee399 onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 8: ASM: appeng.parts.PartPlacement@18e4007 playerInteract(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 9: ASM: micdoodle8.mods.galacticraft.core.tick.TickHandlerClient@85ac69 onClientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 10: ASM: micdoodle8.mods.galacticraft.core.tick.KeyHandlerClient@11dc278 onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 11: ASM: micdoodle8.mods.galacticraft.planets.asteroids.event.AsteroidsEventHandlerClient@153ccd9 onClientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 12: ASM: micdoodle8.mods.galacticraft.planets.mars.MarsModuleClient$TickHandlerClient@160817c onClientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 13: ASM: blessentumble.core.tick.TickEventBless@1e537e1 onClientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 14: ASM: mekanism.client.ClientTickHandler@13041d6 onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 15: ASM: mekanism.client.MekanismKeyHandler@136bc2e onTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 16: ASM: codechicken.lib.world.WorldExtensionManager$WorldExtensionEventHandler@18229ab clientTick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 17: ASM: codechicken.multipart.ControlKeyHandler$@181745a tick(Lcpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent;)V
[02:24:27] [Client thread/ERROR]: 18: ASM: appeng.hooks.TickHandler@8b5134 onTick(Lcpw/mods/fml/common/gameevent/TickEvent;)V
[02:24:28] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
 at blessentumble.core.tick.TickEventBless.onClientTick(TickEventBless.java:19) ~[TickEventBless.class:?]
 at cpw.mods.fml.common.eventhandler.ASMEventHandler_127_TickEventBless_onClientTick_ClientTickEvent.invoke(.dynamic) ~[?:?]
 at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?]
 at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) ~[EventBus.class:?]
 at cpw.mods.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:325) ~[FMLCommonHandler.class:?]
 at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1576) ~[bao.class:?]
 at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:962) ~[bao.class:?]
 at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887) [bao.class:?]
 at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
 at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
 at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
 at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
[02:24:28] [Client thread/INFO]: [net.minecraft.client.Minecraft:func_71377_b:349]: ---- Minecraft Crash Report ----
// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

Time: 06.01.15 2:24
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
 at blessentumble.core.tick.TickEventBless.onClientTick(TickEventBless.java:19)
 at cpw.mods.fml.common.eventhandler.ASMEventHandler_127_TickEventBless_onClientTick_ClientTickEvent.invoke(.dynamic)
 at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
 at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
 at cpw.mods.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:325)
 at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1576)
 at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:962)
 at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)
 at net.minecraft.client.main.Main.main(SourceFile:148)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
 at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
 
Код:
at blessentumble.core.tick.TickEventBless.onClientTick(TickEventBless.java:19)
Ошибка. Он у тебя работает только на КлиентПрокси?
 
В коммоне тоже 

TickEventBless tickEvent = new TickEventBless();
FMLCommonHandler.instance().bus().register(tickEvent);
MinecraftForge.EVENT_BUS.register(tickEvent);


Данный краш вылазит только при добавлении проверки на ВорлдПровайдер
[merge_posts_bbcode]Добавлено: 06.01.2015 03:18:05[/merge_posts_bbcode]

А так спокойно работает, но во всех мирах.
 
package blessentumble.core.tick;

import org.lwjgl.opengl.GL11;

import blessentumble.planets.venus.dimension.WorldProviderVenus;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity;
import net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;

public class TickEventBless {


@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
if(Minecraft.getMinecraft().theWorld.provider instanceof WorldProviderVenus)
{
if (event.phase == TickEvent.Phase.START)
{
Minecraft.getMinecraft().gameSettings.renderDistanceChunks = 1;
}

}
}


}
 
WorldProviderVenus нуловый,потому что (мне кажется)ты в другом измерении
 
Назад
Сверху