Half moved to new recipe stuff
Still need to move alchemy table recipes over and figure out how to do the custom recipe types.
This commit is contained in:
parent
a10b2ece9a
commit
b0404599c2
|
@ -88,8 +88,6 @@ public class BloodMagic {
|
|||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
BloodMagicPacketHandler.init();
|
||||
for (Pair<IBloodMagicPlugin, BloodMagicPlugin> plugin : PLUGINS)
|
||||
plugin.getLeft().register(BloodMagicAPI.INSTANCE);
|
||||
|
||||
ModRecipes.init();
|
||||
ModRituals.initRituals();
|
||||
|
@ -106,6 +104,9 @@ public class BloodMagic {
|
|||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ModRecipes.addCompressionHandlers();
|
||||
|
||||
for (Pair<IBloodMagicPlugin, BloodMagicPlugin> plugin : PLUGINS)
|
||||
plugin.getLeft().register(BloodMagicAPI.INSTANCE);
|
||||
|
||||
proxy.postInit();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,14 +6,12 @@ import WayofTime.bloodmagic.api.altar.*;
|
|||
import WayofTime.bloodmagic.api.event.AltarCraftedEvent;
|
||||
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.block.BlockBloodRune;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Enums;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -31,7 +29,6 @@ import net.minecraftforge.fluids.FluidTank;
|
|||
import net.minecraftforge.fluids.capability.FluidTankPropertiesWrapper;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -78,7 +75,7 @@ public class BloodAltar implements IFluidHandler {
|
|||
private int chargingFrequency = 0;
|
||||
private int maxCharge = 0;
|
||||
private int cooldownAfterCrafting = 60;
|
||||
private AltarRecipe recipe;
|
||||
private RecipeBloodAltar recipe;
|
||||
private ItemStack result = ItemStack.EMPTY;
|
||||
private EnumAltarTier currentTierDisplayed = EnumAltarTier.ONE;
|
||||
|
||||
|
@ -189,14 +186,14 @@ public class BloodAltar implements IFluidHandler {
|
|||
|
||||
if (!input.isEmpty()) {
|
||||
// Do recipes
|
||||
AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(input);
|
||||
RecipeBloodAltar recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getBloodAltar(input);
|
||||
if (recipe != null) {
|
||||
if (recipe.doesRequiredItemMatch(input, altarTier)) {
|
||||
if (recipe.getMinimumTier().ordinal() <= altarTier.ordinal()) {
|
||||
this.isActive = true;
|
||||
this.recipe = recipe;
|
||||
this.result = recipe.getOutput().isEmpty() ? ItemStack.EMPTY : new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata());
|
||||
this.liquidRequired = recipe.getSyphon();
|
||||
this.canBeFilled = recipe.isFillable();
|
||||
this.canBeFilled = false;
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
return;
|
||||
|
@ -318,7 +315,8 @@ public class BloodAltar implements IFluidHandler {
|
|||
if (!result.isEmpty())
|
||||
result.setCount(result.getCount() * stackSize);
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new AltarCraftedEvent(recipe, result));
|
||||
// TODO - Update for new recipe type
|
||||
// MinecraftForge.EVENT_BUS.post(new AltarCraftedEvent(recipe, result));
|
||||
tileAltar.setInventorySlotContents(0, result);
|
||||
progress = 0;
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ public enum EnumAltarTier {
|
|||
//@formatter:on
|
||||
};
|
||||
|
||||
public static final EnumAltarTier[] VALUES = values();
|
||||
public static final int MAXTIERS = values().length;
|
||||
|
||||
ArrayList<AltarComponent> altarComponents = new ArrayList<AltarComponent>();
|
||||
|
|
|
@ -9,6 +9,8 @@ import com.google.common.collect.Multimap;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public class BloodMagicAPI implements IBloodMagicAPI {
|
||||
|
@ -16,27 +18,36 @@ public class BloodMagicAPI implements IBloodMagicAPI {
|
|||
public static final BloodMagicAPI INSTANCE = new BloodMagicAPI();
|
||||
|
||||
private final BloodMagicBlacklist blacklist;
|
||||
private final BloodMagicRecipeRegistrar recipeRegistrar;
|
||||
private final Map<ResourceLocation, Integer> sacrificialValues;
|
||||
private final Multimap<EnumAltarComponent, IBlockState> altarComponents;
|
||||
|
||||
public BloodMagicAPI() {
|
||||
this.blacklist = new BloodMagicBlacklist();
|
||||
this.recipeRegistrar = new BloodMagicRecipeRegistrar();
|
||||
this.sacrificialValues = Maps.newHashMap();
|
||||
this.altarComponents = ArrayListMultimap.create();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BloodMagicBlacklist getBlacklist() {
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public void setSacrificialValue(ResourceLocation entityId, int value) {
|
||||
public BloodMagicRecipeRegistrar getRecipeRegistrar() {
|
||||
return recipeRegistrar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSacrificialValue(@Nonnull ResourceLocation entityId, @Nonnegative int value) {
|
||||
sacrificialValues.put(entityId, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAltarComponent(IBlockState state, String componentType) {
|
||||
public void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType) {
|
||||
EnumAltarComponent component = EnumAltarComponent.NOTAIR;
|
||||
for (EnumAltarComponent type : EnumAltarComponent.VALUES) {
|
||||
if (type.name().equalsIgnoreCase(componentType)) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Set;
|
||||
|
||||
public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
||||
|
@ -26,49 +27,49 @@ public class BloodMagicBlacklist implements IBloodMagicBlacklist {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(IBlockState state) {
|
||||
public void addTeleposer(@Nonnull IBlockState state) {
|
||||
if (!teleposer.contains(state))
|
||||
teleposer.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(Block block) {
|
||||
public void addTeleposer(@Nonnull Block block) {
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addTeleposer(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeleposer(ResourceLocation entityId) {
|
||||
public void addTeleposer(@Nonnull ResourceLocation entityId) {
|
||||
if (!teleposerEntities.contains(entityId))
|
||||
teleposerEntities.add(entityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransposition(IBlockState state) {
|
||||
public void addTransposition(@Nonnull IBlockState state) {
|
||||
if (!transposition.contains(state))
|
||||
transposition.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransposition(Block block) {
|
||||
public void addTransposition(@Nonnull Block block) {
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addTransposition(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGreenGrove(IBlockState state) {
|
||||
public void addGreenGrove(@Nonnull IBlockState state) {
|
||||
if (!greenGrove.contains(state))
|
||||
greenGrove.add(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGreenGrove(Block block) {
|
||||
public void addGreenGrove(@Nonnull Block block) {
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
addGreenGrove(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSacrifice(ResourceLocation entityId) {
|
||||
public void addSacrifice(@Nonnull ResourceLocation entityId) {
|
||||
if (!sacrifice.contains(entityId))
|
||||
sacrifice.add(entityId);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import WayofTime.bloodmagic.block.BlockDecorative;
|
|||
import WayofTime.bloodmagic.block.enums.EnumBloodRune;
|
||||
import WayofTime.bloodmagic.block.enums.EnumDecorative;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicRecipes;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
@ -50,5 +51,9 @@ public class BloodMagicCorePlugin implements IBloodMagicPlugin {
|
|||
BlockBloodRune bloodRune = (BlockBloodRune) RegistrarBloodMagicBlocks.BLOOD_RUNE;
|
||||
for (EnumBloodRune runeType : EnumBloodRune.values())
|
||||
api.registerAltarComponent(bloodRune.getDefaultState().withProperty(bloodRune.getProperty(), runeType), EnumAltarComponent.BLOODRUNE.name());
|
||||
|
||||
RegistrarBloodMagicRecipes.registerAltarRecipes(api.getRecipeRegistrar());
|
||||
RegistrarBloodMagicRecipes.registerAlchemyTableRecipes(api.getRecipeRegistrar());
|
||||
RegistrarBloodMagicRecipes.registerTartaricForgeRecipes(((BloodMagicAPI) api).getRecipeRegistrar());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
package WayofTime.bloodmagic.api_impl;
|
||||
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.core.recipe.IngredientBloodOrb;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BloodMagicRecipeRegistrar implements IBloodMagicRecipeRegistrar {
|
||||
|
||||
private final Map<Ingredient, RecipeBloodAltar> altarRecipes;
|
||||
private final Map<List<Ingredient>, RecipeAlchemyTable> alchemyRecipes;
|
||||
private final Map<List<Ingredient>, RecipeTartaricForge> tartaricForgeRecipes;
|
||||
|
||||
public BloodMagicRecipeRegistrar() {
|
||||
this.altarRecipes = Maps.newHashMap();
|
||||
this.alchemyRecipes = Maps.newHashMap();
|
||||
this.tartaricForgeRecipes = Maps.newHashMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(consumeRate >= 0, "consumeRate cannot be negative.");
|
||||
Preconditions.checkArgument(drainRate >= 0, "drainRate cannot be negative.");
|
||||
|
||||
altarRecipes.put(input, new RecipeBloodAltar(input, output, minimumTier, syphon, consumeRate, drainRate));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAlchemyTable(@Nonnull ItemStack output, @Nonnegative int syphon, @Nonnegative int ticks, @Nonnegative int minimumTier, @Nonnull Ingredient... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input);
|
||||
alchemyRecipes.put(inputs, new RecipeAlchemyTable(inputs, output, syphon, ticks, minimumTier));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Ingredient... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
NonNullList<Ingredient> inputs = NonNullList.from(Ingredient.EMPTY, input);
|
||||
tartaricForgeRecipes.put(inputs, new RecipeTartaricForge(inputs, output, minimumSouls, soulDrain));
|
||||
}
|
||||
|
||||
public void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Object... input) {
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
List<Ingredient> ingredients = Lists.newArrayList();
|
||||
for (Object object : input) {
|
||||
if (object instanceof ItemStack && ((ItemStack) object).getItem() instanceof IBloodOrb) {
|
||||
ingredients.add(new IngredientBloodOrb(((IBloodOrb) ((ItemStack) object).getItem()).getOrb((ItemStack) object)));
|
||||
continue;
|
||||
}
|
||||
|
||||
ingredients.add(CraftingHelper.getIngredient(object));
|
||||
}
|
||||
|
||||
addTartaricForge(output, minimumSouls, soulDrain, ingredients.toArray(new Ingredient[0]));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeBloodAltar getBloodAltar(@Nonnull ItemStack input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
for (Map.Entry<Ingredient, RecipeBloodAltar> entry : altarRecipes.entrySet())
|
||||
if (entry.getKey().test(input))
|
||||
return entry.getValue();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeAlchemyTable getAlchemyTable(@Nonnull List<ItemStack> input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
mainLoop:
|
||||
for (Map.Entry<List<Ingredient>, RecipeAlchemyTable> entry : alchemyRecipes.entrySet()) {
|
||||
if (entry.getKey().size() != input.size())
|
||||
continue;
|
||||
|
||||
for (int i = 0; i > input.size(); i++) {
|
||||
Ingredient ingredient = entry.getKey().get(i);
|
||||
if (!ingredient.apply(input.get(i)))
|
||||
continue mainLoop;
|
||||
}
|
||||
|
||||
return entry.getValue();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RecipeTartaricForge getTartaricForge(@Nonnull List<ItemStack> input) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
|
||||
mainLoop:
|
||||
for (Map.Entry<List<Ingredient>, RecipeTartaricForge> entry : tartaricForgeRecipes.entrySet()) {
|
||||
if (entry.getKey().size() != input.size())
|
||||
continue;
|
||||
|
||||
for (int i = 0; i > input.size(); i++) {
|
||||
Ingredient ingredient = entry.getKey().get(i);
|
||||
if (!ingredient.apply(input.get(i)))
|
||||
continue mainLoop;
|
||||
}
|
||||
|
||||
return entry.getValue();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Map<Ingredient, RecipeBloodAltar> getAltarRecipes() {
|
||||
return ImmutableMap.copyOf(altarRecipes);
|
||||
}
|
||||
|
||||
public Map<List<Ingredient>, RecipeAlchemyTable> getAlchemyRecipes() {
|
||||
return ImmutableMap.copyOf(alchemyRecipes);
|
||||
}
|
||||
|
||||
public Map<List<Ingredient>, RecipeTartaricForge> getTartaricForgeRecipes() {
|
||||
return ImmutableMap.copyOf(tartaricForgeRecipes);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeAlchemyTable {
|
||||
|
||||
@Nonnull
|
||||
private final NonNullList<Ingredient> input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnegative
|
||||
private final int syphon;
|
||||
@Nonnegative
|
||||
private final int ticks;
|
||||
@Nonnegative
|
||||
private final int minimumTier;
|
||||
|
||||
public RecipeAlchemyTable(@Nonnull NonNullList<Ingredient> input, @Nonnull ItemStack output, int syphon, int ticks, int minimumTier) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(ticks >= 0, "ticks cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier >= 0, "minimumTier cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.syphon = syphon;
|
||||
this.ticks = ticks;
|
||||
this.minimumTier = minimumTier;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final NonNullList<Ingredient> getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public final int getSyphon() {
|
||||
return syphon;
|
||||
}
|
||||
|
||||
public final int getTicks() {
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public final int getMinimumTier() {
|
||||
return minimumTier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof RecipeAlchemyTable)) return false;
|
||||
|
||||
RecipeAlchemyTable that = (RecipeAlchemyTable) o;
|
||||
|
||||
if (syphon != that.syphon) return false;
|
||||
if (ticks != that.ticks) return false;
|
||||
if (minimumTier != that.minimumTier) return false;
|
||||
if (!input.equals(that.input)) return false;
|
||||
return ItemStack.areItemStacksEqual(output, that.output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = input.hashCode();
|
||||
result = 31 * result + output.hashCode();
|
||||
result = 31 * result + syphon;
|
||||
result = 31 * result + ticks;
|
||||
result = 31 * result + minimumTier;
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeBloodAltar {
|
||||
|
||||
@Nonnull
|
||||
private final Ingredient input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnull
|
||||
private final EnumAltarTier minimumTier;
|
||||
@Nonnegative
|
||||
private final int syphon;
|
||||
@Nonnegative
|
||||
private final int consumeRate;
|
||||
@Nonnegative
|
||||
private final int drainRate;
|
||||
|
||||
public RecipeBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkNotNull(minimumTier, "minimumTier cannot be negative.");
|
||||
Preconditions.checkArgument(minimumTier <= EnumAltarTier.MAXTIERS, "minimumTier cannot be higher than max tier");
|
||||
Preconditions.checkArgument(syphon >= 0, "syphon cannot be negative.");
|
||||
Preconditions.checkArgument(consumeRate >= 0, "consumeRate cannot be negative.");
|
||||
Preconditions.checkArgument(drainRate >= 0, "drain cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.minimumTier = EnumAltarTier.VALUES[minimumTier];
|
||||
this.syphon = syphon;
|
||||
this.consumeRate = consumeRate;
|
||||
this.drainRate = drainRate;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final Ingredient getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public EnumAltarTier getMinimumTier() {
|
||||
return minimumTier;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getSyphon() {
|
||||
return syphon;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getConsumeRate() {
|
||||
return consumeRate;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final int getDrainRate() {
|
||||
return drainRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof RecipeBloodAltar)) return false;
|
||||
|
||||
RecipeBloodAltar that = (RecipeBloodAltar) o;
|
||||
|
||||
if (minimumTier != that.minimumTier) return false;
|
||||
if (syphon != that.syphon) return false;
|
||||
if (drainRate != that.drainRate) return false;
|
||||
if (!input.equals(that.input)) return false;
|
||||
return ItemStack.areItemStacksEqual(output, that.output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = input.hashCode();
|
||||
result = 31 * result + output.hashCode();
|
||||
result = 31 * result + minimumTier.ordinal();
|
||||
result = 31 * result + syphon;
|
||||
result = 31 * result + drainRate;
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package WayofTime.bloodmagic.api_impl.recipe;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RecipeTartaricForge {
|
||||
|
||||
@Nonnull
|
||||
private final NonNullList<Ingredient> input;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
@Nonnegative
|
||||
private final double minimumSouls;
|
||||
@Nonnegative
|
||||
private final double soulDrain;
|
||||
|
||||
public RecipeTartaricForge(@Nonnull NonNullList<Ingredient> input, @Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain) {
|
||||
Preconditions.checkNotNull(input, "input cannot be null.");
|
||||
Preconditions.checkNotNull(output, "output cannot be null.");
|
||||
Preconditions.checkArgument(minimumSouls >= 0, "minimumSouls cannot be negative.");
|
||||
Preconditions.checkArgument(soulDrain >= 0, "soulDrain cannot be negative.");
|
||||
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.minimumSouls = minimumSouls;
|
||||
this.soulDrain = soulDrain;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final NonNullList<Ingredient> getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final double getMinimumSouls() {
|
||||
return minimumSouls;
|
||||
}
|
||||
|
||||
@Nonnegative
|
||||
public final double getSoulDrain() {
|
||||
return soulDrain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof RecipeTartaricForge)) return false;
|
||||
|
||||
RecipeTartaricForge that = (RecipeTartaricForge) o;
|
||||
|
||||
if (minimumSouls != that.minimumSouls) return false;
|
||||
if (soulDrain != that.soulDrain) return false;
|
||||
if (!input.equals(that.input)) return false;
|
||||
return ItemStack.areItemStacksEqual(output, that.output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result;
|
||||
long temp;
|
||||
result = input.hashCode();
|
||||
result = 31 * result + output.hashCode();
|
||||
temp = Double.doubleToLongBits(minimumSouls);
|
||||
result = 31 * result + (int) (temp ^ (temp >>> 32));
|
||||
temp = Double.doubleToLongBits(soulDrain);
|
||||
result = 31 * result + (int) (temp ^ (temp >>> 32));
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,9 @@ package WayofTime.bloodmagic.apiv2;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicAPI {
|
||||
|
||||
/**
|
||||
|
@ -10,9 +13,13 @@ public interface IBloodMagicAPI {
|
|||
*
|
||||
* @return the active blacklist instance
|
||||
*/
|
||||
@Nonnull
|
||||
IBloodMagicBlacklist getBlacklist();
|
||||
|
||||
void setSacrificialValue(ResourceLocation entityId, int value);
|
||||
@Nonnull
|
||||
IBloodMagicRecipeRegistrar getRecipeRegistrar();
|
||||
|
||||
void registerAltarComponent(IBlockState state, String componentType);
|
||||
void setSacrificialValue(@Nonnull ResourceLocation entityId, @Nonnegative int value);
|
||||
|
||||
void registerAltarComponent(@Nonnull IBlockState state, @Nonnull String componentType);
|
||||
}
|
||||
|
|
|
@ -4,21 +4,23 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicBlacklist {
|
||||
|
||||
void addTeleposer(IBlockState state);
|
||||
void addTeleposer(@Nonnull IBlockState state);
|
||||
|
||||
void addTeleposer(Block block);
|
||||
void addTeleposer(@Nonnull Block block);
|
||||
|
||||
void addTeleposer(ResourceLocation entityId);
|
||||
void addTeleposer(@Nonnull ResourceLocation entityId);
|
||||
|
||||
void addTransposition(IBlockState state);
|
||||
void addTransposition(@Nonnull IBlockState state);
|
||||
|
||||
void addTransposition(Block block);
|
||||
void addTransposition(@Nonnull Block block);
|
||||
|
||||
void addGreenGrove(IBlockState state);
|
||||
void addGreenGrove(@Nonnull IBlockState state);
|
||||
|
||||
void addGreenGrove(Block block);
|
||||
void addGreenGrove(@Nonnull Block block);
|
||||
|
||||
void addSacrifice(ResourceLocation entityId);
|
||||
void addSacrifice(@Nonnull ResourceLocation entityId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package WayofTime.bloodmagic.apiv2;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicPlugin {
|
||||
|
||||
void register(IBloodMagicAPI api);
|
||||
void register(@Nonnull IBloodMagicAPI api);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package WayofTime.bloodmagic.apiv2;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
|
||||
import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IBloodMagicRecipeRegistrar {
|
||||
|
||||
void addBloodAltar(@Nonnull Ingredient input, @Nonnull ItemStack output, @Nonnegative int minimumTier, @Nonnegative int syphon, @Nonnegative int consumeRate, @Nonnegative int drainRate);
|
||||
|
||||
void addAlchemyTable(@Nonnull ItemStack output, @Nonnegative int syphon, @Nonnegative int ticks, @Nonnegative int minimumTier, @Nonnull Ingredient... input);
|
||||
|
||||
void addTartaricForge(@Nonnull ItemStack output, @Nonnegative double minimumSouls, @Nonnegative double soulDrain, @Nonnull Ingredient... input);
|
||||
}
|
|
@ -3,16 +3,18 @@ package WayofTime.bloodmagic.compat.jei;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.client.gui.GuiSoulForge;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeJEI;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeJEI;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeMaker;
|
||||
|
@ -20,8 +22,7 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
|
|||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeJEI;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import mezz.jei.api.*;
|
||||
|
@ -32,7 +33,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.Map;
|
||||
|
||||
@JEIPlugin
|
||||
public class BloodMagicPlugin extends BlankModPlugin {
|
||||
public class BloodMagicPlugin implements IModPlugin {
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
@Override
|
||||
|
@ -40,19 +41,21 @@ public class BloodMagicPlugin extends BlankModPlugin {
|
|||
jeiHelper = registry.getJeiHelpers();
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new AltarRecipeHandler(),
|
||||
new BindingRecipeHandler(),
|
||||
new AlchemyArrayCraftingRecipeHandler(),
|
||||
new TartaricForgeRecipeHandler(),
|
||||
new AlchemyTableRecipeHandler(),
|
||||
new ArmourDowngradeRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes().values(), Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyRecipes().values(), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForgeRecipes().values(), Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.handleRecipes(RecipeBloodAltar.class, AltarRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
registry.handleRecipes(RecipeAlchemyTable.class, AlchemyTableRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.handleRecipes(RecipeTartaricForge.class, TartaricForgeRecipeJEI::new, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyArrayCraftingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(TartaricForgeRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
||||
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
||||
|
||||
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), ItemStack.class, "jei.bloodmagic.desc.altarBuilder");
|
||||
|
|
|
@ -10,13 +10,13 @@ import mezz.jei.api.gui.IDrawable;
|
|||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI> {
|
||||
public class AlchemyTableRecipeCategory implements IRecipeCategory<AlchemyTableRecipeJEI> {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int ORB_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
@ -64,7 +64,7 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
|
|||
}
|
||||
}
|
||||
|
||||
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getTierRequired()));
|
||||
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getMinimumTier()));
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlchemyTableRecipeJEI> getRecipeClass() {
|
||||
return AlchemyTableRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,20 +1,19 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeAlchemyTable;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper {
|
||||
private AlchemyTableRecipe recipe;
|
||||
public class AlchemyTableRecipeJEI implements IRecipeWrapper {
|
||||
private RecipeAlchemyTable recipe;
|
||||
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe) {
|
||||
public AlchemyTableRecipeJEI(RecipeAlchemyTable recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
|
@ -22,21 +21,21 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper {
|
|||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(Lists.<ItemStack>newArrayList()));
|
||||
ingredients.setOutput(ItemStack.class, recipe.getOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34) {
|
||||
ret.add(TextHelper.localize("tooltip.bloodmagic.tier", recipe.getTierRequired()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
tooltip.add(TextHelper.localize("tooltip.bloodmagic.tier", recipe.getMinimumTier()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getSyphon()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicks()));
|
||||
}
|
||||
return ret;
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
public AlchemyTableRecipe getRecipe() {
|
||||
public RecipeAlchemyTable getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyTableRecipeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AlchemyTableRecipeJEI> getRecipes() {
|
||||
List<AlchemyTableRecipe> recipeList = AlchemyTableRecipeRegistry.getRecipeList();
|
||||
ArrayList<AlchemyTableRecipeJEI> recipes = new ArrayList<AlchemyTableRecipeJEI>();
|
||||
|
||||
for (AlchemyTableRecipe recipe : recipeList)
|
||||
recipes.add(new AlchemyTableRecipeJEI(recipe));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import mezz.jei.api.gui.IDrawable;
|
|||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -16,7 +15,7 @@ import net.minecraft.util.ResourceLocation;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AltarRecipeCategory implements IRecipeCategory {
|
||||
public class AltarRecipeCategory implements IRecipeCategory<AltarRecipeJEI> {
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
|
||||
|
@ -55,14 +54,12 @@ public class AltarRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, AltarRecipeJEI recipeWrapper, IIngredients ingredients) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
|
||||
if (recipeWrapper instanceof AltarRecipeJEI) {
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AltarRecipeJEI> getRecipeClass() {
|
||||
return AltarRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,20 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeBloodAltar;
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AltarRecipeJEI extends BlankRecipeWrapper {
|
||||
public class AltarRecipeJEI implements IRecipeWrapper {
|
||||
@Nonnull
|
||||
private final List<ItemStack> input;
|
||||
@Nonnull
|
||||
|
@ -22,13 +24,13 @@ public class AltarRecipeJEI extends BlankRecipeWrapper {
|
|||
private final int consumptionRate;
|
||||
private final int drainRate;
|
||||
|
||||
public AltarRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
public AltarRecipeJEI(RecipeBloodAltar recipe) {
|
||||
this.input = NonNullList.from(ItemStack.EMPTY, recipe.getInput().getMatchingStacks());
|
||||
this.output = recipe.getOutput();
|
||||
|
||||
this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP)};
|
||||
this.consumptionRate = consumptionRate;
|
||||
this.drainRate = drainRate;
|
||||
this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(recipe.getMinimumTier().toInt())), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", recipe.getSyphon())};
|
||||
this.consumptionRate = recipe.getConsumeRate();
|
||||
this.drainRate = recipe.getDrainRate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,12 +41,12 @@ public class AltarRecipeJEI extends BlankRecipeWrapper {
|
|||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
}
|
||||
return ret;
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AltarRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AltarRecipeJEI> getRecipes() {
|
||||
Map<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
||||
|
||||
for (Map.Entry<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
||||
// Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that.
|
||||
if (!(itemStackAltarRecipeEntry.getKey().get(0).toStack().getItem() instanceof IBloodOrb)) {
|
||||
List<ItemStack> input = ItemStackWrapper.toStackList(itemStackAltarRecipeEntry.getValue().getInput());
|
||||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
||||
int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon();
|
||||
int consumptionRate = itemStackAltarRecipeEntry.getValue().getConsumeRate();
|
||||
int drainRate = itemStackAltarRecipeEntry.getValue().getDrainRate();
|
||||
|
||||
if (output.getItem() == ForgeModContainer.getInstance().universalBucket && requiredLP == 1000)
|
||||
output = FluidUtil.getFilledBucket(new FluidStack(BlockLifeEssence.getLifeEssence(), Fluid.BUCKET_VOLUME));
|
||||
|
||||
AltarRecipeJEI recipe = new AltarRecipeJEI(input, output, requiredTier, requiredLP, consumptionRate, drainRate);
|
||||
recipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
|||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -19,7 +18,7 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory<TartaricForgeRecipeJEI> {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int GEM_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
@ -65,7 +64,7 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, TartaricForgeRecipeJEI recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 73, 13);
|
||||
|
@ -79,16 +78,12 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
|
||||
if (recipeWrapper instanceof TartaricForgeRecipeJEI) {
|
||||
TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
guiItemStacks.set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
guiItemStacks.set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<TartaricForgeRecipeJEI> getRecipeClass() {
|
||||
return TartaricForgeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper {
|
||||
private TartaricForgeRecipe recipe;
|
||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
private RecipeTartaricForge recipe;
|
||||
private List<ItemStack> validGems = Lists.newArrayList();
|
||||
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe) {
|
||||
public TartaricForgeRecipeJEI(RecipeTartaricForge recipe) {
|
||||
this.recipe = recipe;
|
||||
|
||||
for (DefaultWill will : DefaultWill.values())
|
||||
|
@ -29,29 +29,25 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper {
|
|||
List<List<ItemStack>> expandedInputs = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
expandedInputs.add(validGems);
|
||||
ingredients.setInputLists(ItemStack.class, expandedInputs);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput());
|
||||
ingredients.setOutput(ItemStack.class, recipe.getOutput());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
List<String> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulsDrained()));
|
||||
return ret;
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
tooltip.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulDrain()));
|
||||
return tooltip;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public TartaricForgeRecipe getRecipe() {
|
||||
public RecipeTartaricForge getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
public List<ItemStack> getValidGems() {
|
||||
return validGems;
|
||||
}
|
||||
|
||||
public enum DefaultWill {
|
||||
SOUL(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL, 1, 0), 64),
|
||||
PETTY(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 0), 64),
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<TartaricForgeRecipeJEI> getRecipes() {
|
||||
List<TartaricForgeRecipe> recipeList = TartaricForgeRecipeRegistry.getRecipeList();
|
||||
ArrayList<TartaricForgeRecipeJEI> recipes = new ArrayList<TartaricForgeRecipeJEI>();
|
||||
|
||||
for (TartaricForgeRecipe recipe : recipeList)
|
||||
recipes.add(new TartaricForgeRecipeJEI(recipe));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
package WayofTime.bloodmagic.core;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.apiv2.IBloodMagicRecipeRegistrar;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import WayofTime.bloodmagic.item.ItemComponent;
|
||||
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||
import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.oredict.OreIngredient;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = BloodMagic.MODID)
|
||||
public class RegistrarBloodMagicRecipes {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerCrafting(RegistryEvent.Register<IRecipe> event) {
|
||||
// TODO - Figure out what recipes still need to be here
|
||||
}
|
||||
|
||||
public static void registerAltarRecipes(IBloodMagicRecipeRegistrar registrar) {
|
||||
// ONE
|
||||
registrar.addBloodAltar(new OreIngredient("gemDiamond"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK), EnumAltarTier.ONE.ordinal(), 2000, 2, 1);
|
||||
registrar.addBloodAltar(new OreIngredient("stone"), new ItemStack(RegistrarBloodMagicItems.SLATE), EnumAltarTier.ONE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.BUCKET), FluidUtil.getFilledBucket(new FluidStack(BlockLifeEssence.getLifeEssence(), Fluid.BUCKET_VOLUME)), EnumAltarTier.ONE.ordinal(), 1000, 5, 0);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.BOOK), new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK), EnumAltarTier.ONE.ordinal(), 1000, 20, 0);
|
||||
|
||||
// TWO
|
||||
registrar.addBloodAltar(new OreIngredient("blockRedstone"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE), EnumAltarTier.TWO.ordinal(), 5000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.SLATE), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), EnumAltarTier.TWO.ordinal(), 2000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.IRON_SWORD), new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE), EnumAltarTier.TWO.ordinal(), 3000, 5, 5);
|
||||
|
||||
// THREE
|
||||
registrar.addBloodAltar(new OreIngredient("blockGold"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN), EnumAltarTier.THREE.ordinal(), 25000, 20, 20);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2), EnumAltarTier.THREE.ordinal(), 5000, 15, 10);
|
||||
registrar.addBloodAltar(new OreIngredient("obsidian"), EnumRuneType.EARTH.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(new OreIngredient("blockLapis"), EnumRuneType.WATER.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.MAGMA_CREAM), EnumRuneType.FIRE.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(Items.GHAST_TEAR), EnumRuneType.AIR.getScribeStack(), EnumAltarTier.THREE.ordinal(), 1000, 5, 5);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.LAVA_CRYSTAL), new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL), EnumAltarTier.THREE.ordinal(), 10000, 20, 10);
|
||||
|
||||
// FOUR
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.BLOOD_SHARD), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER), EnumAltarTier.FOUR.ordinal(), 25000, 30, 50);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), EnumAltarTier.FOUR.ordinal(), 15000, 20, 20);
|
||||
registrar.addBloodAltar(new OreIngredient("blockCoal"), EnumRuneType.DUSK.getScribeStack(), EnumAltarTier.FOUR.ordinal(), 2000, 20, 10);
|
||||
registrar.addBloodAltar(new OreIngredient("enderpearl"), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS), EnumAltarTier.FOUR.ordinal(), 2000, 10, 10);
|
||||
registrar.addBloodAltar(Ingredient.fromItem(RegistrarBloodMagicItems.TELEPOSITION_FOCUS), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS, 1, 1), EnumAltarTier.FOUR.ordinal(), 10000, 20, 10);
|
||||
|
||||
// FIVE
|
||||
registrar.addBloodAltar(new OreIngredient("netherstar"), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_ARCHMAGE), EnumAltarTier.FIVE.ordinal(), 80000, 50, 100);
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3)), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 4), EnumAltarTier.FIVE.ordinal(), 30000, 40, 100);
|
||||
|
||||
// SIX
|
||||
registrar.addBloodAltar(Ingredient.fromStacks(new ItemStack(RegistrarBloodMagicBlocks.DECORATIVE_BRICK, 1, 2)), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_TRANSCENDENT), EnumAltarTier.SIX.ordinal(), 200000, 100, 200);
|
||||
registrar.addBloodAltar(new OreIngredient("glowstone"), EnumRuneType.DAWN.getScribeStack(), EnumAltarTier.SIX.ordinal(), 200000, 100, 200);
|
||||
}
|
||||
|
||||
public static void registerAlchemyTableRecipes(IBloodMagicRecipeRegistrar registrar) {
|
||||
|
||||
}
|
||||
|
||||
public static void registerTartaricForgeRecipes(BloodMagicRecipeRegistrar registrar) {
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), 1, 1, "dustRedstone", "ingotGold", "blockGlass", "dyeBlue");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), 60, 20, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), "gemDiamond", "blockRedstone", "blockLapis");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), 240, 50, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "gemDiamond", "blockGold", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), 1000, 100, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 4), 4000, 500, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), Items.NETHER_STAR);
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SWORD));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_AXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_AXE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_PICKAXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_PICKAXE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SHOVEL), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SHOVEL));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_BOW), 70, 0, new ItemStack(Items.BOW), new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "string", "string");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), 0, 0, "dustRedstone", "dyeWhite", "gunpowder", Items.COAL);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_WATER), 10, 3, new ItemStack(Items.SUGAR), new ItemStack(Items.WATER_BUCKET), new ItemStack(Items.WATER_BUCKET));
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_LAVA), 32, 10, Items.LAVA_BUCKET, "dustRedstone", "cobblestone", "blockCoal");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_VOID), 64, 10, Items.BUCKET, "string", "string", "gunpowder");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_GROWTH), 128, 20, "treeSapling", "treeSapling", "sugarcane", Items.SUGAR);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_AIR), 128, 20, Items.GHAST_TEAR, "feather", "feather");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_SIGHT), 64, 0, RegistrarBloodMagicItems.SIGIL_DIVINATION, "blockGlass", "blockGlass", "dustGlowstone");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_HOLDING), 64, 20, "chestWood", "leather", "string", "string");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_FASTMINER), 128, 10, Items.IRON_PICKAXE, Items.IRON_AXE, Items.IRON_SHOVEL, Items.GUNPOWDER);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_AFFINITY), 300, 30, RegistrarBloodMagicItems.SIGIL_WATER, RegistrarBloodMagicItems.SIGIL_AIR, RegistrarBloodMagicItems.SIGIL_LAVA, Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_SUPPRESSION), 500, 50, RegistrarBloodMagicBlocks.TELEPOSER, Items.WATER_BUCKET, Items.LAVA_BUCKET, Items.BLAZE_ROD);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_BINDING), 400, 10, "dustGlowstone", "dustRedstone", "nuggetGold", Items.GUNPOWDER);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_BLOODLIGHT), 300, 10, "glowstone", Blocks.TORCH, "dustRedstone", "dustRedstone");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_MAGNETISM), 600, 10, "string", "ingotGold", "blockIron", "ingotGold");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_HASTE), 1400, 100, Items.COOKIE, Items.SUGAR, Items.COOKIE, "stone");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_BRIDGE), 600, 50, Blocks.SOUL_SAND, Blocks.SOUL_SAND, "stone", Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_SEVERANCE), 800, 70, Items.ENDER_EYE, Items.ENDER_PEARL, "ingotGold", "ingotGold");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_COMPRESSION), 2000, 200, "blockIron", "blockGold", Blocks.OBSIDIAN, "cobblestone");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_TELEPOSITION), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "glowstone", "blockRedstone", "ingotGold");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_TRANSPOSITION), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "gemDiamond", Items.ENDER_PEARL, Blocks.OBSIDIAN);
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_CLAW), 800, 120, Items.FLINT, Items.FLINT, ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC));
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_BOUNCE), 200, 20, Blocks.SLIME_BLOCK, Blocks.SLIME_BLOCK, Items.LEATHER, "string");
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.REAGENT_FROST), 80, 10, Blocks.ICE, Items.SNOWBALL, Items.SNOWBALL, "dustRedstone");
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.SENTIENT_ARMOUR_GEM), 240, 150, Items.DIAMOND_CHESTPLATE, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), Blocks.IRON_BLOCK, Blocks.OBSIDIAN);
|
||||
|
||||
registrar.addTartaricForge(ItemComponent.getStack(ItemComponent.COMPONENT_FRAME_PART), 400, 10, "blockGlass", "stone", new ItemStack(RegistrarBloodMagicItems.SLATE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.NODE_ROUTER), 400, 5, "stickWood", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), "gemLapis", "gemLapis");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE), 400, 5, "dustGlowstone", "dustRedstone", "blockGlass", "stone");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotIron", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotGold", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE), 400, 200, "blockIron", "gemDiamond", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 0), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 1), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 2), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 3), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL));
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 4), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST));
|
||||
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE), 400, 100, Items.CAULDRON, "stone", "gemLapis", "gemDiamond");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON), 400, 50, "blockIron", "stone", "gemLapis", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER), 500, 100, RegistrarBloodMagicBlocks.SOUL_FORGE, "stone", "gemLapis", "blockGlass");
|
||||
registrar.addTartaricForge(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE), 400, 50, "ingotGold", "dustRedstone", "blockGlass", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package WayofTime.bloodmagic.core.recipe;
|
||||
|
||||
public class IngredientSoulGem {
|
||||
}
|
|
@ -3,7 +3,6 @@ package WayofTime.bloodmagic.registry;
|
|||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.alchemyArray.*;
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.api.compress.CompressionRegistry;
|
||||
import WayofTime.bloodmagic.api.iface.ISigil;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
|
@ -46,7 +45,6 @@ import net.minecraft.potion.PotionEffect;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
@ -207,46 +205,6 @@ public class ModRecipes {
|
|||
}
|
||||
|
||||
public static void addAltarRecipes() {
|
||||
// ONE
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK), EnumAltarTier.ONE, RegistrarBloodMagic.ORB_WEAK.getCapacity(), 2, 1);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.DIAMOND), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK), EnumAltarTier.ONE, 2000, 2, 1));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.STONE), new ItemStack(RegistrarBloodMagicItems.SLATE), EnumAltarTier.ONE, 1000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.BUCKET), new ItemStack(ForgeModContainer.getInstance().universalBucket), EnumAltarTier.ONE, 1000, 5, 0));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.BOOK), new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK), EnumAltarTier.ONE, 1000, 20, 0));
|
||||
|
||||
// TWO
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE), EnumAltarTier.TWO, RegistrarBloodMagic.ORB_APPRENTICE.getCapacity(), 5, 5);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE), EnumAltarTier.TWO, 5000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.SLATE), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), EnumAltarTier.TWO, 2000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.IRON_SWORD), new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE), EnumAltarTier.TWO, 3000, 5, 5));
|
||||
|
||||
// THREE
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN), EnumAltarTier.THREE, RegistrarBloodMagic.ORB_MAGICIAN.getCapacity(), 15, 15);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.GOLD_BLOCK), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN), EnumAltarTier.THREE, 25000, 20, 20));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2), EnumAltarTier.THREE, 5000, 15, 10));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.OBSIDIAN), EnumRuneType.EARTH.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.LAPIS_BLOCK), EnumRuneType.WATER.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.MAGMA_CREAM), EnumRuneType.FIRE.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.GHAST_TEAR), EnumRuneType.AIR.getScribeStack(), EnumAltarTier.THREE, 1000, 5, 5));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.LAVA_CRYSTAL), new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL), EnumAltarTier.THREE, 10000, 20, 10));
|
||||
|
||||
// FOUR
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER), EnumAltarTier.FOUR, RegistrarBloodMagic.ORB_MASTER.getCapacity(), 25, 25);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER), EnumAltarTier.FOUR, 25000, 30, 50));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), EnumAltarTier.FOUR, 15000, 20, 20));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.COAL_BLOCK), EnumRuneType.DUSK.getScribeStack(), EnumAltarTier.FOUR, 2000, 20, 10));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.ENDER_PEARL), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS), EnumAltarTier.FOUR, 2000, 10, 10));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS), new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS, 1, 1), EnumAltarTier.FOUR, 10000, 20, 10));
|
||||
|
||||
// FIVE
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_ARCHMAGE), EnumAltarTier.FIVE, RegistrarBloodMagic.ORB_ARCHMAGE.getCapacity(), 50, 50);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Items.NETHER_STAR), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_ARCHMAGE), EnumAltarTier.FIVE, 80000, 50, 100));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 4), EnumAltarTier.FIVE, 30000, 40, 100));
|
||||
|
||||
// SIX
|
||||
AltarRecipeRegistry.registerFillRecipe(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_TRANSCENDENT), EnumAltarTier.SIX, RegistrarBloodMagic.ORB_TRANSCENDENT.getCapacity(), 50, 50);
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(RegistrarBloodMagicBlocks.DECORATIVE_BRICK, 1, 2), OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_TRANSCENDENT), EnumAltarTier.SIX, 200000, 100, 200));
|
||||
AltarRecipeRegistry.registerRecipe(new AltarRecipeRegistry.AltarRecipe(new ItemStack(Blocks.GLOWSTONE), EnumRuneType.DAWN.getScribeStack(), EnumAltarTier.SIX, 200000, 100, 200));
|
||||
}
|
||||
|
||||
public static void addAlchemyArrayRecipes() {
|
||||
|
@ -308,59 +266,6 @@ public class ModRecipes {
|
|||
}
|
||||
|
||||
public static void addSoulForgeRecipes() {
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), 1, 1, "dustRedstone", "ingotGold", "blockGlass", "dyeBlue");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), 60, 20, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), "gemDiamond", "blockRedstone", "blockLapis");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), 240, 50, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "gemDiamond", "blockGold", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), 1000, 100, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 2), new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 3), new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 4), 4000, 500, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), Items.NETHER_STAR);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SWORD));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_AXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_AXE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_PICKAXE), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_PICKAXE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SHOVEL), 0, 0, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM), new ItemStack(Items.IRON_SHOVEL));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_BOW), 70, 0, new ItemStack(Items.BOW), new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), "string", "string");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), 0, 0, "dustRedstone", "dyeWhite", "gunpowder", Items.COAL);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_WATER), 10, 3, new ItemStack(Items.SUGAR), new ItemStack(Items.WATER_BUCKET), new ItemStack(Items.WATER_BUCKET));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_LAVA), 32, 10, Items.LAVA_BUCKET, "dustRedstone", "cobblestone", "blockCoal");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_VOID), 64, 10, Items.BUCKET, "string", "string", "gunpowder");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_GROWTH), 128, 20, "treeSapling", "treeSapling", "sugarcane", Items.SUGAR);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_AIR), 128, 20, Items.GHAST_TEAR, "feather", "feather");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_SIGHT), 64, 0, RegistrarBloodMagicItems.SIGIL_DIVINATION, "blockGlass", "blockGlass", "dustGlowstone");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_HOLDING), 64, 20, "chestWood", "leather", "string", "string");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_FASTMINER), 128, 10, Items.IRON_PICKAXE, Items.IRON_AXE, Items.IRON_SHOVEL, Items.GUNPOWDER);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_AFFINITY), 300, 30, RegistrarBloodMagicItems.SIGIL_WATER, RegistrarBloodMagicItems.SIGIL_AIR, RegistrarBloodMagicItems.SIGIL_LAVA, Blocks.OBSIDIAN);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_SUPPRESSION), 500, 50, RegistrarBloodMagicBlocks.TELEPOSER, Items.WATER_BUCKET, Items.LAVA_BUCKET, Items.BLAZE_ROD);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_BINDING), 400, 10, "dustGlowstone", "dustRedstone", "nuggetGold", Items.GUNPOWDER);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_BLOODLIGHT), 300, 10, "glowstone", Blocks.TORCH, "dustRedstone", "dustRedstone");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_MAGNETISM), 600, 10, "string", "ingotGold", "blockIron", "ingotGold");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_HASTE), 1400, 100, Items.COOKIE, Items.SUGAR, Items.COOKIE, "stone");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_BRIDGE), 600, 50, Blocks.SOUL_SAND, Blocks.SOUL_SAND, "stone", Blocks.OBSIDIAN);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_SEVERANCE), 800, 70, Items.ENDER_EYE, Items.ENDER_PEARL, "ingotGold", "ingotGold");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_COMPRESSION), 2000, 200, "blockIron", "blockGold", Blocks.OBSIDIAN, "cobblestone");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_TELEPOSITION), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "glowstone", "blockRedstone", "ingotGold");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_TRANSPOSITION), 1500, 200, RegistrarBloodMagicBlocks.TELEPOSER, "gemDiamond", Items.ENDER_PEARL, Blocks.OBSIDIAN);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_CLAW), 800, 120, Items.FLINT, Items.FLINT, ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_BOUNCE), 200, 20, Blocks.SLIME_BLOCK, Blocks.SLIME_BLOCK, Items.LEATHER, "string");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_FROST), 80, 10, Blocks.ICE, Items.SNOWBALL, Items.SNOWBALL, "dustRedstone");
|
||||
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.SENTIENT_ARMOUR_GEM), 240, 150, Items.DIAMOND_CHESTPLATE, new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), Blocks.IRON_BLOCK, Blocks.OBSIDIAN);
|
||||
|
||||
TartaricForgeRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.COMPONENT_FRAME_PART), 400, 10, "blockGlass", "stone", new ItemStack(RegistrarBloodMagicItems.SLATE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.NODE_ROUTER), 400, 5, "stickWood", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 1), "gemLapis", "gemLapis");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE), 400, 5, "dustGlowstone", "dustRedstone", "blockGlass", "stone");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotIron", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE), 400, 25, "dustGlowstone", "dustRedstone", "ingotGold", new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE), 400, 200, "blockIron", "gemDiamond", new ItemStack(RegistrarBloodMagicItems.SLATE, 1, 2));
|
||||
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 0), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 1), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 2), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 3), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL));
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL, 1, 4), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST));
|
||||
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE), 400, 100, Items.CAULDRON, "stone", "gemLapis", "gemDiamond");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON), 400, 50, "blockIron", "stone", "gemLapis", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER), 500, 100, RegistrarBloodMagicBlocks.SOUL_FORGE, "stone", "gemLapis", "blockGlass");
|
||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE), 400, 50, "ingotGold", "dustRedstone", "blockGlass", RegistrarBloodMagicItems.ITEM_DEMON_CRYSTAL);
|
||||
}
|
||||
|
||||
public static void addAlchemyTableRecipes() {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.bloodmagic.tile;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWill;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWillConduit;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
||||
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api_impl.recipe.RecipeTartaricForge;
|
||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -79,14 +79,15 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil
|
|||
}
|
||||
}
|
||||
|
||||
TartaricForgeRecipe recipe = TartaricForgeRecipeRegistry.getMatchingRecipe(inputList, getWorld(), getPos());
|
||||
RecipeTartaricForge recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForge(inputList);
|
||||
// TartaricForgeRecipe recipe = TartaricForgeRecipeRegistry.getMatchingRecipe(inputList, getWorld(), getPos());
|
||||
if (recipe != null && (soulsInGem >= recipe.getMinimumSouls() || burnTime > 0)) {
|
||||
if (canCraft(recipe)) {
|
||||
burnTime++;
|
||||
|
||||
if (burnTime == ticksRequired) {
|
||||
if (!getWorld().isRemote) {
|
||||
double requiredSouls = recipe.getSoulsDrained();
|
||||
double requiredSouls = recipe.getSoulDrain();
|
||||
if (requiredSouls > 0) {
|
||||
if (!getWorld().isRemote && soulsInGem >= recipe.getMinimumSouls()) {
|
||||
consumeSouls(EnumDemonWillType.DEFAULT, requiredSouls);
|
||||
|
@ -113,12 +114,12 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil
|
|||
return ((double) burnTime) / ticksRequired;
|
||||
}
|
||||
|
||||
private boolean canCraft(TartaricForgeRecipe recipe) {
|
||||
private boolean canCraft(RecipeTartaricForge recipe) {
|
||||
if (recipe == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack outputStack = recipe.getRecipeOutput();
|
||||
ItemStack outputStack = recipe.getOutput();
|
||||
ItemStack currentOutputStack = getStackInSlot(outputSlot);
|
||||
if (outputStack.isEmpty())
|
||||
return false;
|
||||
|
@ -131,9 +132,9 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil
|
|||
|
||||
}
|
||||
|
||||
public void craftItem(TartaricForgeRecipe recipe) {
|
||||
public void craftItem(RecipeTartaricForge recipe) {
|
||||
if (this.canCraft(recipe)) {
|
||||
ItemStack outputStack = recipe.getRecipeOutput();
|
||||
ItemStack outputStack = recipe.getOutput();
|
||||
ItemStack currentOutputStack = getStackInSlot(outputSlot);
|
||||
|
||||
if (currentOutputStack.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue