-
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.
Add soul recipe framework & handling
- Loading branch information
Showing
10 changed files
with
205 additions
and
48 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
33 changes: 33 additions & 0 deletions
33
src/main/java/mod/emt/harkenscythe/init/HSSoulAltarRecipes.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,33 @@ | ||
package mod.emt.harkenscythe.init; | ||
|
||
import java.util.Map; | ||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; | ||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; | ||
import net.minecraft.item.Item; | ||
|
||
public class HSSoulAltarRecipes | ||
{ | ||
private static final Map<Item, Item> SOUL_INPUT_OUTPUT_MAP = new Object2ObjectOpenHashMap<>(); | ||
private static final Map<Item, Integer> SOUL_INPUT_SOULS_MAP = new Object2IntOpenHashMap<>(); | ||
|
||
public static void addRecipe(Item input, Item output, int requiredSouls) | ||
{ | ||
SOUL_INPUT_OUTPUT_MAP.put(input, output); | ||
SOUL_INPUT_SOULS_MAP.put(input, Math.max(requiredSouls, 10)); | ||
} | ||
|
||
public static boolean isValidInput(Item input) | ||
{ | ||
return SOUL_INPUT_OUTPUT_MAP.containsKey(input) && SOUL_INPUT_SOULS_MAP.containsKey(input); | ||
} | ||
|
||
public static Item getOutput(Item input) | ||
{ | ||
return SOUL_INPUT_OUTPUT_MAP.get(input); | ||
} | ||
|
||
public static int getRequiredSouls(Item input) | ||
{ | ||
return SOUL_INPUT_SOULS_MAP.get(input); | ||
} | ||
} |
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
Oops, something went wrong.