Skip to content

Commit

Permalink
Added patchouli integration back
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Aug 18, 2024
1 parent 0c52531 commit 581dc8d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
files-secondary: build/libs/*-@(dev|sources).jar
version-type: beta
version: ${{ github.ref_name }}
loaders: forge
loaders: neoforge
game-versions: |
1.21
1.21.1
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ dependencies {
implementation project.dependencies.create('com.hrznstudio:titanium:1.21-4.0.12')
implementation "curse.maven:jade-324717:5444008"
implementation "curse.maven:crafttweaker-239197:5606075"
compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}"
runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}"
}

// This block of code expands all declared replace properties in the specified resource targets.
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ mod_group_id=com.buuz135
mod_authors=Buuz135
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Sushi!
jei_version=19.8.2.99

jei_version=19.8.2.99
patchouli_version=1.21-87-NEOFORGE-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
import com.hrznstudio.titanium.event.handler.EventManager;
import com.hrznstudio.titanium.plugin.FeaturePluginInstance;
import com.hrznstudio.titanium.plugin.PluginPhase;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import vazkii.patchouli.api.PatchouliAPI;
import vazkii.patchouli.common.item.PatchouliDataComponents;

@FeaturePlugin(value = "patchouli", type = FeaturePlugin.FeaturePluginType.MOD)
public class PatchouliPlugin implements FeaturePluginInstance {
Expand All @@ -16,10 +21,9 @@ public void execute(PluginPhase phase) {
if (phase == PluginPhase.CONSTRUCTION) {
EventManager.mod(BuildCreativeModeTabContentsEvent.class).process(buildCreativeModeTabContentsEvent -> {
if (SushiGoCrafting.TAB.getResourceLocation().equals(buildCreativeModeTabContentsEvent.getTabKey().location())) {
//TODO 1.21
//var item = new ItemStack(ForgeRegistries.ITEMS.getValue(ResourceLocation.fromNamespaceAndPath("patchouli", "guide_book")));
//item.getOrCreateTag().putString("patchouli:book", "sushigocrafting:sushigocrafting");
//buildCreativeModeTabContentsEvent.accept(item);
var item = new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("patchouli", "guide_book")));
item.set(PatchouliDataComponents.BOOK, ResourceLocation.fromNamespaceAndPath("sushigocrafting", "sushigocrafting"));
buildCreativeModeTabContentsEvent.accept(item);
}
}).subscribe();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "text.sushigocrafting.book.title",
"landing_text": "Welcome to SushiGoCrafting, a deep food mod using sushi! $(br2)You can become my patreon $(l:https://www.patreon.com/buuz135)here$().",
"book_texture": "patchouli:textures/gui/book_cyan.png",
"book_texture": "patchouli:textures/gui/book_green.png",
"version": "GRADLE:VERSION",
"text_color": "5A5766",
"header_color": "48435C",
Expand Down
10 changes: 8 additions & 2 deletions src/main/resources/data/sushigocrafting/recipe/book.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "patchouli"
}
],
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
Expand All @@ -12,8 +18,8 @@
}
],
"result": {
"item": "patchouli:guide_book",
"nbt": {
"id": "patchouli:guide_book",
"components": {
"patchouli:book": "sushigocrafting:sushigocrafting"
}
}
Expand Down

0 comments on commit 581dc8d

Please sign in to comment.