Vanilla furnace gives the same amount of xp regardless of how much you ask it to give.
DefinitelyNotFred opened this issue · 16 comments
What happens:
Vanilla furnace gives the same amount of xp regardless of how much you ask it to give.
What you expected to happen:
For the furnace to give differing amounts of xp based on the input value.
Script used:
https://pastebin.com/raw/SB4MMg5M
Minetweaker.log file:
https://pastebin.com/raw/yGrWFD1T
Affected Versions:
- Minecraft: MC 1.10.2
- Forge: 12.18.3.2185
- Crafttweaker: 1.10.2-3.0.26
Your most recent log file where the issue was present:
The XP always depends on the output, this means when you have the same output you can't have a different XP amounts attached to them.
Probably related to #156
How do you even imagine this to work? You have 3 times the same recipe, how should the furnace choose which of the recipe (and therefore XP) gets outputed?
And the XP depending on the output is a limitation of vanilla, without some hacks it wouldn't work that way
This is what I actually have for that section:
val RottenFlesh = <minecraft:rotten_flesh>;
val RabbitHide = <minecraft:rabbit_hide>;
furnace.addRecipe(RabbitHide, RottenFlesh, 0.5);
No matter what value I put in the number part, be it 50.0, 0.0, or 0.5, the same amount of xp is being returned.
I think you are looking at my script as actual lines in the code, not as examples, which is what I intended. There is only one line in my code adding that recipe.
@jaredlll08 If I put one item in the furnace that I have given an xp value of 50 to, it will return what looks like 1 xp when actually playing the game. If I change the xp value of the recipe to 0.1, save the script, and then reload it, it will also return what looks to be 1 xp.
@BloodWorkXGaming That's alright, I should have been more clear.
I have looked into the vanilla furnace code and you can't give more then 1 xp, any lower combines the outputted items and if it's under 1 it gives it a chance to give one xp or if it's a whole number without decimals it outputs that or if it has decimals and is bigger then 1 it has a chance to add one xp.
Not per item, when taking out multiple items it can get higher, but 1 XP is max per item, not taking into account of the chance to get one more XP, you can look at net.minecraft.inventory.SlotFurnaceOutput@63, that's where it calculates the XP given back and gives the XP.
Saying that you can use the event that is fired when taking the items from the slot to give more XP.
So I did some more testing and I think @GoryMoon is right. I likely didn't do enough testing before since I wasn't expecting it to work that way.
So just to set the record straight, you are saying that putting a number like 50.0 in for the xp value would give only 1 xp; putting in 3.5 would give one xp with a 50% chance for bonus xp; and putting in 0.3 would give a 30% chance to get 1xp, right?
@jaredlll08 No this isn't an issue with CrT, it's a vanilla thing
@DefinitelyNotFred Anything equal or higher then 1 xp will only give 1 xp per item, anything lower has a chance, If you take out 5 items with 0.35 xp reward it will give one xp and have a 75% chance of another one.