Multiverse-Inventories icon indicating copy to clipboard operation
Multiverse-Inventories copied to clipboard

New Sharables

Open nicegamer7 opened this issue 4 years ago • 15 comments

This PR adds Advancements, Game Stats, and Recipes Sharables, and thus closes #340.

It's not fully complete yet, as there remains one minor issue: when switching groups, Advancements are announced as though the player is receiving them for the first time.

Other than that, there are some smaller notes I wanted to discuss, such as whether there is a better way of serializing the Advancements, and your thoughts on the sharable's overall efficiency.

nicegamer7 avatar May 13 '20 23:05 nicegamer7

I've made it so that the ANNOUNCE_ADVANCEMENTS gamerule on the world the player is travelling to gets set to false if wasn't already, then after updating the player's advancements it's set back to what it was previously, if it was changed at all. This isn't a perfect solution as the player still sees the notifications in the top right of their screen, but it isn't announced in chat. I've requested a way to do that hide those notifications here.

nicegamer7 avatar May 14 '20 02:05 nicegamer7

There is a new Paper PR which may affect the Advancement sharable, see PaperMC/Paper#3454.

If this PR gets merged and ends up affecting the behaviour of the sharable, we'd probably have to use PaperLib to fix it.

The case I have in mind is if the player is teleported as they join, the sharable may need to be saved, but this may happen before the advancements are loaded. This may never happen, I'm just speculating.

nicegamer7 avatar May 26 '20 22:05 nicegamer7

@nicegamer7 This PR is no longer affected by https://github.com/PaperMC/Paper/pull/3454 as it will now block in the API if it is still loading the data.

Proximyst avatar May 27 '20 14:05 Proximyst

I just cleaned up this PR, redoing some bits and making the commits more specific. The biggest difference is that the advancement sharable no longer needs a custom serializer. I guess this is ready for review!

nicegamer7 avatar Jun 05 '20 10:06 nicegamer7

I just rebased this PR onto main so that it's up to date, although, the tests need to be adjusted to account for the new sharables. And as requested, I'm providing a build of this PR below.

~~Multiverse-Inventories-4.2.2-SNAPSHOT.jar.zip~~ (new build below)

nicegamer7 avatar Dec 31 '20 22:12 nicegamer7

Also, note that when switching groups, the advancements are not only announced, but the player is given a certain amount of XP, which causes access to free XP generation by switching groups.

An unrelated question - are there plans to also introduce sharing datapacks for the worlds? It'd be awesome if groups could be assigned certain advancement trees ;) (e.g. having a skyblock map with it's own advancements)

milos7250 avatar Jan 26 '21 19:01 milos7250

I... did not think of that...

Thanks for bringing that to my attention.

With regards to datapacks, there's currently no way for MV to interact with them. So at this time, it's not possible to change any datapack behaviour.

nicegamer7 avatar Jan 26 '21 19:01 nicegamer7

Here's a new build that should be a bit more efficient, and it includes a simple attempt at fixing the XP exploit described above.

~~Multiverse-Inventories-4.2.2-SNAPSHOT.jar.zip~~ (new build below)

nicegamer7 avatar Jan 28 '21 02:01 nicegamer7

And once more, a new build with another attempt at fixing the XP exploit.

edit: the exploit is fixed :)

Multiverse-Inventories-4.2.2-SNAPSHOT.jar.zip

nicegamer7 avatar Jan 28 '21 03:01 nicegamer7

Hey @nicegamer7, I've been beta testing this on a server I'm on based on your latest build and I'm having an issue where occasionally an achievement gets lost as players travel back and forth (for example I lost monster hunter). I've also had a few players report that they've gained achievements they didn't do (for example, How did we get here?)

reediculous456 avatar Aug 03 '21 13:08 reediculous456

Thanks for testing @reediculous456, one thing is that I don't think the progress of advancement is reset, so it perhaps is a case of achieving that advancement just after teleport? Steps to reproduce will be good, that way we have something to work off.

benwoo1110 avatar Aug 03 '21 13:08 benwoo1110

Thanks for testing @reediculous456! I'm glad you found this issue, and as ben said, if you have steps to reproduce that would be very helpful.

nicegamer7 avatar Aug 03 '21 14:08 nicegamer7

So how is this project doing? I would really like a fix for the advancements coming up on world enter, it also spams my discord Minecraft chat with a player getting advancements...

OpenSourceSlime avatar Oct 28 '21 07:10 OpenSourceSlime

I haven't checked, but I'm pretty sure the notifications are client side. If that's the case, there's almost nothing that can be done.

If I'm wrong, we'll need to propose an addition to the Bukkit API.

nicegamer7 avatar Jan 24 '22 05:01 nicegamer7