feat: replace event-based drops with Global Loot Modifier (fix Create drill crash)

- Add CustomOreLootModifier (Global Loot Modifier) handling all ore drops,
  ensuring compatibility with machines (Create drill/contraptions) and avoiding
  duplication. Handles silk touch (vanilla block / shard diamond block) and
  fortune via config-driven min/max drops.
- Register GLM serializer via DeferredRegister in CustomOreGenMod (user code block)
- Rewrite OreBreakEventHandler: remove direct drops mutation that caused
  UnsupportedOperationException on immutable list when broken by Create drill.
  Drops are now fully GLM-driven; handler only triggers XP/procedure logic.
- Migrate loot tables from loot_table/ (singular, 1.20) to loot_tables/
  (plural, NeoForge 1.21 format) for all 16 ore blocks.
- Declare GLM in data/neoforge/loot_modifiers/global_loot_modifiers.json
- Add Create crushing + milling recipes for diamond -> diamond shards
- Config tweaks: tool durabilities (pickaxe/axe/shovel 450, paxel 800),
  Pure Golden Ore maxHeight 256 -> 320
- Refresh shard diamond armor/item textures
- Simplify unit tests for new drop system
This commit is contained in:
feldenr
2026-06-14 11:08:59 +02:00
parent 3ef6f03244
commit 74480d9d2c
58 changed files with 678 additions and 1238 deletions
+9
View File
@@ -79,6 +79,11 @@ configurations {
dependencies {
// KubeJS dependency - version will need to be updated for 1.21
// localRuntime "dev.latvian.mods:kubejs-neoforge:${kubejs_version}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.mockito:mockito-core:4.5.1'
testImplementation 'org.mockito:mockito-junit-jupiter:4.5.1'
}
tasks.withType(ProcessResources).configureEach {
@@ -105,6 +110,10 @@ tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
idea {
module {
downloadSources = true