generated from FabricMC/fabric-example-mod
-
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.
close spell book when spell fails so players can see the message, uns…
…table charge spell (not sure if I want to keep it)
- Loading branch information
Showing
17 changed files
with
240 additions
and
18 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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/io/github/reoseah/magisterium/recipe/UnstableChargeRecipe.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,40 @@ | ||
package io.github.reoseah.magisterium.recipe; | ||
|
||
import io.github.reoseah.magisterium.item.SpellBookItem; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.recipe.RecipeSerializer; | ||
import net.minecraft.registry.RegistryWrapper; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.Unit; | ||
import net.minecraft.world.World; | ||
|
||
public class UnstableChargeRecipe extends SpellBookRecipe { | ||
public static final RecipeSerializer<UnstableChargeRecipe> SERIALIZER = new SpellBookRecipe.SimpleSerializer<>(UnstableChargeRecipe::new); | ||
|
||
protected UnstableChargeRecipe(Identifier utterance, int duration) { | ||
super(utterance, duration); | ||
} | ||
|
||
@Override | ||
public boolean matches(SpellBookRecipeInput input, World world) { | ||
// TODO: require ingredients, like a Nether Wart and a Bottle o' Enchanting | ||
return true; | ||
} | ||
|
||
@Override | ||
public ItemStack craft(SpellBookRecipeInput input, RegistryWrapper.WrapperLookup lookup) { | ||
input.getContext().setStackComponent(SpellBookItem.UNSTABLE_CHARGE, Unit.INSTANCE); | ||
|
||
return ItemStack.EMPTY; | ||
} | ||
|
||
@Override | ||
public ItemStack getResult(RegistryWrapper.WrapperLookup registriesLookup) { | ||
return ItemStack.EMPTY; | ||
} | ||
|
||
@Override | ||
public RecipeSerializer<?> getSerializer() { | ||
return SERIALIZER; | ||
} | ||
} |
Oops, something went wrong.