Clumps

Clumps

197M Downloads

Mending Issue

Wubzel opened this issue ยท 10 comments

commented

I was playing on an smp with my friends and we noticed that if you have it installed on the server mending only takes a quarter of the exp to repair itself instead of all of it. I'm not sure if that's intended or a bug but its a little annoying because tools take a lot longer to fix with mending

commented

mc version and clumps version?

commented

Clumps 6.0.0.20 and Minecraft 1.16.5

commented

@TheNormMan pinging you since you also experienced this.

Update to the latest version (6.0.0.21) and tell me how it feels.

The new way it does it is nearly exactly the way vanilla does it.

commented

Oh cool, that was so much easier than with eclipse.
Soo, new version looks nice. Great!

The only problem i get now is following:
If you have a mobfarm and a sword with mending and also an item with mending u want to repair:
Vanilla: some (very few) experience go to lvl, remaining go to tool
Clumps: much more go to level
I thought it is, because the orbs at Clumps are put together and if the orb is repairing the sword (wich is a damaged mending eqiupment with damage 1) all remaining (so all) xp go to the level and just all following orbs go to the tool.
But you said (and I see in commit) you put all the xp seperatly to the player, so i dont get this.

commented

I cannot think of any reason why that would be happening, I am giving the player the xp exactly how vanilla would (albeit all at once instead of staged over multiple ticks, but that shouldn't cause any issues)

commented

The value in the map shouldn't matter

I did do multiple tests to make sure it was always correct (which it was), but all of the mending is happening without any outside influence, so it is the same as if it was a normal vanilla orb being applied by itself

commented

yeah but still buggs :/,
i tried today getting a workspace on my PC to try some things, but can't build this mod,
isn't it enough to download this and gradle it?
I also downloaded the forge mdk for 1.16.5 and copied the src folder but the compiler still gives errors

//see on my IssueTicket, i edited the last answer

//oh new version, I check it

commented

It is impossible for it to still be bugged.

Basically how it works now is by keeping a Map of value -> amount

So if a Clumps orb was created from 2 vanilla xp orbs, one with an xp value of 2, and the other with an xp value of 1, what it does it basically store it as:

{
 "1": 1,
 "2": 1
}

with the "1" and "2" being the xp orb value, and the 1s being how many xp orbs have been clumped with that value.
so if this orb now gets clumped with another orb that has a value of 1, it will look like:

{
 "1": 2,
 "2": 1
}

Now that I am storing the exact amount of orbs that are clumped together, when mending is applied I go through the map of orbs and I apply mending for each orb.

Literally the only difference there is now between Clumps and Vanilla is that if you have a Clumps xp orb that has 1000xp, with 900 of that xp being made up of 1 value xp orbs, and then the last 100xp is made up of a single orb with a value of 100
(looks like this)

{
 "1": 900,
 "100": 1
}

It will loop through all of the 900 orbs with a value of 1, applying mending for each orb before it reaches the orb with 100.

While in vanilla it all depends on which orb collides with the player first, so the very first orb that the player collides with could be the 100xp orb and it will use it first.

I don't believe there is any actual difference between how it works, the player still gets the xp and the items still get repaired.

As for setting the mod up, I would need to see what issues you are running into to be able to help, but you should just be able to clone the repo and open it in intelliJ

commented

I honestly cannot think of a reason why it would be different.

There also isn't anything else I can actually do to somehow achieve a full vanilla mending effect, what I have now is the closest thing so unfortunately this is it.

commented

So i killed some skelettons and watched on the durability on an mending pickaxe, with and without mending on the sword:
without mod:
-with or without mending, both repaired about 325 each time (+/- 10) (full skeletton-mob in 1x1 block)
with mod:
+without mending on sword: about 325 too
+with mending on sowrd: something between 120 and 210 (and remaining to lvl)

So basically it works fine, but this special case shows a bug, but I don't know why too.
Maybe anyone else see's it