Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.12.2] Not all new, randomly generated chests are generated with locks #33

Open
Dimentive opened this issue Jan 9, 2020 · 9 comments
Labels
bug Something isn't working compatibility Changes related to other projects help wanted Extra attention is needed

Comments

@Dimentive
Copy link

With B:generate_locks set to true, I explored a new, randomly generated dungeon, and while most of the chests had locks, about 1-in-4 chests did not have a lock on it.

Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.5.2847 (latest for 1.12.2)
  • Locks: 2.2.1 (latest for 1.12.2)
@MercurialPony
Copy link
Owner

What other mods do you have installed?

@MercurialPony MercurialPony added the bug Something isn't working label Jan 10, 2020
@Dimentive
Copy link
Author

Mod list.

@MercurialPony
Copy link
Owner

Does this happen with only one mod in particular or with every generation mod? Have you noticed if locks don't spawn on all chests generated by a particular mod or only on some chests generated by that mod?

@Dimentive
Copy link
Author

Seems to happen randomly with chests spawned by several different mods, like Roguelike Dungeons and Actually Additions. I don’t think I tested vanilla-generated chests, but I would guess the same remains. Some chests are locked whilst some aren’t.

@MercurialPony MercurialPony added compatibility Changes related to other projects help wanted Extra attention is needed labels Jul 20, 2020
@Dimentive
Copy link
Author

Most naturally generated chests I find are still unlocked. Only a few I managed to find are locked. These are chests generated by the Roguelike Dungeons mod.

I had ”generation chance” in Locks’ config set to 0.7 as it was by default but changed it to 1.0, although I didn’t restart my game, so I’m not sure if it didn’t take effect.

@Laike-Endaril
Copy link

I noticed a similar issue in a massive modpack I'm working on
MC 1.12.2, Locks 2.5.1, over 200 other mods
Set generation chance to 1 (100%)

After finding many unlocked chests, I decided to dig into the code.

I added some printouts to the lock generation section of the code and noticed it wasn't even finding the TEs for the chests. Said TEs exist when I find the chests ofc, so I figured it was a timing issue (some mods are adding chests after the lock generation runs).

First I tried just setting the @SubscribeEvent priority to LOWEST, but that unfortunately did not solve the issue. I don't know if some mods are doing their chest generation in the same event at LOWEST and are alphabetically later, or if they're using the callback that happens after the particular event being used, or something else, but in any case...

...I then tried caching the PopulateChunkEvent.Post events and then executing lockgen code on them later in the same tick, and this fixed the issue. I now find locks on all generated chests (chance set to 1).

On a somewhat related note, I also noticed the code was only rolling per-chunk and not per-chest, so all chests in a chunk would either have locks or not (assuming they weren't being passed by due to the issue this thread is about), so I changed that as well. I assume it was not intentional.

I'll PR for both after I grab something to eat.

@MercurialPony
Copy link
Owner

I fixed this in the latest update, but the 1.12.2 backport is as of yet unfinished

@bruhwithdabeans
Copy link

bruhwithdabeans commented Aug 24, 2021

The issue still there on 1.12.2 backport, any update when it will be finished?

trying to do a modpack, and zero chests has locks on them even with 100% probability of them spawning

been waiting since mid of last year for it to be fixed.

@bruhwithdabeans
Copy link

I fixed this in the latest update, but the 1.12.2 backport is as of yet unfinished

What is the "Update" for it to be finished, its has been 4months for this, and just still curious how much longer it will take for this issue to be fixed for 1.12.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Changes related to other projects help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants