-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
b33a3a0
commit 708743f
Showing
8 changed files
with
100 additions
and
2 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
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
21 changes: 21 additions & 0 deletions
21
src/main/java/net/zepalesque/redux/event/listener/RecipeListener.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,21 @@ | ||
package net.zepalesque.redux.event.listener; | ||
|
||
import com.aetherteam.aether.item.AetherItems; | ||
import net.minecraft.world.inventory.ClickAction; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.Mod.EventBusSubscriber; | ||
import net.neoforged.neoforge.event.ItemStackedOnOtherEvent; | ||
import net.zepalesque.redux.Redux; | ||
import net.zepalesque.redux.recipe.ReduxRecipes; | ||
import net.zepalesque.zenith.recipe.StackingRecipeHelper; | ||
|
||
@EventBusSubscriber(modid = Redux.MODID) | ||
public class RecipeListener { | ||
|
||
@SubscribeEvent | ||
public static void onStackItem(ItemStackedOnOtherEvent event) { | ||
if (event.getClickAction() == ClickAction.SECONDARY) { | ||
StackingRecipeHelper.stack(event, stack -> stack.is(AetherItems.AMBROSIUM_SHARD), ReduxRecipes.INFUSION.get()); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/net/zepalesque/redux/recipe/ReduxRecipes.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,27 @@ | ||
package net.zepalesque.redux.recipe; | ||
|
||
import com.aetherteam.aether.Aether; | ||
import com.aetherteam.aether.recipe.recipes.block.AmbrosiumRecipe; | ||
import com.aetherteam.nitrogen.recipe.serializer.BlockStateRecipeSerializer; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.crafting.RecipeSerializer; | ||
import net.minecraft.world.item.crafting.RecipeType; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
import net.zepalesque.redux.Redux; | ||
import net.zepalesque.redux.recipe.recipes.InfusionRecipe; | ||
import net.zepalesque.zenith.recipe.serializer.StackingRecipeSerializer; | ||
|
||
public class ReduxRecipes { | ||
public static final DeferredRegister<RecipeType<?>> TYPES = DeferredRegister.create(BuiltInRegistries.RECIPE_TYPE, Redux.MODID); | ||
public static final DeferredHolder<RecipeType<?>, RecipeType<InfusionRecipe>> INFUSION = TYPES.register("infusion", () -> RecipeType.simple(new ResourceLocation(Redux.MODID, "infusion"))); | ||
|
||
|
||
|
||
public static class Serializers { | ||
public static final DeferredRegister<RecipeSerializer<?>> SERIALIZERS = DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, Redux.MODID); | ||
public static final DeferredHolder<RecipeSerializer<?>, StackingRecipeSerializer<InfusionRecipe>> INFUSION = SERIALIZERS.register("infusion", InfusionRecipe.Serializer::new); | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/zepalesque/redux/recipe/recipes/InfusionRecipe.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,30 @@ | ||
package net.zepalesque.redux.recipe.recipes; | ||
|
||
import net.minecraft.core.Holder; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.sounds.SoundEvent; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.minecraft.world.item.crafting.RecipeSerializer; | ||
import net.zepalesque.redux.recipe.ReduxRecipes; | ||
import net.zepalesque.zenith.recipe.recipes.AbstractStackingRecipe; | ||
import net.zepalesque.zenith.recipe.serializer.StackingRecipeSerializer; | ||
|
||
import java.util.Optional; | ||
|
||
public class InfusionRecipe extends AbstractStackingRecipe { | ||
public InfusionRecipe(Ingredient ingredient, ItemStack result, Optional<CompoundTag> additional, Optional<Holder<SoundEvent>> sound) { | ||
super(ReduxRecipes.INFUSION.get(), ingredient, result, additional, sound); | ||
} | ||
|
||
@Override | ||
public RecipeSerializer<?> getSerializer() { | ||
return ReduxRecipes.Serializers.INFUSION.get(); | ||
} | ||
|
||
public static class Serializer extends StackingRecipeSerializer<InfusionRecipe> { | ||
public Serializer() { | ||
super(InfusionRecipe::new); | ||
} | ||
} | ||
} |