Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Hook into Fog/Water Clarity


Azaka7
 Share

Recommended Posts

I would love to be able to hook a helmet's renderHelmetOverlay (or some other method) into EntityRenderer.setupFog(int,float), specifically the section of that method that checks for water breathing effect or respiration enchant to change the water clarity. A hook into EntityRenderer.updateFogColor(float), which also checks for those things, might also be nice. The hook could be used for helmets that make water more/less clear. If the hook is into several parts of the method or the method itself, the hook could be used to create helmets that can make the overlay lava or fog clearer.

 

If the water clarity goal can be achieved without a hook, please let me know.

 

Thank you in advance to any help provided. :)

Link to comment
Share on other sites

  • 2 weeks later...

So, I've created a small API that does at least what I wanted to be able to do. Once I've done some more testing, I'll set up a download link and instructions on how to use and install it (probably as a thread on the Minecraft forums). Basically, it gives modders the ability to determine the strength/thickness of various types of fog (like that of water, lava, and something called "cloud" fog) as well as alter the color of the fog. Because it's interface-based, it's sensitive, but things go well when used strictly. I'm seeing it out in the next 24 hours.

Link to comment
Share on other sites

As I said before, this crap isn't needed you guys wanna change a files to something lower then the rendering will allow.

Seriously. You guys have yet to actually say what you wanna do and why.

AND you ship the whole decompiled mojang class really.. bad form man ...

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

As I said before, this crap isn't needed you guys wanna change a files to something lower then the rendering will allow.

Seriously. You guys have yet to actually say what you wanna do and why.

AND you ship the whole decompiled mojang class really.. bad form man ...

Ok. What I wanna do: Change the color and strength of water fog. Why? I want to be able to make water more clear (and adapt its color slightly so it still looks good) when a player is wearing a helmet. I would use this with my mod, AlgaeCraft, to make a SCUBA mask clear up the player's vision under water. I don't want to make the mask defaultly have the respiration enchant so it can still be enchanted by the player. The API/modification I made also allows for changing of color and clarity of lava, which could be seen as useful to some modders.  Other modders might use the ability for the creation of different enchants, potion effects, or even armor similar to the mask. As for shipping the entire decompiled file, how might I avoid that? I also don't entirely get what you mean by " changing a files to something lower than the rendering will allow." For my own and recommended usage, the rendering stays within the limits.

 

Now that you know what I want to do and why, consider adding a hook or interface that can be used to achieve this goal into Forge. That way, there won't be a need for the separate API. I am willing to accept whatever suggestions you have if you don't want the requested functionality as a part of Forge for some reason. Thank you for your time.

Link to comment
Share on other sites

  • 3 weeks later...

I'm just gonna bump this one more time with a more organized version of what I typed above.

 

Subject of request: A hook or an interface (or any more convenient item) that allows for the customization of "fog" under certain circumstances. (Fog being what is rendered under water/in lava/with blindness).

 

Why?/For What?: I would use it to give a respiration-like visual effect to SCUBA goggles (clearer). Depending on the extend of fog customization, modders could create better potion effects or add better visual alterations to helmets.

 

Other information:

I don't want to use the respiration enchantment for the visual, because I want the googles to be able to be separately enchanted. I can't simply call a method from the respiration enchantment or any potion effect because there is none. The method rendering the fog only checks if the player has any of the factors.

 

I would really appreciate it if the ability to customize fog, even to a small degree, was added to Forge. I dislike the idea of having to sustain and distribute the Fog Clarity API as much as you might, but I will keep it if necessary. I'm sure that there are many other modders that would like the ability to change water fog and other forms of fog. Thank you for your time.

Link to comment
Share on other sites

  • 3 weeks later...

I'm going to very strongly agree with this suggestion, as I feel its very important, but for a slightly different reason.

Many modpacks add quite a variety of liquids - but when "diving" into them, the fog color is either water or lava.

Ability to override the color would increase the immersion of these mods significantly.

Ability to control the depth of fog present would be quite useful as well, for custom liquids as well as for reasons described here (custom equipment, potion effects, and the like).

 

TL;DR:  +1.

Link to comment
Share on other sites

  • 2 weeks later...

I'm going to very strongly agree with this suggestion, as I feel its very important, but for a slightly different reason.

Many modpacks add quite a variety of liquids - but when "diving" into them, the fog color is either water or lava.

Ability to override the color would increase the immersion of these mods significantly.

Ability to control the depth of fog present would be quite useful as well, for custom liquids as well as for reasons described here (custom equipment, potion effects, and the like).

 

TL;DR:  +1.

Oh, ya! That crossed my mind, but I guess I forgot about it. Huh. :) Oil could actually look black instead of blue from the inside.

Link to comment
Share on other sites

As I said before, this crap isn't needed you guys wanna change a files to something lower then the rendering will allow.

Seriously. You guys have yet to actually say what you wanna do and why.

AND you ship the whole decompiled mojang class really.. bad form man ...

 

you may think its not "Needed" but technically forge is not needed for making a mod some other bloke could vary well make there own api for there mod.

what there saying is that the mod may not have direct use for you or others but give people an ability to use it and people will probably use it.

 

For example:

a person is making a race mod to add races like dwarves elves and so on. In caves the mod could add fog then some races with the hook would be able to see thru the fog while others can't.

as well as what Azaka7 is trying to do

 

it would be nice to have the ability to change the fog clarity

 

give them the means to do something and they will use it that's my opinion

Link to comment
Share on other sites

They have the means, in the respiration enchantment.

What they are wanting to do is set a number outside the range that rendering allows and thus cause GL error spam.

I've yet to see how that's a good idea.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

