-
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.
- Loading branch information
Showing
12 changed files
with
215 additions
and
16 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
55 changes: 55 additions & 0 deletions
55
src/main/java/com/megatrex4/ukrainian_dlight/compat/patchouli/BrewingKegProcessor.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,55 @@ | ||
package com.megatrex4.ukrainian_dlight.compat.patchouli; | ||
|
||
import com.megatrex4.ukrainian_dlight.UkrainianDelight; | ||
import com.megatrex4.ukrainian_dlight.recipe.BrewingRecipe; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.world.World; | ||
import vazkii.patchouli.api.IComponentProcessor; | ||
import vazkii.patchouli.api.IVariable; | ||
import vazkii.patchouli.api.IVariableProvider; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class BrewingKegProcessor implements IComponentProcessor { | ||
|
||
public static final Logger LOGGER = LoggerFactory.getLogger(UkrainianDelight.MOD_ID); | ||
private BrewingRecipe recipe; | ||
|
||
@Override | ||
public void setup(World world, IVariableProvider variables) { | ||
String recipeId = variables.get("recipe").asString(); | ||
LOGGER.info("Ukrainian Delight: Recipe ID " + recipeId); | ||
this.recipe = (BrewingRecipe) world.getRecipeManager().get(new Identifier(recipeId)) | ||
.orElseThrow(() -> new IllegalArgumentException("Recipe not found: " + recipeId)); | ||
} | ||
|
||
@Override | ||
public IVariable process(World world, String key) { | ||
switch (key) { | ||
case "waterAmount": | ||
return IVariable.wrap(recipe.getWaterAmount()); | ||
case "input0": | ||
case "input1": | ||
case "input2": | ||
case "input3": | ||
case "input4": | ||
case "input5": | ||
int index = Integer.parseInt(key.substring(5)) - 1; | ||
return IVariable.from(recipe.getIngredients().get(index).getMatchingStacks()[0]); | ||
case "container": | ||
return IVariable.from(recipe.getContainer()); | ||
case "output": | ||
return IVariable.from(recipe.getOutput(world.getRegistryManager())); | ||
case "water": | ||
// Assuming `waterAmount` represents the amount of water | ||
return IVariable.wrap(recipe.getWaterAmount()); | ||
case "brewingTime": | ||
return IVariable.wrap(recipe.getBrewingTime()); | ||
case "text": | ||
return IVariable.wrap("This is how you use the BrewingKeg to create various beverages. $(br) The input items and container are required for the process, and the result will be displayed as the output item."); | ||
default: | ||
return null; | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/ukrainian_delight/models/item/ukrainian_guide.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "ukrainian_delight:item/ukrainian_guide" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ts/ukrainian_delight/patchouli_books/ukrainian_guide/en_us/entries/brewing_keg_entry.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,24 @@ | ||
{ | ||
"type": "patchouli:entry", | ||
"name": "Brewing Keg", | ||
"icon": "minecraft:writable_book", | ||
"description": "Details on how to use the Brewing Keg.", | ||
"category": "ukrainian_delight:test_category", | ||
"pages": [ | ||
{ | ||
"type": "ukrainian_delight:brewing_keg", | ||
"recipe": "ukrainian_delight:brewing/brewpotion", | ||
"input0": "minecraft:sugar", | ||
"input1": "minecraft:wheat", | ||
"input2": "minecraft:wheat", | ||
"input3": "minecraft:wheat", | ||
"input4": "minecraft:wheat", | ||
"input5": "minecraft:wheat", | ||
"container": "minecraft:glass_bottle", | ||
"output": "ukrainian_delight:wine_bottle", | ||
"waterAmount": 500, | ||
"brewingTime": 200, | ||
"text": "This is how you use the BrewingKeg to create various beverages. $(br) The input items and container are required for the process, and the result will be displayed as the output item." | ||
} | ||
] | ||
} |
109 changes: 109 additions & 0 deletions
109
...assets/ukrainian_delight/patchouli_books/ukrainian_guide/en_us/templates/brewing_keg.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,109 @@ | ||
{ | ||
"processor": "com.megatrex4.ukrainian_dlight.compat.patchouli.BrewingKegProcessor", | ||
"include": [ | ||
{ | ||
"template": "ukrainian_delight:brewing_keg", | ||
"as": "brew", | ||
"using": { | ||
"input0": "#input0", | ||
"input1": "#input1", | ||
"input2": "#input2", | ||
"input3": "#input3", | ||
"input4": "#input4", | ||
"input5": "#input5", | ||
"container": "#container", | ||
"output": "#output", | ||
"water": "#water", | ||
"waterAmount": "#waterAmount", | ||
"brewingTime": "#brewingTime", | ||
"text": "#text" | ||
}, | ||
"x": 20, | ||
"y": 20 | ||
} | ||
], | ||
"components": [ | ||
{ | ||
"type": "patchouli:image", | ||
"image": "ukrainian_delight:textures/gui/patchouli/brewing_keg.png", | ||
"width": 256, | ||
"height": 64, | ||
"texture_height": 16, | ||
"scale": 0.65, | ||
"u": 20 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input0", | ||
"x": 20, | ||
"y": 40 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input1", | ||
"x": 60, | ||
"y": 40 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input2", | ||
"x": 100, | ||
"y": 40 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input3", | ||
"x": 20, | ||
"y": 80 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input4", | ||
"x": 60, | ||
"y": 80 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#input5", | ||
"x": 100, | ||
"y": 80 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#container", | ||
"x": 140, | ||
"y": 60 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#output", | ||
"x": 180, | ||
"y": 60 | ||
}, | ||
{ | ||
"type": "patchouli:item", | ||
"item": "#water", | ||
"x": 220, | ||
"y": 60 | ||
}, | ||
{ | ||
"type": "patchouli:tooltip", | ||
"tooltip": [ | ||
"Water Amount: #waterAmount mB" | ||
], | ||
"width": 100, | ||
"height": 20, | ||
"x": 140, | ||
"y": 20 | ||
}, | ||
{ | ||
"type": "patchouli:separator", | ||
"y": 100 | ||
}, | ||
{ | ||
"type": "patchouli:text", | ||
"text": "#text", | ||
"y": 110 | ||
} | ||
] | ||
} |
Binary file added
BIN
+6.9 KB
src/main/resources/assets/ukrainian_delight/textures/gui/patchouli/brewing_keg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
9 changes: 6 additions & 3 deletions
9
src/main/resources/data/ukrainian_delight/patchouli_books/ukrainian_guide/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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
{ | ||
"name": "Ukrainian Delight Guide", | ||
"landing_text": "Welcome to the Ukrainian Delight Mod Guide!", | ||
"name": "patchouli.ukrainian_delight.guide_name", | ||
"landing_text": "patchouli.ukrainian_delight.landing_text", | ||
"version": 1, | ||
"creative_tab": "ukrainian_delight:ingredients_ukrainian_delight", | ||
"use_resource_pack": true | ||
"use_resource_pack": true, | ||
"model": "ukrainian_delight:ukrainian_guide", | ||
"show_progress": false, | ||
"index_icon": "ukrainian_delight:ukrainian_guide" | ||
} |
1 change: 0 additions & 1 deletion
1
src/main/resources/data/ukrainian_delight/recipes/brewing/brewpoop.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,4 @@ | ||
{ | ||
"type": "ukrainian_delight:brewing", | ||
"container": { | ||
"item": "minecraft:glass_bottle" | ||
}, | ||
|
1 change: 0 additions & 1 deletion
1
src/main/resources/data/ukrainian_delight/recipes/brewing/brewpotion.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,4 @@ | ||
{ | ||
"type": "ukrainian_delight:brewing", | ||
"container": { | ||
"item": "ukrainian_delight:wine_bottle" | ||
}, | ||
|