Chance precision

- Tweaked jei display of seq. assembly success chance to display <1 and >99 respectively
- Adjusted mechanism recipe to a more rounded success chance (.80537 -> .8)
This commit is contained in:
simibubi 2022-08-18 18:07:43 +02:00
parent 08591b3411
commit bea62d0631
4 changed files with 14 additions and 10 deletions

View file

@ -5359,7 +5359,7 @@ f6e2fb5725f3730d01fae4a2b1a04d11095eab5f data/create/recipes/scorchia_pillar_fro
66e8559dc15ce13042bd007247e2851022362b9e data/create/recipes/scorchia_pillar_from_stone_types_scorchia_stonecutting.json
2e0ecbd3619f080d0fc6fe48307c5a5bcc2e91b4 data/create/recipes/scoria_pillar_from_scoria_stonecutting.json
d6e16599de7424513e1457b07acb6370815d2bd7 data/create/recipes/scoria_pillar_from_stone_types_scoria_stonecutting.json
b49a0da57a179edc087eee224221ded22fd1be01 data/create/recipes/sequenced_assembly/precision_mechanism.json
b3fad45a09a05b285de31283a720b32e6fc63dc6 data/create/recipes/sequenced_assembly/precision_mechanism.json
de17d82738a5e0242eb3109fd2a75337160fc843 data/create/recipes/sequenced_assembly/sturdy_sheet.json
7610e0be633b1ade7ae39db3dbbfe1bd14aa333a data/create/recipes/sequenced_assembly/track.json
5e7648d55555c263539a2696b8d1f8d352a71dc9 data/create/recipes/small_andesite_brick_slab.json

View file

@ -73,6 +73,10 @@
"item": "create:cogwheel",
"chance": 5.0
},
{
"item": "minecraft:gold_nugget",
"chance": 3.0
},
{
"item": "create:shaft",
"chance": 2.0
@ -81,10 +85,6 @@
"item": "create:crushed_gold_ore",
"chance": 2.0
},
{
"item": "minecraft:gold_nugget",
"chance": 2.0
},
{
"item": "minecraft:iron_ingot"
},

View file

@ -57,8 +57,7 @@ public class SequencedAssemblyCategory extends CreateRecipeCategory<SequencedAss
return;
float chance = recipe.getOutputChance();
tooltip.add(1, Lang.translateDirect("recipe.processing.chance", chance < 0.01 ? "<1" : (int) (chance * 100))
.withStyle(ChatFormatting.GOLD));
tooltip.add(1, chanceComponent(chance));
});
int width = 0;
@ -157,8 +156,7 @@ public class SequencedAssemblyCategory extends CreateRecipeCategory<SequencedAss
if (!singleOutput && mouseX >= minX && mouseX < maxX && mouseY >= minY && mouseY < maxY) {
float chance = recipe.getOutputChance();
tooltip.add(junk);
tooltip.add(Lang.translateDirect("recipe.processing.chance", chance < 0.01 ? ">99" : 100 - (int) (chance * 100))
.withStyle(ChatFormatting.GOLD));
tooltip.add(chanceComponent(1 - chance));
return tooltip;
}
@ -198,4 +196,10 @@ public class SequencedAssemblyCategory extends CreateRecipeCategory<SequencedAss
return tooltip;
}
protected MutableComponent chanceComponent(float chance) {
String number = chance < 0.01 ? "<1" : chance > 0.99 ? ">99" : String.valueOf(Math.round(chance * 100));
return Lang.translateDirect("recipe.processing.chance", number)
.withStyle(ChatFormatting.GOLD);
}
}

View file

@ -41,9 +41,9 @@ public class SequencedAssemblyRecipeGen extends CreateRecipeProvider {
.addOutput(AllItems.GOLDEN_SHEET.get(), 8)
.addOutput(AllItems.ANDESITE_ALLOY.get(), 8)
.addOutput(AllBlocks.COGWHEEL.get(), 5)
.addOutput(Items.GOLD_NUGGET, 3)
.addOutput(AllBlocks.SHAFT.get(), 2)
.addOutput(AllItems.CRUSHED_GOLD.get(), 2)
.addOutput(Items.GOLD_NUGGET, 2)
.addOutput(Items.IRON_INGOT, 1)
.addOutput(Items.CLOCK, 1)
.loops(5)