forked from DaFuqs/Spectrum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DaFuqs#511 from f-raZ0R/loot-modifier
Fix Amaranth-FD Compat but actually
- Loading branch information
Showing
5 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/de/dafuqs/spectrum/compat/farmersdelight/FDCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.dafuqs.spectrum.compat.farmersdelight; | ||
|
||
import de.dafuqs.spectrum.*; | ||
import de.dafuqs.spectrum.compat.*; | ||
import net.fabricmc.api.*; | ||
import net.fabricmc.fabric.api.loot.v2.*; | ||
import net.minecraft.util.*; | ||
|
||
public class FDCompat extends SpectrumIntegrationPacks.ModIntegrationPack { | ||
|
||
private static final Identifier AMARANTH_LOOT_TABLE_ID = SpectrumCommon.locate("blocks/amaranth"); | ||
|
||
public void register() { | ||
LootTableEvents.REPLACE.register((resourceManager, lootManager, id, original, source) -> { | ||
if (AMARANTH_LOOT_TABLE_ID.equals(id)) { | ||
return lootManager.getLootTable(SpectrumCommon.locate("mod_integration/farmers_delight/amaranth")); | ||
} | ||
return original; | ||
}); | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Override | ||
public void registerClient() { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/main/resources/data/spectrum/loot_tables/mod_integration/farmers_delight/amaranth.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"bonus_rolls": 0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:alternatives", | ||
"children": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "spectrum:amaranth_grains", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_count", | ||
"count": { | ||
"min": 2, | ||
"max": 4 | ||
} | ||
}, | ||
{ | ||
"function": "minecraft:apply_bonus", | ||
"enchantment": "minecraft:fortune", | ||
"formula": "minecraft:binomial_with_bonus_count", | ||
"parameters": { | ||
"extra": 1, | ||
"probability": 0.5714286 | ||
} | ||
} | ||
], | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:match_tool", | ||
"predicate": { | ||
"tag": "farmersdelight:tools/knives" | ||
} | ||
}, | ||
{ | ||
"condition": "minecraft:block_state_property", | ||
"block": "spectrum:amaranth", | ||
"properties": { | ||
"age": "7" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "minecraft:item", | ||
"name": "spectrum:amaranth_bushel", | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:block_state_property", | ||
"block": "spectrum:amaranth", | ||
"properties": { | ||
"age": "7" | ||
} | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_count", | ||
"count": { | ||
"min": 1, | ||
"max": 2 | ||
} | ||
}, | ||
{ | ||
"function": "minecraft:apply_bonus", | ||
"enchantment": "minecraft:fortune", | ||
"formula": "minecraft:binomial_with_bonus_count", | ||
"parameters": { | ||
"extra": 1, | ||
"probability": 0.5714286 | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "minecraft:item", | ||
"name": "spectrum:amaranth_grains", | ||
"count": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"rolls": 1, | ||
"bonus_rolls": 0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "farmersdelight:straw", | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:match_tool", | ||
"predicate": { | ||
"tag": "farmersdelight:tools/knives" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"function": "minecraft:explosion_decay" | ||
} | ||
], | ||
"fabric:load_conditions": [ | ||
{ | ||
"condition": "fabric:all_mods_loaded", | ||
"values": [ | ||
"farmersdelight" | ||
] | ||
} | ||
] | ||
} |