Jump to content

[SOLVED] [1.7.10] Cross-dimensional chunk loading/rendering, server & client


Elyon

Recommended Posts

Hi!

 

 

I have been toying with forced chunk loading through the

ForgeChunkManager

.

 

I have tried following the suggestions in this and that topic, but either they are too vague or I am too daft to make it work.

 

 

Either way, I am successfully registering my (stub)

LoadingCallback

class in

CommonProxy

:

 

public void preInit(FMLPreInitializationEvent event) {
    super.preInit(event);
    ForgeChunkManager.setForcedChunkLoadingCallback(Chocolate.instance, null);
}

 

As it needs to work for both the combined client/server singleplayer experience, as well as for dedicated servers, I felt I couldn't put it in

ServerProxy

.

 

My Block class similarly successfully requests a ticket and forces the chunk:

 

@Override
public void onBlockAdded(World world, int x, int y, int z) {
    super.onBlockAdded(world, x, y, z);

    if (!world.isRemote && this.ticket == null) {
        this.ticket = ForgeChunkManager.requestTicket(Chocolate.instance, DimensionManager.getWorld(1), ForgeChunkManager.Type.NORMAL);

        if (this.ticket != null) {
            ForgeChunkManager.forceChunk(this.ticket, new ChunkCoordIntPair(0, 0));
            FMLLog.info("Forcing chunk ( %d , %d )", 0, 0);
        }
    }
}

 

I have tried to paste only the related bits of code, but please let me know if I ought to paste more code. These are the only bits I have that relate to chunk loading, though.

 

Note that I am well aware the

ticket

field (and indeed, the instance) of my Block class is shared across all blocks of that class. Currently I am simply testing whether I can force chunk ( 0 , 0 ) in the Nether to be loaded while I am in the overworld.

 

I built a simple command block clock completely within chunk ( 0 , 0 ) that outputs "Nether" to the chat once per second whenever it is loaded. If I travel to the Nether, it joyfully chirps "Nether" every second, but as soon as I leave the Nether, it ceases to do so.

 

 

Certainly, I am just missing something obvious, here - but I have no idea what grave oversight I have made.

 

 

-----

 

 

As a bonus/follow-up question that need not be answered (I will be working on it myself, soon as I can get regular cross-dimensional chunk loading working):

 

How would I go about force-loading chunks not only serverside, but clientside as well?

 

I would like to be able to load chunks cross-dimension for rendering remote Nether regio-- uh. Remote chunks in the Nether. Yes.

 

 

Any feedback/constructive criticism will be appreciated :)

 

Thanks!

Link to comment
Share on other sites

Ah, yes. The log.

 

The "Forcing chunk" message is being printed (and only once, when the block is added).

 

From that, and from the fact there is no errors or warnings or otherwise indications that the call had failed, I make the assumption that the

ForgeChunkManager#forceChunk

call succeeds, as well.

 

There aren't any gotcha's regarding cross-dimension chunk loading, I presume?

 

 

As for chunk loading cross-dimension on the client side - I guess I will have to reimplement what I need for my idea to work, then.

 

It really is vital for me that both the Overworld and the Nether are rendered simultaenously without unloading one or the other, sadly.

 

 

EDIT: You are right, there is no good reason to even keep a CommonProxy, when I might just as well put the code there in my main mod class. Thank you!

Link to comment
Share on other sites

Hmm. I will try having a go at outputting the values of the various fields of the

ForgeChunkManager

cache, to see if I can pinpoint the issue.

 

You'll most likely need a RenderGlobal instance for every additional World you're gonna load, because that is what manages the chunk renderers (chunk as in rendering chunk = 16 x 16 x 16).

I figured as much. Well, thank you, now I know that approach is probably the best (only) way to go about it. I have already written quite a bit of a custom world renderer, so it shouldn't be too difficult to keep another instance of

RenderGlobal

around specifically for that renderer.

 

I realise the client was never meant to be in more than one dimension at once, but I am sure I can work around that. I may turn to asking more questions about this approach, once I can get the server chunk loader (a prerequisite for client chunk loading, I presume) working.

 

Again, thank you for your input.

 

I will update this thread once I solve the issues mentioned.

Link to comment
Share on other sites

Welp.

 

For future reference, the Nether is dimension -1, not 1.

 

The chunk now loads as expected, and the command block clock chirps away even while I am in the overworld, having never entered the Nether.

 

 

Now, I am wondering how to fetch the Nether chunks while in the Overworld on the client.

 

Since I have no experience with packets in Minecraft, this seems a daunting task. I will give it a go and report my findings.

 

In the meantime, any additional pointers to the best course of action will be immensely positively received :)

Link to comment
Share on other sites

I went ahead and worked some more on clientside loading and rendering of chunks.

 

 

This is the current modus operandi:

  • Client adds block in overworld
  • Server sends ChunkMessage to client
  • Client parses chunk message, gets chunk from separate WorldClient, fills chunk with received data, and marks it for render update
  • Client's RenderCamera calls renderWorld after setting up basic rendering stuff
  • Separate RenderGlobal with the WorldClient from above calls sortAndRender

Everything in that list seems to work by itself, according to numerous FMLLog#init calls, as well as the fact that using Minecraft's native RenderGlobal/WorldClient renders the overworld exactly as expected at the given coordinates.

 

However, using a separate RenderGlobal/WorldClient (as initialized in RenderCamera#initialize, called in ChunkMessage.Handler#onMessage), populated as described above and seen in the ChunkMessage.Handler class, only the sky is rendered.

 

Disabling the call to RenderGlobal#renderSky() for the separate RenderGlobal/WorldClient pair - which I have done in the pasted code already - leaves me with the result of having an absolutely transparent quad.

 

 

As said, most if not all the items in the list work as expected on their own, and I suspect the issue is related to what happens between Chunk#fillChunk and RenderGlobal#sortAndRender. However, I cannot pinpoint why the sortAndRender call does not work for the separate RenderGlobal/WorldClient pair with the populated chunk data.

 

I have been combing over the vanilla/forge classes to try gaining some insight into what I must do for these "fake" filled chunks to render, but so far, I have come up with nothing.

 

 

Any input on the matter will be immensely appreciated. If there is any more info I should provide (there are no error logs as there are no errors), I will try my very best to do so.

 

I cannot imagine how the issue could be found anywhere else than in the code I have posted, though.

 

 

Thank you for your time!

Link to comment
Share on other sites

Ah, it seems I forgot to paste the code where I instantiate a new EntityCamera for use as

renderViewEntity

, as well as where I set that. Thanks for pointing that out!

 

I have since moved some things around, still to the same effect, though:

 

I instantiate a new clientside EntityCamera on line 60 of RenderCamera. EntityCamera is just a stub descendant of EntityLivingBase.

 

Furthermore, before the call to

RenderCamera#renderWorld

, I made sure to set the

Minecraft#renderViewEntity

to this EntityCamera instance. After the call, I reset it.

 

I have moved this getting and setting of

Minecraft#renderViewEntity

into RenderCamera#renderWorld, as can be seen in the updated paste from the paragraph above.

 

 

As said, this whole setup works brilliantly so long as I use

Minecraft#renderGlobal

and

Minecraft#theWorld

, though - but that renders only the current dimension, not specifically the Nether.

 

Thank you very much for your input, and my apologies for not having pasted the code where I instantiate and set a new renderViewEntity!

Link to comment
Share on other sites

After digging around in various vanilla rendering classes, I figured out the issue:

 

I needed to call

RenderGlobal#updateRenderers

before calling

RenderGlobal#sortAndRender

.

 

I more or less consider the issue solved, but I will wait a few hours and see if I stumble upon any more clientside chunk rendering issues related to this thread before marking it [sOLVED].

Link to comment
Share on other sites

I have been working hard on making clientside chunk loading/rendering done, and I have made great progress.

 

Now (and for the past two days), however, I am faced with the issue of only chunks with positive X and Z coordinates render. For some - to me inexplicable - reason, chunks with negative X or Z coordinates refuse to render.

 

I have verified that the chunk data for all chunks is:

  • Serialised properly by the server
  • Sent by the server
  • Received by the client
  • Assembled by the client
  • Filled into the correct chunks on the client
  • Existing on the client at the time of rendering

 

Yet the custom world chunks at (0, 0) and all other positive coordinates render flawlessly, while not a single custom world chunk at (0, -1) or any other negative coordinate combination render at all.

 

I have dug through the entirety of the RenderGlobal and WorldRenderer classes, inserting conditional breakpoints and outputting various values, but nothing at all seems out of place in my renderGlobal instance compared to the default renderGlobal instance's way of handling things.

 

These are the related parts of my

EntityCamera

class, and just in case it might be a problem with the chunk block injection, here is the

ChunkResponse.Handler

class, as well.

 

Bear in mind I have verified that the data received is correct, and that all the chunks stay populated both pre- and postrender.

 

 

EDIT: If you don't clip your renderers, it'll just clip with the last clipping used - in this case, that was along the X- and Z-axes.

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

    • I am working on a modpack. When I try to access my server, Minecraft suddenly stops responding for no apparent reason, but I tested the same modpack on my friend's PC and it functions flawlessly there. One thing I have noticed is that the message "[Render thread/WARN] [io.gi.ap.ap.Apoli/]: Received unknown attacker" appears in the log each time my game crashes. My frame rate is high, about 100, and I do not have any mods called Apoli. 9000 MB of the 16000 MB of RAM are allotted to me. Almost everything I could do has been done (updating drivers, removing some mods, lowering the graphic settings, testing singleplayer, etc.) I will leave the moderator list and the latest.log down here.   https://mclo.gs/pYqKP15 (Cannot upload due to file size on pastebin.) Mods: [✔] [1.18.2]-Medieval-Siege-Machines-v1.17 [✔] [1.18.2-forge]-Epic-Knights-8.2 [✔] AchievementOptimizer-1.18.2-1.0.2 [✔] AdvancementPlaques-1.18.2-1.4.5.1 [✔] alexsmobs-1.18.6 [✔] antiqueatlas-7.1.1-forge-mc1.18.2 [✔] Apotheosis-1.18.2-5.8.1 [✔] appleskin-forge-mc1.18.2-2.5.1 [✔] Aquaculture-1.18.2-2.3.12 [✔] aquamirae-5.api10 [✔] archbows-1.0.9-1.18.2 [✔] architectury-4.12.94-forge [✔] armorunder-mc1.18.2-3.0.1 [✔] astikorcarts-1.18.2-1.1.2 [✔] Atlas-Lib-1.18.2-1.1.8 [✔] BetterAdvancements-1.18.2-0.2.0.146 [✔] betteranimalsplus-1.18.2-11.0.10-forge [✔] betterbiomeblend-1.18.2-1.3.5-forge [✔] BetterCompatibilityChecker-1.1.21-build.48+mc1.18.2 [✔] betterfpsdist-1.18.2-1.5 [✔] BetterPingDisplay-1.18.2-1.1 [✔] blockui-1.18.2-0.0.71-ALPHA [✔] BloodAndMadness-Forge1.18.2-v2.1.4 [✔] blueprint-1.18.2-5.5.0 [✔] BOMD-Forge-1.18.2-1.0.6 [✔] Bonfires-1.18.2-1.2.18-2062213 [✔] Bookshelf-Forge-1.18.2-13.3.56 [✔] born_in_chaos_[Forge]1.18.2_1.17 [✔] BrassAmberBattleTowers-1.18.2-2.3.12 [✔] caelus-forge-1.18.1-3.0.0.2 [✔] callablehorses-1.18.2-1.2.2.5 [✔] cameraoverhaul-1.0-1.18.2 [✔] carrotslib-mc1.18.2-4.0 [✔] catalogue-1.6.2-1.18.2 [✔] champions-forge-1.18.2-2.1.6.3 [✔] citadel-1.11.3-1.18.2 [✔] cloth-config-6.5.116-forge [✔] ColdSweat-2.3-b04f [✔] collective-1.18.2-7.7 [✔] configured-2.0.1-1.18.2 [✔] connectedness-1.18.2-2.0.1a [✔] Controlling-forge-1.18.2-9.0+23 [✔] corpse-1.18.2-1.0.2 [✔] CosmeticArmorReworked-1.18.2-v2a [✔] create-1.18.2-0.5.1.f [✔] Croptopia-1.18.2-FORGE-2.1.0 [✔] ctov-2.9.4 [✔] CullLessLeaves-Reforged-1.18.2-1.0.5 [✔] curios-forge-1.18.2-5.0.9.2 [✔] DarkerSouls1.18.2Forgev1.3.1 [✔] Divine Weaponry v1.4 1.18.2 [✔] DoggyTalentsNext-1.18.2-1.18.18 [✔] domum_ornamentum-1.18.2-1.0.77-ALPHA-universal [✔] dragonmagicandrelics-1.18.2-2.1.38 [✔] dragonseeker-1.1.1-1.18.2 [✔] dungeons_enhanced-1.18.2-3.2.1 [✔] DungeonsArise-1.18.2-2.1.52-release [✔] dungeonsweaponry-1.12.2-1.18.2 [✔] EFMCompat 18.2.0 [✔] EnchantmentDescriptions-Forge-1.18.2-10.0.17 [✔] EnigmaticLegacy-2.25.0 [✔] Entity_Collision_FPS_Fix-forge-1.18.2-1.0.0 [✔] entity_model_features_forge_1.18.2-2.0.2 [✔] entity_texture_features_forge_1.18.2-6.0.1 [✔] entityculling-forge-1.6.1-mc1.18.2 [✔] epic_fight_battle_styles-1.0.2 [✔] EpicFight-18.5.24 [✔] falchionmoveset-18.5.0 [✔] FarmersDelight-1.18.2-1.2.3 [✔] Fastload-Reforged-mc1.18.2-3.4.0 [✔] ferritecore-4.2.2-forge [✔] finsandtails-1.18.2-1.1.1 [✔] fish_of_thieves-mc1.18.2-v1.1.1-forge [✔] Forge 1.18.2 Minecraft Middle Ages 0.0.4 [✔] francium-1.18.2-1.0.1 [✔] ftb-essentials-1802.2.2-build.83 [✔] ftb-library-forge-1802.3.11-build.177 [✔] geckolib-forge-1.18-3.0.57 [✔] getittogetherdrops-forge-1.18.2-1.3 [✔] Gobber2-Forge-1.18.2-2.6.37 [✔] goblintraders-1.8.0-1.18.2 [✔] goodall-1.0.2-forge [✔] gpumemleakfix-1.18.2-1.6 [✔] guardvillagers-1.18.2.1.4.4 [✔] healingcampfire-1.18.2-5.2 [✔] hexerei-0.2.2 [✔] horsecombatcontrols-1.18.2-1.0.1 [✔] iceandfire-2.1.13-1.18.2-beta-3 [✔] Iceberg-1.18.2-forge-1.0.49 [✔] ImmediatelyFastReforged-1.18.2-1.1.10 [✔] immersive_melodies-0.1.2+1.18.2-forge [✔] ironchest-1.18.2-13.2.11 [✔] ironfurnaces-1.18.2-3.3.3 [✔] irons_spellbooks-1.18.2-1.1.4.5 [✔] ItemBorders-1.18.1-1.1.5 [✔] ItShallNotTick-1.0.22-build.34 [✔] Jade-1.18.2-forge-5.3.2 [✔] JadeAddons-1.18.2-forge-2.5.0 [✔] jecalculation-forge-1.18.2-4.0.4 [✔] jeed-1.18.2-1.11 [✔] jei-1.18.2-forge-10.2.1.1008 [✔] jepp-1.18-1.0.0 [✔] JustEnoughAdvancements-1.18.2-3.2.0 [✔] justenoughbreeding-forge-1.18.2-1.2.1 [✔] JustEnoughProfessions-1.18.2-1.3.0 [✔] JustEnoughResources-1.18.2-0.14.2.206 [✔] Kobolds-2.9.3-1.18.2-final [✔] kotlinforforge-3.12.0-all [✔] L_Enders Cataclysm-0.51-changed Them -1.18.2 [✔] lazydfu-1.0-1.18+ [✔] leaky-1.18.2-1.3 [✔] LegendaryTooltips-1.18.2-1.3.1 [✔] letmedespawn-1.18.x-1.19.x-forge-1.0.3 [✔] LibX-1.18.2-3.2.19 [✔] lightspeed-1.18.2-1.0.5 [✔] lodestone-1.18.2-1.4.2 [✔] loot_journal-1.1.0-1.18 [✔] lootr-forge-1.18.2-0.3.29.71 [✔] malum-1.18.2-1.5.0.1 [✔] medieval_paintings-1.18.2-7.0 [✔] memoryleakfix-forge-1.17+-1.1.2 [✔] MerchantMarkers-1.18.2-forge-1.3.1 [✔] minecolonies-1.18.2-1.1.148-BETA [✔] MmmMmmMmmMmm-1.18.2-1.5.2 [✔] mna-2.0.0.33 [✔] modernfix-forge-5.18.0+mc1.18.2 [✔] modonomicon-1.18.2-1.33.1 [✔] mowziesmobs-1.6.3 [✔] multi-piston-1.18.2-1.2.15-ALPHA [✔] mythicmounts-18.2-7.2-forge [✔] NefsFarmDecoExpGear+v0.3(1.18.2) [✔] nutritionalbalance-1.18.2-3.2.4 [✔] obscure_api-10 [✔] occultism-1.18.2-1.84.0 [✔] octolib-1.18.2-0.3 [✔] oculus-mc1.18.2-1.6.4 [✔] OfflineSkins-1.18.2-v2 [✔] Orcz_0.83_1.18.2 [AI FIXES] [✔] origins-classes-forge-1.1.6 [✔] origins-forge-1.18.2-1.5.0.2-all [✔] Paraglider-1.18.2-1.6.0.6 [✔] Patchouli-1.18.2-71.1 [✔] physics-mod-pro-v153-forge-1.18.2 [✔] Placebo-1.18.2-6.6.7 [✔] player-animation-lib-forge-1.0.2+1.18 [✔] pluto-mc1.18.2-0.0.6 [✔] polymorph-forge-1.18.2-0.50 [✔] Prism-1.18.2-1.0.1 [✔] projectvibrantjourneys-1.18.2-4.1.1 [✔] puffish_attributes-0.5.0-1.18.2-forge [✔] puffish_skills-0.13.1-1.18.2-forge [✔] realmrpg_imps_and_demons_0.9.0_forge_1.18.2 [✔] recruits-1.18.2-1.11.4.2 [✔] reforgium-1.18.2-1.0.12a [✔] Reldas+Medieval+Armor+1.18.2(2.0) [✔] relics-1.18.2-0.6.2.4 [✔] reputation-1.18.2-1.0.0 [✔] RPG_style_more_weapons_4.9.6R [✔] Rrls-1.18.2-3.1.0-forge [✔] rubidium-0.5.6 [✔] rubidium-extra-0.4.18+mc1.18.2-build.86 [✔] saturn-mc1.18.2-0.1.5 [✔] savage_and_ravage-1.18.2-4.0.1 [✔] seaborgium-mc1.18.2-0.1.3b [✔] SereneSeasons-1.18.2-7.0.0.15 [✔] ShoulderSurfing-Forge-1.18.2-4.2.1 [✔] SimpleLogin-1.18.2-1.0.0 [✔] simplyswords-forge-1.40-1.18.2 [✔] SleepingOverhaul-2.0.2-Forge-1.18.2 [✔] smallships-forge-1.18.2-2.0.0-b1.3.1 [✔] SmartBrainLib-forge-1.18.2-1.9 [✔] smoothboot(reloaded)-mc1.18.2-0.0.4 [✔] sophisticatedbackpacks-1.18.2-3.20.2.1036 [✔] sophisticatedcore-1.18.2-0.6.4.604 [✔] soul_like_armors_reworked_1.18.2_(v138) [✔] SpartanShields-1.18.2-3.0.1 [✔] SpartanWeaponry-1.18.2-3.0.5-all [✔] SpitItOut-1.18.2-1.0.1 [✔] starterkit-1.18.2-5.3 [✔] Structory-1.18.2-1.0.2 [✔] structure_gel-1.18.2-2.4.8 [✔] structurize-1.18.2-1.0.424-ALPHA [✔] swem-forge-1.18.2-1.4.6 [✔] takesapillage-1.0.3-1.18.2 [✔] TerraForged-1.18.2-0.3.1-alpha-2 [✔] TextruesRubidiumOptions-1.0.8-mc1.18.2 [✔] theimpossiblelibrary-1.18.2-0.3.1 [✔] torchmaster-18.2.1 [✔] Totemic-forge-1.18.2-0.12.9.1 [✔] tov-0.1(ALPHA) [✔] towns_and_towers_forge-1.10.0.1+1.18.2 [✔] TravelersTitles-1.18.2-Forge-2.1.1 [✔] unoriginal-datapack [✔] untamedwilds-1.18.2-2.4.3 [✔] upgrade_aquatic-1.18.2-4.0.0 [✔] valhelsia_core-forge-1.18.2-0.4.0 [✔] valhelsia_structures-1.18.2-0.1.1 [✔] Vampirism-1.18.2-1.8.8 [✔] WeaponsOfMiracles-18.1.7.38 [✔] Werewolves-1.18.2-1.0.0.1 [✔] workers-1.18.2-1.7.8 [✔] YouDied-1.18.1-1.0.2.9 [✔] YungsApi-1.18.2-Forge-2.2.9 [✔] YungsBetterMineshafts-1.18.2-Forge-2.2 [✔] YungsBetterStrongholds-1.18.2-Forge-2.1.1 [✔] zoomerzoom-1.4
    • Turn casual moments into unforgettable dates – choose the best casual dating site! Sexy Womans from your town
    • I am trying to make a Modpack for me and my friend and the buddycard expansion mod keeps crashing is there anything I can do, I'll copy and paste the crash message and the attack a link to the crash log below: Buddycards Expainsion (buddycardsexp) encountered an error during the common_setup event phase java.lang.NoSuchMethodError: 'void com.wildcard.buddycards.item.BuddycardBinderItem.<init>(com.wildcard.buddycards.registries.BuddycardsItems$BuddycardRequirement, net.minedcraft.world.item.Item$Properties, com.wildcard.buddycards.core.BuddycardSet)'   https://drive.google.com/file/d/1XlEYKVi2uUyS_UxRKByqCKlfnVswvHbb/view?usp=sharing
    • So, my friend and I are playing modpack on version 1.20.1. Sometimes, when a friend dies, he crashes from the server and cant rejoin anymore, so I have to load backup of the world. After loading the backup, everything goes well, but then sometimes it crashes again after death. Here is lof file: https://pastebin.com/KaZTmvhc The lines where the friend crashes start at line 2471 
    • The Minecraft launcher is now "preparing" the game but is taking forever. Any suggestions?
  • Topics

×
×
  • Create New...

Important Information

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