Add Ex Nihilo Creatio integration - #15
Conversation
| builder.outputs(siftable.getDrop().getItemStack()); | ||
| } else { | ||
| builder.chancedOutput(siftable.getDrop().getItemStack(), | ||
| (int) (siftable.getChance() * 10000), 500); |
There was a problem hiding this comment.
[要対応] chance が 0 に丸められるとロード時クラッシュの可能性があります。
register() は Ex Nihilo の SieveRegistry 全体(config で追加した分だけでなく、Ex Nihilo 本体や他 MOD が登録した siftable すべて)をミラーします。そのうち確率が 0.01%(0.0001)未満 のドロップがあると、(int)(siftable.getChance() * 10000) が 0 に丸められます。
GTCEu の RecipeBuilder.chancedOutput は chance <= 0 を渡すと recipeStatus = INVALID をセットし、これが RecipeMap.setFoundInvalidRecipe(true) まで伝播して、通常環境(ignoreErrorOrInvalidRecipes = false)では最終的に LoaderException でロードが中断されます(=ハードクラッシュ)。破棄されるのは該当ドロップだけでなく レシピ1件まるごと です。
同梱 config のデフォルト値は最小 0.0004(→4)なので config 経由では発火しませんが、ミラー対象の確率はランタイムのレジストリ内容に依存するため潜在的です。0.01% 未満の確率を持つ MOD/パックと組み合わせると発火します。
| (int) (siftable.getChance() * 10000), 500); | |
| builder.chancedOutput(siftable.getDrop().getItemStack(), | |
| Math.max(1, (int) (siftable.getChance() * 10000)), 500); |
(丸めて 0 になるドロップは登録せず continue でスキップする方針でも構いません。)
There was a problem hiding this comment.
if (siftable.getChance() <= 0) continue;を追加しました
| 'R', new UnificationEntry(OrePrefix.stick, Materials.Wood)); | ||
|
|
||
| ModHandler.removeRecipeByOutput(Mods.ExNihilo.getItem("crook_iron")); | ||
| ModHandler.addShapedRecipe("crook_diamond", ExNihiloToolsItems.CROOK.get(Materials.Iron), |
There was a problem hiding this comment.
[要対応] replaceCrook=true のときレシピ登録名が衝突します(この行は typo で "crook_iron" が正しい)。
registerRecipes() は ループ(L19-24)→ replaceCrooks()(L26-28)の順 で実行されます。replaceCrook=true だと crooks() のガード !replaceCrook && ...(L32-33)が早期 return しないため、ループが先に crook_iron と crook_diamond(どちらも出力は CROOK.get(material))を登録します。
GTCEu の ModHandler.addShapedRecipe は 同名 regName を先勝ちで扱い、後続の登録は WARN ログ(スタックトレース付き)を出して破棄 します(クラッシュも上書きもしません)。そのため replaceCrooks() 内の
- この行(Iron を、typo で
"crook_diamond"名で登録) - L71-74(Diamond を
"crook_diamond"名で登録)
は 両方ともループ登録済みの crook_diamond に負けて破棄 されます。
一方 Gold / Wood は PropertyKey.TOOL を持たずループに入らないため、crook_gold(L53-56)と crook_wood(L60-64)だけは意図通り登録されます。
→ 実害: replaceCrook=true のとき Iron/Diamond の置換登録が すべて無駄撃ち+ログスパム(結果はループ版と同一なので見た目は動いてしまう)。この行の typo はその症状です。
修正の方向性(いずれか):
crooks()のガードを見直し、replaceCrook=trueのときは Iron/Gold/Diamond をループ側でスキップして、登録名の所有権をreplaceCrooks()に渡す。replaceCrooks()を廃止し、置換ロジックをループ本体に一本化する。- 最低限この行を
"crook_iron"に直す(ただし上記の実行順序を直さない限り、依然としてループ版に負けて破棄される点に注意)。
| registry.register(drops.getKey().getName(), new ItemInfo(stack.getItem(), stack.getMetadata()), | ||
| drop.getChance(), drop.getMeshLevel()); | ||
| } else { | ||
| registry.register( |
There was a problem hiding this comment.
[軽微] explicitInput 系がデッドコードで、ロジックが二重管理になっています。
enum に explicitInput フィールドと hasExplicitInput()(L200-202)/ getExplicitInput()(L204-206)を用意しているのに、この L152-159 の分岐はそれらを使わず、SieveDropType.END / NETHERRACK を直接比較して三項演算子で ModBlocks.endstoneCrushed / netherrackCrushed を参照しています。
そのため enum のフィールド/メソッドは未使用のデッドコードになり、「どの入力ブロックを使うか」のロジックが enum 定義側と分岐側の2箇所に分散しています。
提案: この分岐を type.hasExplicitInput() / type.getExplicitInput() を使う形に統一するか、使わないなら enum 側の未使用フィールド・メソッドを削除する。
There was a problem hiding this comment.
enum側のメソッドを使った場合、動かなくなったためenum側を破棄しました
| public static final String ENDER_MACHINES = "enderiomachines"; | ||
| public static final String ENDER_CONDUITS = "enderioconduits"; | ||
| public static final String ENDER_AE2_CONDUITS = "enderioconduitsappliedenergistics"; | ||
| public static final String EX_NIHOLO = "exnihilocreatio"; |
There was a problem hiding this comment.
[nit] 定数名のスペルミス: EX_NIHOLO → EX_NIHILO。
値は "exnihilocreatio" で正しいので動作には影響ありませんが、NIHILO の綴りが NIHOLO になっています。直す場合は参照側(L47 ExNihilo(Names.EX_NIHOLO))も併せて更新が必要です。
|
Ex Nihilo Creatio 連携、丁寧に作られていて良いと思います 👍(モジュール分割・LICENSE 表記・README/CHANGELOG・en/ja 両対応・config 経由の Sieve ドロップ設定・診断用 VeinProbabilityReporter など)。 GTCEu 側のソース( 要対応
軽微
確認済みで問題なし: pebble→cobble のマッピングは 詳細は各行のコメントに記載しました。 |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
📝 WalkthroughWalkthroughAdded Ex Nihilo: Creatio integration with configurable sieve drops, GT crooks and hammers, pebble items, steam and electric sieves, recipe conversion, vein probability reporting, documentation, licenses, and client assets. ChangesIntegration contracts and configuration
Module registration and tools
Sieve machines and recipes
Vein distribution and reporting
Client assets and localization
Estimated code review effort: 5 (Critical) | ~120 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Nitpick comments (1)
src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.java (1)
110-115: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRename
formatPercentto match its output.The method returns a fraction in the range 0 to 1 with four decimals. It does not multiply by 100 and does not append
%. Rename it toformatProbability, or multiply by 100 and append%. Also importjava.util.Localeinstead of using the fully qualified name, to match the import style in this file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.java` around lines 110 - 115, The formatPercent method returns a bounded probability fraction rather than a percentage; rename it to formatProbability and update all call sites. Replace the fully qualified Locale.ROOT reference with an imported java.util.Locale, preserving the existing four-decimal formatting and clamping behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 2: Correct the changelog heading from “Ex Nihiro: Creatio Integration” to
use the mod name “Ex Nihilo: Creatio,” preserving the existing heading format.
In `@DEVELOPER.md`:
- Line 266: Update the component name in the referenced documentation entry from
“Conveyer” to “Conveyor,” leaving the other abbreviations and descriptions
unchanged.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloEventHandlers.java`:
- Around line 40-43: Update the stack construction in the event handler around
ExNihiloUtil.isContained to create the ItemStack from event.getState() so the
harvested block’s metadata is preserved. Keep the existing containment check and
subsequent drop handling unchanged.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/items/ItemGTMTPebbles.java`:
- Around line 43-44: Validate the ItemStack metadata before indexing
GTPebbles.VALUES or locations in ItemGTMTPebbles.getTranslationKey and the
mesh-definition logic. For metadata outside 0..3, use the established safe
fallback by returning the base translation key and fallback model instead of
accessing either array.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/ExNihiloSieveRecipe.java`:
- Around line 36-42: Update the siftable-drop handling in ExNihiloSieveRecipe so
getChance() is converted to the integer chance value once before output
selection; skip the drop when that converted value is zero, use it for the
guaranteed-output threshold and chancedOutput call, and retain the existing
behavior for valid nonzero chances.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/LayeredVeinMaterialDistribution.java`:
- Around line 133-137: Update the second weighted-entry loop in
LayeredVeinMaterialDistribution to handle nullable values from
weightedEntry.getLeft() before unboxing, using the same null-and-nonpositive
guard as the first loop. Preserve processing only for entries with valid
positive weights.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.java`:
- Around line 45-47: Update the average calculation in VeinProbabilityReporter
to use floating-point division for additionalVeinsInSection, computing the
expected count with add / 2.0 rather than integer division. Preserve the
existing min and finalChance logic so fractional averages are reflected in the
reported sieve chances.
In
`@src/main/resources/assets/gregtech/models/item/material_sets/opal/ore_chunk.json`:
- Around line 4-5: Replace the Ruby texture namespace with Opal in both texture
references for all four listed files:
src/main/resources/assets/gregtech/models/item/material_sets/opal/ore_chunk.json
lines 4-5, ore_ender_chunk.json lines 4-5, ore_nether_chunk.json lines 4-5, and
ore_sandy_chunk.json lines 4-5. Preserve each model’s base texture and use the
corresponding standard, Ender, Nether, or Sandy overlay.
In
`@src/main/resources/assets/gregtech/models/item/material_sets/sand/ore_chunk.json`:
- Around line 4-5: Update the texture namespace in all four sand chunk models:
src/main/resources/assets/gregtech/models/item/material_sets/sand/ore_chunk.json
lines 4-5 should reference sand/ore_chunk and sand/ore_chunk_overlay;
ore_ender_chunk.json lines 4-5 should reference sand/ore_chunk and
sand/ore_ender_chunk_overlay; ore_nether_chunk.json lines 4-5 should reference
sand/ore_chunk and sand/ore_nether_chunk_overlay; and ore_sandy_chunk.json lines
4-5 should reference sand/ore_chunk and sand/ore_sandy_chunk_overlay.
---
Nitpick comments:
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.java`:
- Around line 110-115: The formatPercent method returns a bounded probability
fraction rather than a percentage; rename it to formatProbability and update all
call sites. Replace the fully qualified Locale.ROOT reference with an imported
java.util.Locale, preserving the existing four-decimal formatting and clamping
behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e6b581c7-7452-4b94-bb45-845d7bb864e4
⛔ Files ignored due to path filters (82)
src/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_sift_bronze.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/gui/progress_bar/progress_bar_sift_steel.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/diamond/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/diamond/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/diamond/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/diamond/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/diamond/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/dull/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/dull/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/dull/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/dull/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/dull/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/emerald/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/emerald/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/emerald/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/emerald/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/emerald/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/fine/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/fine/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/fine/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/fine/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/fine/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/flint/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/flint/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/flint/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/flint/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/flint/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_horizontal/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_horizontal/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_horizontal/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_horizontal/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_horizontal/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_vertical/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_vertical/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_vertical/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_vertical/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/gem_vertical/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lapis/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lapis/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lapis/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lapis/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lapis/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lignite/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lignite/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lignite/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lignite/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/lignite/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/metallic/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/metallic/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/metallic/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/metallic/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/metallic/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/netherstar/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/netherstar/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/netherstar/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/netherstar/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/netherstar/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/quartz/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/quartz/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/quartz/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/quartz/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/quartz/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/rough/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/rough/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/rough/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/rough/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/rough/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/ruby/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/ruby/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/ruby/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/ruby/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/ruby/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/shiny/ore_chunk.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/shiny/ore_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/shiny/ore_ender_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/shiny/ore_nether_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gregtech/textures/items/material_sets/shiny/ore_sandy_chunk_overlay.pngis excluded by!**/*.pngsrc/main/resources/assets/gtmt/textures/items/ex_nihilo/basalt_pebble.pngis excluded by!**/*.pngsrc/main/resources/assets/gtmt/textures/items/ex_nihilo/black_granite_pebble.pngis excluded by!**/*.pngsrc/main/resources/assets/gtmt/textures/items/ex_nihilo/marble_pebble.pngis excluded by!**/*.pngsrc/main/resources/assets/gtmt/textures/items/ex_nihilo/red_granite_pebble.pngis excluded by!**/*.pngsrc/main/resources/assets/gtmt/textures/items/tools/crook.pngis excluded by!**/*.png
📒 Files selected for processing (105)
.github/workflows/publish.ymlCHANGELOG.mdDEVELOPER.mdLICENSE-ExNihiloCreatioLICENSE-GregificationREADME.mdbuildscript.propertiesdependencies.gradlesrc/main/java/com/github/gtexpert/gtmt/api/unification/material/info/GTMTMaterialIconType.javasrc/main/java/com/github/gtexpert/gtmt/api/unification/material/ore/GTMTOrePrefix.javasrc/main/java/com/github/gtexpert/gtmt/api/util/Mods.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloConfigHolder.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloEventHandlers.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloModule.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloRecipeMaps.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/ExNihiloUtil.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/items/ExNihiloItems.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/items/ItemGTMTPebbles.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/metatileentities/ExNihiloMetaTileEntities.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/metatileentities/MetaTileEntityElectricSieve.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/metatileentities/MetaTileEntitySteamSieve.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/metatileentities/SieveRecipeMap.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/ExNihiloMiscRecipe.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/ExNihiloSieveRecipe.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/ExNihiloToolRecipe.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/LayeredVeinMaterialDistribution.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/SieveDrops.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinGroupIndex.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinPathUtils.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.javasrc/main/java/com/github/gtexpert/gtmt/integration/exnihilo/tools/ExNihiloToolsItems.javasrc/main/java/com/github/gtexpert/gtmt/integration/jei/ExNihiloJEIPlugin.javasrc/main/java/com/github/gtexpert/gtmt/modules/Modules.javasrc/main/resources/assets/gregtech/models/item/material_sets/diamond/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/diamond/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/diamond/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/diamond/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/dull/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/dull/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/dull/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/dull/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/emerald/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/emerald/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/emerald/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/emerald/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/fine/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/fine/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/fine/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/fine/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/flint/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/flint/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/flint/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/flint/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_horizontal/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_horizontal/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_horizontal/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_horizontal/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_vertical/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_vertical/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_vertical/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/gem_vertical/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lapis/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lapis/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lapis/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lapis/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lignite/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lignite/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lignite/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/lignite/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/metallic/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/metallic/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/metallic/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/metallic/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/netherstar/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/netherstar/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/netherstar/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/netherstar/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/opal/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/opal/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/opal/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/opal/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/quartz/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/quartz/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/quartz/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/quartz/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/rough/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/rough/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/rough/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/rough/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/ruby/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/ruby/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/ruby/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/ruby/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/sand/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/sand/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/sand/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/sand/ore_sandy_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/shiny/ore_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/shiny/ore_ender_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/shiny/ore_nether_chunk.jsonsrc/main/resources/assets/gregtech/models/item/material_sets/shiny/ore_sandy_chunk.jsonsrc/main/resources/assets/gtmt/blockstates/gtpebble.jsonsrc/main/resources/assets/gtmt/lang/en_us.langsrc/main/resources/assets/gtmt/lang/ja_jp.langsrc/main/resources/assets/gtmt/models/item/tools/crook.json
| @@ -1,3 +1,17 @@ | |||
| # v1.5.0 | |||
| ## Ex Nihiro: Creatio Integration | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the integration name.
Line 2 spells the mod name as Ex Nihiro. Use Ex Nihilo: Creatio.
🧰 Tools
🪛 LanguageTool
[grammar] ~2-~2: Ensure spelling is correct
Context: # v1.5.0 ## Ex Nihiro: Creatio Integration - _Crooking Compati...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` at line 2, Correct the changelog heading from “Ex Nihiro:
Creatio Integration” to use the mod name “Ex Nihilo: Creatio,” preserving the
existing heading format.
Source: Linters/SAST tools
| ``` | ||
|
|
||
| - **C** = Circuit (all tier-scaled), **P** = Piston | ||
| - **V** = Conveyer, **H** = Hull, **W** = `cableGTSingle` (LV = Tin, MV = Copper, ...) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the component name.
Line 266 uses Conveyer. Use Conveyor.
🧰 Tools
🪛 LanguageTool
[grammar] ~266-~266: Ensure spelling is correct
Context: ... tier-scaled), P = Piston - V = Conveyer, H = Hull, W = cableGTSingle ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@DEVELOPER.md` at line 266, Update the component name in the referenced
documentation entry from “Conveyer” to “Conveyor,” leaving the other
abbreviations and descriptions unchanged.
Source: Linters/SAST tools
| public String getTranslationKey(@Nonnull ItemStack stack) { | ||
| return String.format("%s.%s", getTranslationKey(), GTPebbles.VALUES[stack.getItemDamage()].getName()); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Validate pebble metadata before indexing arrays.
getTranslationKey and the mesh definition index GTPebbles.VALUES and locations with unvalidated metadata. An ItemStack with metadata outside 0..3 crashes tooltip or model rendering.
Normalize invalid metadata to a valid fallback, or return the base translation key and model for invalid values.
Also applies to: 89-96
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/items/ItemGTMTPebbles.java`
around lines 43 - 44, Validate the ItemStack metadata before indexing
GTPebbles.VALUES or locations in ItemGTMTPebbles.getTranslationKey and the
mesh-definition logic. For metadata outside 0..3, use the established safe
fallback by returning the base translation key and fallback model instead of
accessing either array.
| if (siftable.getChance() <= 0) continue; | ||
| if (siftable.getMeshLevel() == recipe.getMesh().getMetadata()) { | ||
| if ((int) siftable.getChance() * 10000 >= 10000) { | ||
| builder.outputs(siftable.getDrop().getItemStack()); | ||
| } else { | ||
| builder.chancedOutput(siftable.getDrop().getItemStack(), | ||
| (int) (siftable.getChance() * 10000), 500); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Skip probabilities that underflow during conversion.
The source check allows positive values below 0.0001. Line 42 converts these values to 0 and passes that value to chancedOutput. This invalidates the generated recipe and can stop loading when another mod registers an ultra-low-probability sieve drop.
Convert the chance once, then skip the drop when the converted value is zero.
Proposed fix
- if (siftable.getChance() <= 0) continue;
+ int chance = (int) (siftable.getChance() * 10000);
+ if (chance <= 0) continue;
if (siftable.getMeshLevel() == recipe.getMesh().getMetadata()) {
- if ((int) siftable.getChance() * 10000 >= 10000) {
+ if (chance >= 10000) {
builder.outputs(siftable.getDrop().getItemStack());
} else {
builder.chancedOutput(siftable.getDrop().getItemStack(),
- (int) (siftable.getChance() * 10000), 500);
+ chance, 500);
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/ExNihiloSieveRecipe.java`
around lines 36 - 42, Update the siftable-drop handling in ExNihiloSieveRecipe
so getChance() is converted to the integer chance value once before output
selection; skip the drop when that converted value is zero, use it for the
guaranteed-output threshold and chancedOutput call, and retain the existing
behavior for valid nonzero chances.
| for (Pair<Integer, FillerEntry> weightedEntry : weightedEntries) { | ||
| int weight = weightedEntry.getLeft(); | ||
| if (weight <= 0) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Guard the null weight consistently in both loops.
Line 124 treats weightedEntry.getLeft() as nullable. Line 134 unboxes the same value into an int without a null check. If a null weight is possible, the second loop throws a NullPointerException. Make both loops use the same guard.
🐛 Proposed fix
for (Pair<Integer, FillerEntry> weightedEntry : weightedEntries) {
- int weight = weightedEntry.getLeft();
- if (weight <= 0) {
+ Integer weight = weightedEntry.getLeft();
+ if (weight == null || weight <= 0) {
continue;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for (Pair<Integer, FillerEntry> weightedEntry : weightedEntries) { | |
| int weight = weightedEntry.getLeft(); | |
| if (weight <= 0) { | |
| continue; | |
| } | |
| for (Pair<Integer, FillerEntry> weightedEntry : weightedEntries) { | |
| Integer weight = weightedEntry.getLeft(); | |
| if (weight == null || weight <= 0) { | |
| continue; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/LayeredVeinMaterialDistribution.java`
around lines 133 - 137, Update the second weighted-entry loop in
LayeredVeinMaterialDistribution to handle nullable values from
weightedEntry.getLeft() before unboxing, using the same null-and-nonpositive
guard as the first loop. Preserve processing only for entries with valid
positive weights.
| int min = ConfigHolder.worldgen.minVeinsInSection; | ||
| int add = ConfigHolder.worldgen.additionalVeinsInSection; | ||
| int ave = min + add / 2; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use floating-point arithmetic for the average vein count.
add / 2 is integer division. The expected additional count is add / 2.0. Two effects follow:
- If
minis 0 andaddis 1,avebecomes 0. Every suggested sieve chance is then reported as0.0000. - For any odd
add, the average is truncated downward, so all suggested chances are understated.
🐛 Proposed fix
int min = ConfigHolder.worldgen.minVeinsInSection;
int add = ConfigHolder.worldgen.additionalVeinsInSection;
- int ave = min + add / 2;
+ double ave = min + add / 2.0;finalChance at Line 97 is already a double, so no other change is needed.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| int min = ConfigHolder.worldgen.minVeinsInSection; | |
| int add = ConfigHolder.worldgen.additionalVeinsInSection; | |
| int ave = min + add / 2; | |
| int min = ConfigHolder.worldgen.minVeinsInSection; | |
| int add = ConfigHolder.worldgen.additionalVeinsInSection; | |
| double ave = min + add / 2.0; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/github/gtexpert/gtmt/integration/exnihilo/recipes/sieve/VeinProbabilityReporter.java`
around lines 45 - 47, Update the average calculation in VeinProbabilityReporter
to use floating-point division for additionalVeinsInSection, computing the
expected count with add / 2.0 rather than integer division. Preserve the
existing min and finalChance logic so fractional averages are reflected in the
reported sieve chances.
Summary by CodeRabbit