-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Apple Fermenting + Copper Tea Kettle
- Loading branch information
1 parent
aff70aa
commit ce9254e
Showing
10 changed files
with
96 additions
and
27 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
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
49 changes: 49 additions & 0 deletions
49
common/src/main/java/com/pandaismyname1/emiletsdocompat/vinery/AppleFermentationRecipe.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,49 @@ | ||
package com.pandaismyname1.emiletsdocompat.vinery; | ||
|
||
import com.pandaismyname1.emiletsdocompat.utils.DisplayUtils; | ||
import dev.architectury.utils.EnvExecutor; | ||
import dev.architectury.utils.GameInstance; | ||
import dev.emi.emi.api.recipe.BasicEmiRecipe; | ||
import dev.emi.emi.api.recipe.EmiRecipeCategory; | ||
import dev.emi.emi.api.stack.EmiIngredient; | ||
import dev.emi.emi.api.stack.EmiStack; | ||
import dev.emi.emi.api.widget.WidgetHolder; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class AppleFermentationRecipe extends BasicEmiRecipe { | ||
protected static final Supplier<RegistryAccess> REGISTRY_ACCESS = | ||
EnvExecutor.getEnvSpecific(() -> () -> () -> GameInstance.getClient().player.level().registryAccess(), | ||
() -> () -> () -> GameInstance.getServer().registryAccess()); | ||
|
||
public AppleFermentationRecipe(EmiRecipeCategory category, net.satisfy.vinery.core.recipe.ApplePressFermentingRecipe recipe) { | ||
super(category, recipe.getId(), 70, 18); | ||
var ingredients = recipe.getIngredients(); | ||
var requiresBottle = recipe.requiresBottle(); | ||
for (var ingredient : ingredients) { | ||
this.inputs.add(EmiIngredient.of(ingredient)); | ||
} | ||
if (requiresBottle) { | ||
var ingredient = Ingredient.of(net.satisfy.vinery.core.registry.ObjectRegistry.WINE_BOTTLE.get()); | ||
this.inputs.add(EmiIngredient.of(ingredient)); | ||
} | ||
this.outputs.add(EmiStack.of(recipe.getResultItem(REGISTRY_ACCESS.get()))); | ||
} | ||
|
||
@Override | ||
public void addWidgets(WidgetHolder widgets) { | ||
DisplayUtils.CreateWidget(this, widgets, this.inputs, this.outputs); | ||
} | ||
|
||
@Override | ||
public int getDisplayHeight() { | ||
return 40; | ||
} | ||
|
||
@Override | ||
public int getDisplayWidth() { | ||
return 140; | ||
} | ||
} |
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
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
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