Add registry for Binding rituals and add JEI support
This commit is contained in:
parent
a3b12cb7e2
commit
13d9cb4b5a
|
@ -40,7 +40,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "mezz.jei:jei_1.8.8:2.1.2.11"
|
deobfCompile "mezz.jei:jei_1.8.8:${jei_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
|
|
|
@ -6,3 +6,5 @@ forge_version=latest
|
||||||
curse_id=224791
|
curse_id=224791
|
||||||
|
|
||||||
mappings_version=snapshot_20151128
|
mappings_version=snapshot_20151128
|
||||||
|
|
||||||
|
jei_version=2.1.3.13
|
|
@ -65,6 +65,7 @@ public class Constants {
|
||||||
|
|
||||||
public static class Compat {
|
public static class Compat {
|
||||||
public static final String JEI_CATEGORY_ALTAR = Mod.MODID + ":altar";
|
public static final String JEI_CATEGORY_ALTAR = Mod.MODID + ":altar";
|
||||||
|
public static final String JEI_CATEGORY_BINDING = Mod.MODID + ":binding";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Misc {
|
public static class Misc {
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
package WayofTime.bloodmagic.api.altar;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@ToString
|
|
||||||
public class AltarRecipe {
|
|
||||||
|
|
||||||
public final int syphon, consumeRate, drainRate;
|
|
||||||
public final boolean useTag;
|
|
||||||
public final ItemStack input, output;
|
|
||||||
public final EnumAltarTier minTier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows creation of a recipe for the {@link WayofTime.bloodmagic.block.BlockAltar} / {@link WayofTime.bloodmagic.tile.TileAltar}.
|
|
||||||
* The output ItemStack is allowed to be null as some recipes do not contain an output. (Blood Orbs)
|
|
||||||
*
|
|
||||||
* @param input - The input ItemStack
|
|
||||||
* @param output - The ItemStack obtained from the recipe
|
|
||||||
* @param minTier - The minimum tier of Altar required
|
|
||||||
* @param syphon - The amount of LP to syphon from the Altar
|
|
||||||
* @param consumeRate - The rate at which LP is consumed during crafting
|
|
||||||
* @param drainRate - The rate at which LP is drained during crafting
|
|
||||||
* @param useTag -
|
|
||||||
*/
|
|
||||||
// public AltarRecipe(ItemStackWrapper input, @Nullable ItemStackWrapper output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
|
||||||
// this.input = input;
|
|
||||||
// this.output = output;
|
|
||||||
// this.minTier = minTier;
|
|
||||||
// this.syphon = syphon;
|
|
||||||
// this.consumeRate = consumeRate;
|
|
||||||
// this.drainRate = drainRate;
|
|
||||||
// this.useTag = useTag;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public AltarRecipe(ItemStackWrapper input, ItemStackWrapper output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) {
|
|
||||||
// this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public AltarRecipe(ItemStackWrapper input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
|
||||||
// this(input, null, minTier, 0, consumeRate, drainRate);
|
|
||||||
// }
|
|
||||||
public AltarRecipe(ItemStack input, @Nullable ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
|
||||||
this.input = input;
|
|
||||||
this.output = output;
|
|
||||||
this.minTier = minTier;
|
|
||||||
this.syphon = syphon;
|
|
||||||
this.consumeRate = consumeRate;
|
|
||||||
this.drainRate = drainRate;
|
|
||||||
this.useTag = useTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) {
|
|
||||||
this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AltarRecipe(ItemStack input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
|
||||||
this(input, null, minTier, 0, consumeRate, drainRate);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +1,16 @@
|
||||||
package WayofTime.bloodmagic.api.registry;
|
package WayofTime.bloodmagic.api.registry;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||||
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.ToString;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class AltarRecipeRegistry {
|
public class AltarRecipeRegistry {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -16,10 +20,68 @@ public class AltarRecipeRegistry {
|
||||||
if (!recipes.containsValue(recipe))
|
if (!recipes.containsValue(recipe))
|
||||||
recipes.put(recipe.input, recipe);
|
recipes.put(recipe.input, recipe);
|
||||||
else
|
else
|
||||||
BloodMagicAPI.getLogger().error("Error adding recipe for " + recipe.input.getDisplayName() + (recipe.output == null ? "" : " -> " + recipe.output.getDisplayName()) + ". Recipe already exists.");
|
BloodMagicAPI.getLogger().error("Error adding altar recipe for " + recipe.input.getDisplayName() + (recipe.output == null ? "" : " -> " + recipe.output.getDisplayName()) + ". Recipe already exists.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AltarRecipe getRecipeForInput(ItemStack input) {
|
public static AltarRecipe getRecipeForInput(ItemStack input) {
|
||||||
return recipes.get(input);
|
return recipes.get(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public static class AltarRecipe {
|
||||||
|
|
||||||
|
public final int syphon, consumeRate, drainRate;
|
||||||
|
public final boolean useTag;
|
||||||
|
public final ItemStack input, output;
|
||||||
|
public final EnumAltarTier minTier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows creation of a recipe for the {@link WayofTime.bloodmagic.block.BlockAltar} / {@link WayofTime.bloodmagic.tile.TileAltar}.
|
||||||
|
* The output ItemStack is allowed to be null as some recipes do not contain an output. (Blood Orbs)
|
||||||
|
*
|
||||||
|
* @param input - The input ItemStack
|
||||||
|
* @param output - The ItemStack obtained from the recipe
|
||||||
|
* @param minTier - The minimum tier of Altar required
|
||||||
|
* @param syphon - The amount of LP to syphon from the Altar
|
||||||
|
* @param consumeRate - The rate at which LP is consumed during crafting
|
||||||
|
* @param drainRate - The rate at which LP is drained during crafting
|
||||||
|
* @param useTag -
|
||||||
|
*/
|
||||||
|
// public AltarRecipe(ItemStackWrapper input, @Nullable ItemStackWrapper output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
||||||
|
// this.input = input;
|
||||||
|
// this.output = output;
|
||||||
|
// this.minTier = minTier;
|
||||||
|
// this.syphon = syphon;
|
||||||
|
// this.consumeRate = consumeRate;
|
||||||
|
// this.drainRate = drainRate;
|
||||||
|
// this.useTag = useTag;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public AltarRecipe(ItemStackWrapper input, ItemStackWrapper output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) {
|
||||||
|
// this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public AltarRecipe(ItemStackWrapper input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
||||||
|
// this(input, null, minTier, 0, consumeRate, drainRate);
|
||||||
|
// }
|
||||||
|
public AltarRecipe(ItemStack input, @Nullable ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean useTag) {
|
||||||
|
this.input = input;
|
||||||
|
this.output = output;
|
||||||
|
this.minTier = minTier;
|
||||||
|
this.syphon = syphon;
|
||||||
|
this.consumeRate = consumeRate;
|
||||||
|
this.drainRate = drainRate;
|
||||||
|
this.useTag = useTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AltarRecipe(ItemStack input, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) {
|
||||||
|
this(input, output, minTier, syphon, consumeRate, drainRate, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AltarRecipe(ItemStack input, EnumAltarTier minTier, int consumeRate, int drainRate) {
|
||||||
|
this(input, null, minTier, 0, consumeRate, drainRate);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package WayofTime.bloodmagic.api.registry;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||||
|
import com.google.common.collect.BiMap;
|
||||||
|
import com.google.common.collect.HashBiMap;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class BindingRecipeRegistry {
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private static BiMap<ItemStack, BindingRecipe> recipes = HashBiMap.create();
|
||||||
|
|
||||||
|
public static void registerRecipe(BindingRecipe recipe) {
|
||||||
|
if (!recipes.containsValue(recipe))
|
||||||
|
recipes.put(recipe.getInput(), recipe);
|
||||||
|
else
|
||||||
|
BloodMagicAPI.getLogger().error("Error adding binding recipe for " + recipe.input.getDisplayName() + (recipe.output == null ? "" : " -> " + recipe.output.getDisplayName()) + ". Recipe already exists.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BindingRecipe getRecipeForInput(ItemStack input) {
|
||||||
|
return recipes.get(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public static class BindingRecipe {
|
||||||
|
|
||||||
|
private final ItemStack input;
|
||||||
|
private final ItemStack output;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,9 @@ package WayofTime.bloodmagic.compat.jei;
|
||||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
|
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
|
||||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeHandler;
|
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeHandler;
|
||||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeMaker;
|
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeMaker;
|
||||||
|
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
|
||||||
|
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
|
||||||
|
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||||
import mezz.jei.api.IModPlugin;
|
import mezz.jei.api.IModPlugin;
|
||||||
import mezz.jei.api.recipe.IRecipeCategory;
|
import mezz.jei.api.recipe.IRecipeCategory;
|
||||||
import mezz.jei.api.recipe.IRecipeHandler;
|
import mezz.jei.api.recipe.IRecipeHandler;
|
||||||
|
@ -24,7 +27,8 @@ public class BloodMagicPlugin implements IModPlugin {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public Iterable<? extends IRecipeCategory> getRecipeCategories() {
|
public Iterable<? extends IRecipeCategory> getRecipeCategories() {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new AltarRecipeCategory()
|
new AltarRecipeCategory(),
|
||||||
|
new BindingRecipeCategory()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +36,8 @@ public class BloodMagicPlugin implements IModPlugin {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public Iterable<? extends IRecipeHandler> getRecipeHandlers() {
|
public Iterable<? extends IRecipeHandler> getRecipeHandlers() {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
new AltarRecipeHandler()
|
new AltarRecipeHandler(),
|
||||||
|
new BindingRecipeHandler()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +53,8 @@ public class BloodMagicPlugin implements IModPlugin {
|
||||||
public Iterable<Object> getRecipes() {
|
public Iterable<Object> getRecipes() {
|
||||||
List<Object> recipes = new ArrayList<Object>();
|
List<Object> recipes = new ArrayList<Object>();
|
||||||
|
|
||||||
recipes.addAll(AltarRecipeMaker.getAltarRecipes());
|
recipes.addAll(AltarRecipeMaker.getRecipes());
|
||||||
|
recipes.addAll(BindingRecipeMaker.getRecipes());
|
||||||
|
|
||||||
return recipes;
|
return recipes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.altar;
|
package WayofTime.bloodmagic.compat.jei.altar;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@ -12,12 +11,12 @@ import java.util.Map;
|
||||||
public class AltarRecipeMaker {
|
public class AltarRecipeMaker {
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public static List<AltarRecipeJEI> getAltarRecipes() {
|
public static List<AltarRecipeJEI> getRecipes() {
|
||||||
Map<ItemStack, AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
Map<ItemStack, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
||||||
|
|
||||||
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
||||||
|
|
||||||
for (Map.Entry<ItemStack, AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
for (Map.Entry<ItemStack, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
||||||
if (itemStackAltarRecipeEntry.getValue().getOutput() != null) { // Make sure output is not null. If it is, the recipe is for a filling orb, and we don't want that.
|
if (itemStackAltarRecipeEntry.getValue().getOutput() != null) { // Make sure output is not null. If it is, the recipe is for a filling orb, and we don't want that.
|
||||||
ItemStack input = itemStackAltarRecipeEntry.getKey();
|
ItemStack input = itemStackAltarRecipeEntry.getKey();
|
||||||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package WayofTime.bloodmagic.compat.jei.binding;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
import mezz.jei.api.JEIManager;
|
||||||
|
import mezz.jei.api.gui.IDrawable;
|
||||||
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
|
import mezz.jei.api.recipe.IRecipeCategory;
|
||||||
|
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
public class BindingRecipeCategory implements IRecipeCategory {
|
||||||
|
|
||||||
|
private static final int INPUT_SLOT = 0;
|
||||||
|
private static final int OUTPUT_SLOT = 1;
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private final IDrawable background = JEIManager.guiHelper.createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||||
|
@Nonnull
|
||||||
|
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.binding");
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public String getUid() {
|
||||||
|
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public String getTitle() {
|
||||||
|
return localizedName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public IDrawable getBackground() {
|
||||||
|
return background;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(@Nonnull IRecipeLayout recipeLayout) {
|
||||||
|
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||||
|
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||||
|
if (recipeWrapper instanceof BindingRecipeJEI) {
|
||||||
|
BindingRecipeJEI bindingRecipeWrapper = (BindingRecipeJEI) recipeWrapper;
|
||||||
|
recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipeWrapper.getInputs());
|
||||||
|
recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipeWrapper.getOutputs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package WayofTime.bloodmagic.compat.jei.binding;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import mezz.jei.api.recipe.IRecipeHandler;
|
||||||
|
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI> {
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public Class<BindingRecipeJEI> getRecipeClass() {
|
||||||
|
return BindingRecipeJEI.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public String getRecipeCategoryUid() {
|
||||||
|
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public IRecipeWrapper getRecipeWrapper(@Nonnull BindingRecipeJEI recipe) {
|
||||||
|
return recipe;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe) {
|
||||||
|
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package WayofTime.bloodmagic.compat.jei.binding;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.compat.jei.BloodMagicRecipeWrapper;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BindingRecipeJEI extends BloodMagicRecipeWrapper {
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private final ItemStack input;
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private final ItemStack output;
|
||||||
|
|
||||||
|
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output) {
|
||||||
|
this.input = input;
|
||||||
|
this.output = output;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesOreDictionaryComparison() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List getInputs() {
|
||||||
|
return Collections.singletonList(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List getOutputs() {
|
||||||
|
return Collections.singletonList(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawInfo(@Nonnull Minecraft minecraft) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package WayofTime.bloodmagic.compat.jei.binding;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.registry.BindingRecipeRegistry;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class BindingRecipeMaker {
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
public static List<BindingRecipeJEI> getRecipes() {
|
||||||
|
Map<ItemStack, BindingRecipeRegistry.BindingRecipe> altarMap = BindingRecipeRegistry.getRecipes();
|
||||||
|
|
||||||
|
ArrayList<BindingRecipeJEI> recipes = new ArrayList<BindingRecipeJEI>();
|
||||||
|
|
||||||
|
for (Map.Entry<ItemStack, BindingRecipeRegistry.BindingRecipe> itemStackBindingRecipeEntry : altarMap.entrySet()) {
|
||||||
|
ItemStack input = itemStackBindingRecipeEntry.getKey();
|
||||||
|
ItemStack output = itemStackBindingRecipeEntry.getValue().getOutput();
|
||||||
|
|
||||||
|
BindingRecipeJEI recipe = new BindingRecipeJEI(input, output);
|
||||||
|
recipes.add(recipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
return recipes;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package WayofTime.bloodmagic.registry;
|
package WayofTime.bloodmagic.registry;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||||
|
@ -10,36 +9,37 @@ import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ModRecipes {
|
public class ModRecipes {
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
addAltarRecipes();
|
addAltarRecipes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addAltarRecipes() {
|
public static void addAltarRecipes() {
|
||||||
// ONE
|
// ONE
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Items.diamond), OrbRegistry.getOrbStack(ModItems.orbWeak), EnumAltarTier.ONE, 2000, 2, 1, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.diamond), OrbRegistry.getOrbStack(ModItems.orbWeak), EnumAltarTier.ONE, 2000, 2, 1, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.stone), new ItemStack(ModItems.slate), EnumAltarTier.ONE, 1000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.stone), new ItemStack(ModItems.slate), EnumAltarTier.ONE, 1000, 5, 5, false));
|
||||||
|
|
||||||
// TWO
|
// TWO
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Items.emerald), OrbRegistry.getOrbStack(ModItems.orbApprentice), EnumAltarTier.TWO, 5000, 2, 1, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.emerald), OrbRegistry.getOrbStack(ModItems.orbApprentice), EnumAltarTier.TWO, 5000, 2, 1, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(ModItems.slate), new ItemStack(ModItems.slate, 1, 1), EnumAltarTier.TWO, 2000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(ModItems.slate), new ItemStack(ModItems.slate, 1, 1), EnumAltarTier.TWO, 2000, 5, 5, false));
|
||||||
|
|
||||||
// THREE
|
// THREE
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.gold_block), OrbRegistry.getOrbStack(ModItems.orbMagician), EnumAltarTier.THREE, 25000, 2, 1, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.gold_block), OrbRegistry.getOrbStack(ModItems.orbMagician), EnumAltarTier.THREE, 25000, 2, 1, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(ModItems.slate, 1, 1), new ItemStack(ModItems.slate, 1, 2), EnumAltarTier.THREE, 5000, 15, 10, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(ModItems.slate, 1, 1), new ItemStack(ModItems.slate, 1, 2), EnumAltarTier.THREE, 5000, 15, 10, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.obsidian), EnumRuneType.EARTH.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.obsidian), EnumRuneType.EARTH.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.lapis_block), EnumRuneType.WATER.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.lapis_block), EnumRuneType.WATER.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Items.magma_cream), EnumRuneType.FIRE.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.magma_cream), EnumRuneType.FIRE.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Items.ghast_tear), EnumRuneType.AIR.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.ghast_tear), EnumRuneType.AIR.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5, false));
|
||||||
|
|
||||||
// FOUR
|
// FOUR
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(ModItems.slate, 1, 2), new ItemStack(ModItems.slate, 1, 3), EnumAltarTier.FOUR, 15000, 20, 20, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(ModItems.slate, 1, 2), new ItemStack(ModItems.slate, 1, 3), EnumAltarTier.FOUR, 15000, 20, 20, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.coal_block), EnumRuneType.DUSK.getScribeStack(), EnumAltarTier.FOUR, 2000, 20, 10, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.coal_block), EnumRuneType.DUSK.getScribeStack(), EnumAltarTier.FOUR, 2000, 20, 10, false));
|
||||||
|
|
||||||
// FIVE
|
// FIVE
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(ModItems.slate, 1, 3), new ItemStack(ModItems.slate, 1, 4), EnumAltarTier.FIVE, 30000, 40, 100, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(ModItems.slate, 1, 3), new ItemStack(ModItems.slate, 1, 4), EnumAltarTier.FIVE, 30000, 40, 100, false));
|
||||||
|
|
||||||
// SIX
|
// SIX
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(ModBlocks.crystal), OrbRegistry.getOrbStack(ModItems.orbTranscendent), EnumAltarTier.SIX, 200000, 100, 200, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(ModBlocks.crystal), OrbRegistry.getOrbStack(ModItems.orbTranscendent), EnumAltarTier.SIX, 200000, 100, 200, false));
|
||||||
AltarRecipeRegistry.registerRecipe(new AltarRecipe(new ItemStack(Blocks.glowstone), EnumRuneType.DAWN.getScribeStack(), EnumAltarTier.SIX, 200000, 100, 200, false));
|
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.glowstone), EnumRuneType.DAWN.getScribeStack(), EnumAltarTier.SIX, 200000, 100, 200, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package WayofTime.bloodmagic.tile;
|
||||||
import WayofTime.bloodmagic.altar.BloodAltar;
|
import WayofTime.bloodmagic.altar.BloodAltar;
|
||||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.altar.AltarUpgrade;
|
import WayofTime.bloodmagic.api.altar.AltarUpgrade;
|
||||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||||
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
||||||
|
@ -199,7 +198,7 @@ public class TileAltar extends TileInventory implements IBloodAltar, ITickable,
|
||||||
// Do recipes
|
// Do recipes
|
||||||
for (ItemStack itemStack : AltarRecipeRegistry.getRecipes().keySet()) {
|
for (ItemStack itemStack : AltarRecipeRegistry.getRecipes().keySet()) {
|
||||||
if (getStackInSlot(0).getIsItemStackEqual(AltarRecipeRegistry.getRecipes().get(itemStack).getInput())) {
|
if (getStackInSlot(0).getIsItemStackEqual(AltarRecipeRegistry.getRecipes().get(itemStack).getInput())) {
|
||||||
AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(itemStack);
|
AltarRecipeRegistry.AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(itemStack);
|
||||||
|
|
||||||
if (altarTier.ordinal() >= recipe.getMinTier().ordinal()) {
|
if (altarTier.ordinal() >= recipe.getMinTier().ordinal()) {
|
||||||
this.isActive = true;
|
this.isActive = true;
|
||||||
|
|
|
@ -138,5 +138,6 @@ chat.BloodMagic.damageSource=%s's soul became too weak
|
||||||
|
|
||||||
# JustEnoughItems
|
# JustEnoughItems
|
||||||
jei.BloodMagic.recipe.altar=Blood Altar
|
jei.BloodMagic.recipe.altar=Blood Altar
|
||||||
|
jei.BloodMagic.recipe.binding=Binding Ritual
|
||||||
jei.BloodMagic.recipe.requiredLP=LP: %d
|
jei.BloodMagic.recipe.requiredLP=LP: %d
|
||||||
jei.BloodMagic.recipe.requiredTier=Tier: %d
|
jei.BloodMagic.recipe.requiredTier=Tier: %d
|
||||||
|
|
Loading…
Reference in a new issue