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

[Enhancement]: Have JEI output multiplier match-up to the value of the config. #70

Open
Lanse505 opened this issue Jan 22, 2018 · 19 comments

Comments

@Lanse505
Copy link

Lanse505 commented Jan 22, 2018

MC: 1.12.2
Forge: "Forge-14.23.1.2590"
Survivalist: "Survivalist-1.12.2-2.1.4"

See #46 for Reference.

Currently it doesn't seem that JEI updates to reflect the changes done to:

axemultipliers {
}

See Example:
Config: https://i.imgur.com/lYMHfbq.png

In-Game:
https://i.imgur.com/2F3asRw.png
https://i.imgur.com/5VXE02F.png
https://i.imgur.com/8yxlR8G.png
https://i.imgur.com/O4s6cjO.png
https://i.imgur.com/rbVtj2Z.png

Some of the values are changed due to scripts I've set-up:

gigaherz.survivalist.Choppable.addRecipe(<biomesoplenty:log_0:4>,<biomesoplenty:planks_0> * 2, 1.0, 0.5);

And before you ask, I've set-up scripts for these so I can tweak output values and amounts depending on the planks in question for...... nefarious reasons >.>

@Lanse505
Copy link
Author

Lanse505 commented Jan 23, 2018

Hmm actually >.>
It might be showing the right values if I'm thinking about this correctly.
So base output of 2x, with a config setting of stage 5 of 2x, would result in an output of 4x 🤔

So while digging through the code I see that the level cases range from 0-4 and not 1-5.

This also means that the system would work something like:

Stage X: Default Output * Axe Level Multiplier
Stage Y: x * y = xy
Stage 0: 2 * 0.5  =  1
Stage 1: 2 * 1    =  2
Stage 2: 2 * 1    =  2
Stage 3: 2 * 1.5  =  3
Stage 4: 2 * 2    =  4

What I don't get then is the use of the output multiplier in the crafttweaker support?
Would that then mean that multiplier outputs would be calculated as:

Stage X: Default Output * Axe Level Multiplier * Recipe Multiplier
Stage Y: x * y * z = xyz
Stage 0: 2 * 0.5 * 1  =  1
Stage 1: 2 * 1   * 1  =  2
Stage 2: 2 * 1   * 1  =  2
Stage 3: 2 * 1.5 * 1  =  3
Stage 4: 2 * 2   * 1  =  4

I'm guessing it's due to an existing recipe multiplier(?) or does it replace the Axe Level Multiplier?

@gigaherz
Copy link
Owner

When you register a recipe, the output multiplier specified in the recipe gets used. It happens to default to 2, but other values are possible.

The effective formula is: Recipe Output Multiplier * Axe Level Multiplier * Fortune
If that number is not a whole integer, the remainder is used to decide if it rounds up or down. So: 1.2 would be 1 item + 20% chance of an extra.

@gigaherz
Copy link
Owner

The values from JEI might be wrong, I just haven't gotten around to checking this.

@Lanse505
Copy link
Author

Lanse505 commented Jan 23, 2018

What Multiplier Value does Fortune apply per level?

@gigaherz
Copy link
Owner

I apply fortune differently than for vanilla mining: the multiplier is calculated as: 1+Random(0..Fortune Level), meaning a Fortune I has a chance to drop 2x, Fortune II has a chance to drop 3x, and Fortune III a chance to drop 4x.

@Lanse505
Copy link
Author

Lanse505 commented Jan 23, 2018

So the output formula would be something akin to:
Default Output * (Recipe Multiplier * Axe Multiplier * Fortune Multiplier)
I.E.

2 * (2 * 2 * 2) = 
2 * (4 * 2) = 
2 * (8) = 16 (?)

@gigaherz
Copy link
Owner

No. No "Default output". If the recipe has a 2, and the axe is tier 3, the output per item will be 6.

@gigaherz
Copy link
Owner

If on top of that you have Fortune III, then the output will be ANYWHERE from 6 to 24.

@Lanse505
Copy link
Author

Hmm Interesting

@Lanse505
Copy link
Author

Lanse505 commented Jan 23, 2018

So I'm guessing this means that by default it "assumes" all recipes should have an output of 1 that it applies it math.

Meaning an example like the one above:

gigaherz.survivalist.Choppable.addRecipe(<biomesoplenty:log_0:4>,<biomesoplenty:planks_0> * 2, 1.0, 0.5);

The value of "*2" on the output is redundant(?) since it counts:
output of 1 * (Recipe Multiplier * Axe Multiplier * Fortune)

Sorry if I'm a bit slow on this x'D
Today is my one day off work after working over the weekend so my brain is a bit toasty atm xD

@gigaherz
Copy link
Owner

gigaherz commented Jan 23, 2018

Well so far as multiplication goes, you can always multiply by 1 as many times as you want. 1*2=2, just like how 0+1=1. If it makes it easier to picture in your head, then imagine there's as many 1* as you want, in there.

@gigaherz
Copy link
Owner

gigaherz commented Jan 23, 2018

But I see the problem, you are applying a count to the output itemstack. I ignore that count. Completely.

By which I mean, it's the 1.0 that matters, not the *2 in the item.

@Lanse505
Copy link
Author

Okay good to know.
I'll refactor my recipes to match up with this new information.

On a slightly related/unrelated topic.
Is it possible/would it be possible to implement a system for adding extra axe tiers outside of the 0-4 range to support a large range of axe tiers 🤔

@gigaherz
Copy link
Owner

There isn't a 0..4 limit. If a mod adds an axe that has level 1000, then "1000" will be used in the formula.

@Lanse505
Copy link
Author

Oh Nice!

@Lanse505
Copy link
Author

Final Question:
If I add an axe to the Custom Axes section that already is specified as an Axe.
Would it just return the default value or would it allow me to supersede the default value?

@Lanse505
Copy link
Author

P.s should I leave this issue open for reference sake or close it?

@gigaherz
Copy link
Owner

If an item is present in the axe levels, that number is used. Meaning you can technically override the default value for an axe. Note however that this is limited, since it can't do NBT matching for mod items where the tier is defined in NBT.

Leave it open, the question of the axe multipliers in JEI is still not resolved, is it?

@Lanse505
Copy link
Author

Lanse505 commented Jan 23, 2018

It's "kinda" resolved since my assumption on the math was flawed.
However this issue could probably be converted to an issue based on the question of clarification on output math

Would also be good on a seperate note if the Custom Axes section also had a input example:
Currently:

##########################################################################################################
# customaxes
#--------------------------------------------------------------------------------------------------------#
# Custom Chopping Block axe values for when mods have axes that don't declare themselves to be axes.
##########################################################################################################

Could be:

##########################################################################################################
# customaxes
#--------------------------------------------------------------------------------------------------------#
# Custom Chopping Block axe values for when mods have axes that don't declare themselves to be axes.
# Example: I:minecraft:stone_axe=1
##########################################################################################################

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants