Jump to content

Recommended Posts

Posted

Did you mean Show or Whow?

Heres my code:

Spoiler

@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public static void onFogDensityEvent(EntityViewRenderEvent.FogDensity event) {
    if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) {
        GlStateManager.setFog(EXP);
        event.setDensity(2F);
    }
    else {
        GlStateManager.setFog(LINEAR);
        event.setDensity(0.01F);
    }
}

@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public static void onFogColorsEvent(EntityViewRenderEvent.FogColors event) {
    if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) {
        event.setRed(COLOR_MOLTEN_GLASS.getRed() / 255F);
        event.setGreen(COLOR_MOLTEN_GLASS.getGreen() / 255F);
        event.setBlue(COLOR_MOLTEN_GLASS.getBlue() / 255F);
    }
}

 

Posted

I meant show, sorry.

Read the docs on the FogDensity event:

/**
     * Event that allows any feature to customize the fog density the player sees.
     * NOTE: In order to make this event have an effect, you must cancel the event
     */

 

Posted

Oops i accidently removed that while adjusting.

Now when i get out of the fluid i cant see anything.

I already set the fog density to be small when not in the liquid.

Spoiler

2019-05-11_09_17_14.png.6100ae1f8ec7d2fe0d0aa3123f7de860.png2019-05-11_09_16_11.png.ee2825db3cda361b2670119c7540ba68.png

Spoiler

@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public static void onFogDensityEvent(EntityViewRenderEvent.FogDensity event) {
    if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) {
        GlStateManager.setFog(EXP);
        event.setDensity(2F);
    }
    else {
        GlStateManager.setFog(LINEAR);
        event.setDensity(0.01F);
    }
    event.setCanceled(true);
}

@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public static void onFogColorsEvent(EntityViewRenderEvent.FogColors event) {
    if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) {
        event.setRed(COLOR_MOLTEN_GLASS.getRed() / 255F);
        event.setGreen(COLOR_MOLTEN_GLASS.getGreen() / 255F);
        event.setBlue(COLOR_MOLTEN_GLASS.getBlue() / 255F);
    }
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.