technically speaking what they are wanting to achieve is the ability to change the clarity of the water fog based on if you have an equipped item and/or respiration enchantment. not necessarily changing the rendering if doesn't have to be a change that affects lighting or render distance. just to be able to change how the underwater fog works.

Link to comment
Share on other sites

They have the means, in the respiration enchantment.

What they are wanting to do is set a number outside the range that rendering allows and thus cause GL error spam.

I've yet to see how that's a good idea.

 

So, I doubt you've looked at how Minecraft determines the intensity of water fog.... In a certain class file, it checks to see if the player is wearing a helmet with the respiration enchant, then sets the fog's strength to a value corresponding to the respiration's strength. It also changes the color of the water fog, brightening it when the respiration is higher. The enchant itself doesn't tell Minecraft to reduce the fog. I've checked. I don't want to force the respiration enchant onto the helmet/mask because of the default breathing ability and the inability to enchant it further without books. As for GL error spam, I've been using my makeshift API, and not once have I gotten GL error spam when things are set up correctly. The fog levels can go surprisingly low and high. The colors have a wonderful range as well.

Link to comment
Share on other sites

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I installed a modpack from curseforge and it came with a 1.16.5 server. I did everything I normally do to set up a server yet this time it came back with bunch of errors.   [26Jan2022 15:45:27.619] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.23, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui] [26Jan2022 15:45:27.621] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_321 by Oracle Corporation [26Jan2022 15:45:27.850] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [26Jan2022 15:45:27.873] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/E:/Extra/MC001/VH001/VaultHunters-OfficialModpack-1.12.4-Server/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=SERVER [26Jan2022 15:45:28.735] [main/INFO] [STDERR/]: [org.antlr.v4.runtime.ConsoleErrorListener:syntaxError:38]: line 1:0 token recognition error at: '~' [26Jan2022 15:45:29.262] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V [26Jan2022 15:45:29.262] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66) [26Jan2022 15:45:29.262] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.ClassLoader.loadClass(Unknown Source) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.Class.forName0(Native Method) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.lang.Class.forName(Unknown Source) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.service.modlauncher.ModLauncherClassProvider.findClass(ModLauncherClassProvider.java:67) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.platform.MixinConnectorManager.loadConnectors(MixinConnectorManager.java:70) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.platform.MixinConnectorManager.inject(MixinConnectorManager.java:59) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.platform.MixinPlatformManager.inject(MixinPlatformManager.java:196) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.MixinBootstrap.inject(MixinBootstrap.java:202) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:201) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.initializeLaunch(MixinLaunchPluginLegacy.java:195) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchPluginHandler.lambda$announceLaunch$9(LaunchPluginHandler.java:97) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at java.util.HashMap.forEach(Unknown Source) [26Jan2022 15:45:29.263] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchPluginHandler.announceLaunch(LaunchPluginHandler.java:97) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:52) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [26Jan2022 15:45:29.264] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:     at net.minecraftforge.server.ServerMain.main(ServerMain.java:57)   Any help would be great, trying to load up the Vault hunters modpack. Thanks.
    • When i launch forge-1.16.5-36.2.23.jar eula.txt doesnt come but in older version like 1.12.2 it comes idk why. do you guys know how i can fix this ?
    • MegaMiner is just my playground mod. Here's the entire MegaMinerEvents class. It's just a static event receiver.   package nu.rydin.explodingarrows.common.events; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import nu.rydin.explodingarrows.common.Main; import nu.rydin.explodingarrows.common.enchantments.ModEnchantments; import java.util.LinkedList; @Mod.EventBusSubscriber(modid = Main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class MegaMinerEvents { private static final class BlockToBreak { private final BlockPos pos; private final Player player; public BlockToBreak(final BlockPos pos, final Player player) { this.pos = pos; this.player = player; } } private static final LinkedList<BlockToBreak> queue = new LinkedList<>(); @SubscribeEvent public static void onBreakBlock(final BlockEvent.BreakEvent e) { final LevelAccessor world = e.getWorld(); if (world.isClientSide()) { return; } for (final Tag t : e.getPlayer().getMainHandItem().getEnchantmentTags()) { final CompoundTag ct = (CompoundTag) t; if (ct.getString("id") .equals(ModEnchantments.MEGA_MINER.get().getRegistryName().toString())) { MegaMinerEvents.mineNeighborhood(e.getPos(), e.getPlayer(), e.getState().getBlock()); } } } @SubscribeEvent public static void onTick(final TickEvent.ServerTickEvent e) { if (MegaMinerEvents.queue.isEmpty()) { return; } final BlockToBreak b = MegaMinerEvents.queue.removeFirst(); final Level world = b.player.level; final BlockState bs = world.getBlockState(b.pos); bs.getBlock().playerDestroy(world, b.player, b.pos, bs, null, b.player.getMainHandItem()); world.removeBlock(b.pos, true); // MegaMinerEvents.mineNeighborhood(b.pos, b.player, bs.getBlock()); System.out.println(MegaMinerEvents.queue.size()); } private static void mineNeighborhood( final BlockPos pos, final Player player, final Block blockType) { final float x0 = pos.getX(); final float y0 = pos.getY(); final float z0 = pos.getZ(); for (float z = z0 - 1.0F; z <= z0 + 1; z += 1.0) { for (float y = y0 - 1.0F; y <= y0 + 1; y += 1.0) { for (float x = x0 - 1.0F; x <= x0 + 1; x += 1.0) { final BlockState b = player.getLevel().getBlockState(pos); if (b.is(blockType)) { MegaMinerEvents.queue.addLast(new BlockToBreak(pos, player)); } } } } } }  
  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.