Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MrObsidy24

Members
  • Joined

  • Last visited

Everything posted by MrObsidy24

  1. Weird. Do you know if there is any other way to create fog?
  2. Constants.fogDensity is 0f. EDIT: The picture below is with fogDensity set to 0f.
  3. @SideOnly(Side.CLIENT) @SubscribeEvent public void onFogDensityRender(EntityViewRenderEvent.FogDensity event){ event.setDensity(Constants.fogDensity); event.setCanceled(true); } @SideOnly(Side.CLIENT) @SubscribeEvent public void onFogColorRender(EntityViewRenderEvent.FogColors event){ event.setRed((float) Constants.fogColor.getRed() / 255); event.setGreen((float) Constants.fogColor.getGreen() / 255); event.setBlue((float) Constants.fogColor.getBlue() / 255); } EDIT: Another Edit. So if I increase the fog density, everything works good again and I see fog. However, if the fog density is 0, i get that weird bar on the sky which is colored like the fog. Do you know how to fix that?
  4. I'll try that. I edited my post above to show you how the fog looks EDIT: Didn't work, result still the same as above.
  5. The event.setCanceled(); was a typo mistake on this forum (the code does not have this mistake). (it says canceled in the code) Constants.fogColor is a ljwgl color which stores the red/green/blue as ints as values 0-255 I just realized my mistake. I divide the 255 by the value, not the value by 255. And I am in maths AP. Oops. I'll try that. EDIT: just realized that FogColor() is not cancelable. Also, this is what the fog looks like on my screen:
  6. I implemented them like this: @SideOnly(Side.CLIENT) @SubscribeEvent public void onFogDensityRender(EntityViewRenderEvent.FogDensity event){ event.setDensity(Constants.fogDensity); event.setCanceled(true); } @SideOnly(Side.CLIENT) @SubscribeEvent public void onFogColorRender(EntityViewRenderEvent.FogColors event){ event.setRed(255 / Constants.fogColor.getRed()); event.setGreen(255 / Constants.fogColor.getGreen()); event.setBlue(255 / Constants.fogColor.getBlue()); event.setCancaled(true); }
  7. I know that er.setupFog() is private, was that replaced by updateFogColor()?
  8. So I am creating a Mod that acts similar to weather2 by Corosus and the thing I ask for is the following: When underneath a storm, I want the player to experience fog. I have no idea how to to this (I tried the EntityViewRenderEvent.FogDensity / FogColor, this just makes the sky appear black and white). the method EntityRender.setupFog() method is private so I cannot use that. Anybody knows how to setup fog (preferrably with color)?
  9. EntityRenderer#setupFog() is private in 1.11.2
  10. Bump, this would be interesting to know, also for newer versions.
  11. If I do something on the World class, does that automatically update the Client?
  12. Hey! For the mod I am creating I need to get the World (in particular, the overworld) and I stumbled across this thing that FMLServerStartingEvent.getServer().worldServerForDimension(0) gives me a "WorldServer" type object, however I pass this world to another function that only takes "World" type objects. Eclipse doesn't give me a error on that, so I am not sure wether I am doing things correctly. Can anybody explain me the difference or if I'm wrong, what is the proper way to get the overworld? Thanks in Advance, MrObsidy24
  13. Works. I was just being dumb.
  14. Fail. My bad. Sorry, I just recently got into modding (hence the "Joined 22 Minutes ago") I'll try that!
  15. So I am having this weird glitch where I try (for testing purposes) to display a chat message to a player who loaded up a world/joined a server. This is my code so far: package weatherplus.forge; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.text.TextComponentString; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; public class EventHandler{ @SubscribeEvent public void onLogin(PlayerEvent.PlayerLoggedInEvent event){ event.player.sendMessage(new TextComponentString("[WeatherPlus] Client-Side features enabled")); System.out.println("[WeatherPlus] Player logged in: " + event.player.getName()); } @SubscribeEvent public void onLogoff(PlayerEvent.PlayerLoggedOutEvent event){ System.out.println("[WeatherPlus] Player logged out: " + event.player.getName()); } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.