-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
252 additions
and
18 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d
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
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0
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
19 changes: 19 additions & 0 deletions
19
src/generated/resources/data/railcraft/advancements/grant_book_on_first_join.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,19 @@ | ||
{ | ||
"criteria": { | ||
"tick": { | ||
"conditions": {}, | ||
"trigger": "minecraft:tick" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"tick" | ||
] | ||
], | ||
"rewards": { | ||
"loot": [ | ||
"railcraft:advancements/patchouli_book" | ||
] | ||
}, | ||
"sends_telemetry_event": true | ||
} |
22 changes: 22 additions & 0 deletions
22
src/generated/resources/data/railcraft/loot_tables/advancements/patchouli_book.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,22 @@ | ||
{ | ||
"type": "minecraft:advancement_reward", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_nbt", | ||
"tag": "{\"patchouli:book\":\"railcraft:guide_book\"}" | ||
} | ||
], | ||
"name": "patchouli:guide_book" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "railcraft:advancements/patchouli_book" | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/mods/railcraft/data/advancements/RailcraftAdvancements.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,24 @@ | ||
package mods.railcraft.data.advancements; | ||
|
||
import java.util.function.Consumer; | ||
import mods.railcraft.Railcraft; | ||
import mods.railcraft.data.loot.packs.RailcraftAdvancementRewardLoot; | ||
import net.minecraft.advancements.Advancement; | ||
import net.minecraft.advancements.AdvancementRewards; | ||
import net.minecraft.advancements.critereon.PlayerTrigger; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.common.data.ExistingFileHelper; | ||
import net.minecraftforge.common.data.ForgeAdvancementProvider; | ||
|
||
class RailcraftAdvancements implements ForgeAdvancementProvider.AdvancementGenerator { | ||
|
||
@Override | ||
public void generate(HolderLookup.Provider registries, Consumer<Advancement> consumer, | ||
ExistingFileHelper fileHelper) { | ||
Advancement.Builder.advancement() | ||
.addCriterion("tick", PlayerTrigger.TriggerInstance.tick()) | ||
.rewards(AdvancementRewards.Builder.loot(RailcraftAdvancementRewardLoot.PATCHOULI_BOOK)) | ||
.save(consumer, new ResourceLocation(Railcraft.ID, "grant_book_on_first_join"), fileHelper); | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/mods/railcraft/data/loot/packs/RailcraftAdvancementRewardLoot.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,33 @@ | ||
package mods.railcraft.data.loot.packs; | ||
|
||
import java.util.function.BiConsumer; | ||
import mods.railcraft.Railcraft; | ||
import net.minecraft.data.loot.LootTableSubProvider; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.level.storage.loot.LootPool; | ||
import net.minecraft.world.level.storage.loot.LootTable; | ||
import net.minecraft.world.level.storage.loot.entries.LootItem; | ||
import net.minecraft.world.level.storage.loot.functions.SetNbtFunction; | ||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; | ||
import vazkii.patchouli.api.PatchouliAPI; | ||
|
||
public class RailcraftAdvancementRewardLoot implements LootTableSubProvider { | ||
|
||
public static final ResourceLocation PATCHOULI_BOOK = | ||
new ResourceLocation(Railcraft.ID, "advancements/patchouli_book"); | ||
|
||
@Override | ||
public void generate(BiConsumer<ResourceLocation, LootTable.Builder> consumer) { | ||
var bookId = new ResourceLocation(Railcraft.ID, "guide_book"); | ||
var book = PatchouliAPI.get().getBookStack(bookId).getItem(); | ||
var tag = new CompoundTag(); | ||
tag.putString("patchouli:book", bookId.toString()); | ||
consumer.accept(PATCHOULI_BOOK, LootTable.lootTable() | ||
.withPool(LootPool.lootPool() | ||
.setRolls(ConstantValue.exactly(1)) | ||
.add(LootItem.lootTableItem(book).apply(SetNbtFunction.setTag(tag))) | ||
) | ||
); | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...in/resources/assets/railcraft/patchouli_books/guide_book/en_us/categories/multiblock.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "Test Category", | ||
"description": "This is a test category for testing!", | ||
"icon": "minecraft:writable_book" | ||
"name": "Multi-block structures", | ||
"description": "Everything you need to build multi-block structures", | ||
"icon": "railcraft:coke_oven_bricks" | ||
} |
17 changes: 17 additions & 0 deletions
17
...s/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/blast_furnace.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,17 @@ | ||
{ | ||
"name": "Blast Furnace", | ||
"icon": "railcraft:blast_furnace_bricks", | ||
"category": "railcraft:multiblock", | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "This is a test entry, but it should show up!" | ||
}, | ||
{ | ||
"type": "patchouli:multiblock", | ||
"name": "Blast Furnace", | ||
"multiblock_id": "railcraft:blast_furnace", | ||
"text": "AAA" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...urces/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/coke_oven.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,17 @@ | ||
{ | ||
"name": "Coke Oven", | ||
"icon": "railcraft:coke_oven_bricks", | ||
"category": "railcraft:multiblock", | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "This is a test entry, but it should show up!" | ||
}, | ||
{ | ||
"type": "patchouli:multiblock", | ||
"name": "Coke Oven", | ||
"multiblock_id": "railcraft:coke_oven", | ||
"text": "AAA" | ||
} | ||
] | ||
} |
4 changes: 2 additions & 2 deletions
4
...sources/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/crusher.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
17 changes: 17 additions & 0 deletions
17
...rces/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/steam_oven.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,17 @@ | ||
{ | ||
"name": "Steam Oven", | ||
"icon": "railcraft:steam_oven", | ||
"category": "railcraft:multiblock", | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "This is a test entry, but it should show up!" | ||
}, | ||
{ | ||
"type": "patchouli:multiblock", | ||
"name": "Steam Oven", | ||
"multiblock_id": "railcraft:steam_oven", | ||
"text": "AAA" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...s/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/steam_turbine.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,17 @@ | ||
{ | ||
"name": "Steam Turbine", | ||
"icon": "railcraft:steam_turbine", | ||
"category": "railcraft:multiblock", | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "This is a test entry, but it should show up!" | ||
}, | ||
{ | ||
"type": "patchouli:multiblock", | ||
"name": "Steam Turbine", | ||
"multiblock_id": "railcraft:steam_turbine", | ||
"text": "AAA" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...rces/assets/railcraft/patchouli_books/guide_book/en_us/entries/multiblock/water_tank.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,17 @@ | ||
{ | ||
"name": "Water Tank", | ||
"icon": "railcraft:water_tank_siding", | ||
"category": "railcraft:multiblock", | ||
"pages": [ | ||
{ | ||
"type": "patchouli:text", | ||
"text": "This is a test entry, but it should show up!" | ||
}, | ||
{ | ||
"type": "patchouli:multiblock", | ||
"name": "Water Tank", | ||
"multiblock_id": "railcraft:water_tank", | ||
"text": "AAA" | ||
} | ||
] | ||
} |