Jump to content

1.8 - replace all water without scheduling tick updates


brezeeger

Recommended Posts

Hello all,

I've checked out:

http://www.minecraftforge.net/forum/index.php/topic,21625.0.html

 

The block I need to replace is the water with my own forge finite fluid - I strongly dislike the minecraft water physics, and plan to make water appear on the ground when it rains, soak in to form aquifers and leak into all your caves from dirt/mud blocks, etc. It's going to break a ton of things we all so dearly love (like infinite water), but it'll be a whole lot more realistic.

 

I have the physics aspect working really well. It's not even laggy (gasp!).

 

Except when I replace all the water blocks on the prechunk initialization event bit, it sets all those water blocks to be updated. This isn't so bad - unless you are anywhere near large bodies of water such as the ocean.  It then proceeds to go through every single block and calculate the new physics, which tell it to do nothing and stop looking for updates. This also can be a disaster if the block change triggers a sand/gravel fall, at which point the ocean will gradually fill in the caves 1/8 of a block at a time. One wouldn't be the end of the day, but many. Gross.

 

I'm looking for a way to update the blocks and not get the tick update called. That, or potentially a way to remove scheduled block updates (such as right after the block was changed!). That would actually be really useful in the scenario that you have a long delay, but then things change and you want to replace it with a short delay. Finally, another option is to intercept the chunk generation and blanket replace the water blocks with my own before it gets set to the world. I'm currently unfamiliar with Java reflection. I have not delved into world generation at all. Took me long enough to realize classes a==b was false when a and b had the same values... I'm still trying to wrap my head around the basics of Java, which I'm learning with this project (I do know c++ well).

 

I just tried updating the original water blocks as they are used. That was a *slight* disaster when it came to the interactions, trying to get enough converted to do the job, but not have it spread everywhere and clog the system. Ended up with a fair amount of cycling tick loops. I'll still fart around with that,but life would be much easier if I didn't have to deal with minecraft water physics/expectations destroying my own.

 

Thanks in advance for any help.

Link to comment
Share on other sites

Taken from the world class

/**
     * Sets the block state at a given location. Flag 1 will cause a block update. Flag 2 will send the change to
     * clients (you almost always want this). Flag 4 prevents the block from being re-rendered, if this is a client
     * world. Flags can be added together.
     */
    public boolean setBlockState(BlockPos pos, IBlockState newState, int flags)
    

Link to comment
Share on other sites

  • 2 weeks later...

... Well now I feel a bit like a moron now.  Looks like I should not be using the ExtendedBlockStorage class. Nice to see the flag meanings too. For whatever reason, I don't have comments detailing the flags in my Forge.

 

Thanks. Sorry about the late reply! I've been a bit busy lately.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I was trying to play a MOD in my preferred language, but I see that only some items are translated, and I go to debug and I get this information (the only thing that is translated is the bestiary):   [14sep.2024 17:14:36.415] [Render thread/WARN] [net.minecraft.client.resources.language.ClientLanguage/]: Skipped language file: mowziesmobs:lang/es_es.json (com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 394 column 2 path $.config.mowziesmobs.ice_crystal_attack_multiplier) [14sep.2024 17:14:36.421] [Render thread/WARN] [net.minecraft.client.resources.language.ClientLanguage/]: Skipped language file: iceandfire:lang/es_es.json (com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1349 column 4 path $.iceandfire.sound.subtitle.dragonflute)   Is that the reason why everything is not translated? , and is there any way to fix it? Thanks
    • I got my model to render from the models renderToBuffer method. But still not quite what I want. I want to render the model from my renderer's render method. I feel that having access to the renderer and its methods will open some doors for me later down the line. //EntityRendererProvider.Context pContext = ; I want this //ToaPlayerRenderer render = new ToaPlayerRenderer(pContext, false); // if I can get the above line to work, having the methods from the renderer class would be incredibly helpful down the line RenderType rendertype = model.renderType(p.getSkinTextureLocation()); // this should be something like render.getTextureLocation() VertexConsumer vertexconsumer = buffer.getBuffer(rendertype); model.renderToBuffer(stack, vertexconsumer, paLights, 1, 1, 1, 1, 1); // I don't want the render to happen here since it doesn't use the renderer //model.render(p, 1f, pTicks, stack, buffer, paLights); I want to render the model using this It is certainly getting closer though. Probably. I am still worried that even if pContext is initialized this new instance of the renderer class will still hit me with the classic and all too familiar "can't use static method in non-static context"
    • Hello, I am learning how to create Multipart Entities and I tried creating a PartEntity based on the EnderDragonPart code. However, when I tested summoning the entity in the game, the PartEntity appeared at position x 0, y 0, z 0 within the game. I tried to make it follow the main entity, and after testing again, the part entity followed the main entity but seemed to teleport back to x 0, y 0, z 0 every tick (I'm just guessing). I don't know how to fix this can someone help me? My github https://github.com/SteveKK666/Forge-NewWorld-1.20.1/tree/master/src/main/java/net/kk/newworldmod/entity/custom Illustration  https://drive.google.com/file/d/157SPvyQCE8GcsRXyQQkD4Dyhalz6LjBn/view?usp=drive_link Sorry for my English; I’m not very good at it. 
    • its still crashing with the same message
  • Topics

×
×
  • Create New...

Important Information

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