From c618f27a87a35a3f68adee0dc4796379e3fae6f6 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Tue, 26 Jul 2016 19:05:48 -0400 Subject: [PATCH] A bunch of back-end for Potions, as well as a minor glitch fix on the Demon Crystals when broken in incorrect manners. --- .../WayofTime/bloodmagic/api/Constants.java | 7 +- .../bloodmagic/block/BlockDemonCrystal.java | 4 + .../bloodmagic/potion/BMPotionUtils.java | 92 +++++++++ .../potion/item/ItemPotionFlask.java | 112 +++++++++++ .../AlchemyTablePotionAugmentRecipe.java | 114 ++++++++++++ .../AlchemyTablePotionRecipe.java | 174 ++++++++++++++++++ .../bloodmagic/registry/ModItems.java | 5 + .../bloodmagic/registry/ModRecipes.java | 13 ++ .../blockstates/item/ItemPotionFlask.json | 16 ++ .../assets/bloodmagic/lang/en_US.lang | 1 + .../bloodmagic/textures/items/PotionFlask.png | Bin 0 -> 325 bytes .../textures/gui/alchemyArrayCrafting.png | Bin 2510 -> 2464 bytes 12 files changed, 537 insertions(+), 1 deletion(-) create mode 100644 src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java create mode 100644 src/main/java/WayofTime/bloodmagic/potion/item/ItemPotionFlask.java create mode 100644 src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java create mode 100644 src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java create mode 100644 src/main/resources/assets/bloodmagic/blockstates/item/ItemPotionFlask.json create mode 100644 src/main/resources/assets/bloodmagic/textures/items/PotionFlask.png diff --git a/src/main/java/WayofTime/bloodmagic/api/Constants.java b/src/main/java/WayofTime/bloodmagic/api/Constants.java index c342c75e..9cf6d666 100644 --- a/src/main/java/WayofTime/bloodmagic/api/Constants.java +++ b/src/main/java/WayofTime/bloodmagic/api/Constants.java @@ -121,6 +121,10 @@ public class Constants public static final String MOST_SIG = "mostSig"; public static final String LEAST_SIG = "leastSig"; public static final String COLOR = "color"; + + public static final String POTION_AUGMENT_LENGHT = "length:"; + public static final String POTION_AUGMENT_STRENGTH = "strength:"; + public static final String POTION_IMPURITY = "impurity"; } public static class Mod @@ -239,7 +243,8 @@ public class Constants SANGUINE_BOOK("ItemSanguineBook"), SIGIL_HOLDING("ItemSigilHolding"), ARMOUR_POINTS_UPGRADE("ItemLivingArmourPointsUpgrade"), - DEMON_WILL_GAUGE("ItemDemonWillGauge"), ; + DEMON_WILL_GAUGE("ItemDemonWillGauge"), + POTION_FLASK("ItemPotionFlask"), ; @Getter private final String regName; diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java index 44aaea2b..ca51cdc3 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java @@ -77,6 +77,10 @@ public class BlockDemonCrystal extends BlockContainer @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { + if (world.getTileEntity(pos) == null) + { + return state; + } TileDemonCrystal tile = (TileDemonCrystal) world.getTileEntity(pos); return state.withProperty(AGE, tile.getCrystalCountForRender()).withProperty(ATTACHED, tile.getPlacement()); } diff --git a/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java new file mode 100644 index 00000000..8eaf353a --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java @@ -0,0 +1,92 @@ +package WayofTime.bloodmagic.potion; + +import java.util.Collection; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import WayofTime.bloodmagic.api.Constants; +import WayofTime.bloodmagic.api.util.helper.NBTHelper; +import WayofTime.bloodmagic.recipe.alchemyTable.AlchemyTablePotionAugmentRecipe; + +import com.google.common.base.Objects; + +public class BMPotionUtils +{ + public static double getLengthAugment(ItemStack flaskStack, Potion potion) + { + NBTHelper.checkNBT(flaskStack); + NBTTagCompound tag = flaskStack.getTagCompound(); + + return tag.getDouble(Constants.NBT.POTION_AUGMENT_LENGHT + potion.getName()); + } + + public static void setLengthAugment(ItemStack flaskStack, Potion potion, double value) + { + if (value < 0) + { + value = 0; + } + + NBTHelper.checkNBT(flaskStack); + NBTTagCompound tag = flaskStack.getTagCompound(); + + tag.setDouble(Constants.NBT.POTION_AUGMENT_LENGHT + potion.getName(), value); + } + + public static int getAugmentedLength(int originalLength, double lengthAugment, double powerAugment) + { + return Math.max((int) (originalLength * (Math.pow(8f / 3f, lengthAugment) * Math.pow(0.5, powerAugment))), 1); + } + + /** + * Copied from PotionUtils + * + * @param stack + * @param effects + * @return + */ + public static ItemStack setEffects(ItemStack stack, Collection effects) + { + if (effects.isEmpty()) + { + return stack; + } else + { + NBTTagCompound nbttagcompound = (NBTTagCompound) Objects.firstNonNull(stack.getTagCompound(), new NBTTagCompound()); + NBTTagList nbttaglist = new NBTTagList(); + + for (PotionEffect potioneffect : effects) + { + nbttaglist.appendTag(potioneffect.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + + nbttagcompound.setTag("CustomPotionEffects", nbttaglist); + stack.setTagCompound(nbttagcompound); + return stack; + } + } + + public static AlchemyTablePotionAugmentRecipe getLengthAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect, double lengthAugment) + { + return new AlchemyTablePotionAugmentRecipe(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect, lengthAugment, 0); + } + + public static AlchemyTablePotionAugmentRecipe getPowerAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect, int powerAugment) + { + return new AlchemyTablePotionAugmentRecipe(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect, 0, powerAugment); + } + + public static AlchemyTablePotionAugmentRecipe getLengthAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment) + { + return new AlchemyTablePotionAugmentRecipe(lpDrained, ticksRequired, tierRequired, inputItem, baseEffect, lengthAugment, 0); + } + + public static AlchemyTablePotionAugmentRecipe getPowerAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, int powerAugment) + { + return new AlchemyTablePotionAugmentRecipe(lpDrained, ticksRequired, tierRequired, inputItem, baseEffect, 0, powerAugment); + } +} diff --git a/src/main/java/WayofTime/bloodmagic/potion/item/ItemPotionFlask.java b/src/main/java/WayofTime/bloodmagic/potion/item/ItemPotionFlask.java new file mode 100644 index 00000000..9deec22f --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/potion/item/ItemPotionFlask.java @@ -0,0 +1,112 @@ +package WayofTime.bloodmagic.potion.item; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionUtils; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.api.Constants; +import WayofTime.bloodmagic.client.IVariantProvider; + +public class ItemPotionFlask extends Item implements IVariantProvider +{ + public ItemPotionFlask() + { + setUnlocalizedName(Constants.Mod.MODID + ".potionFlask"); + setCreativeTab(BloodMagic.tabBloodMagic); + setMaxStackSize(1); + setMaxDamage(8); + } + + @Override + public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase entityLiving) + { + EntityPlayer player = entityLiving instanceof EntityPlayer ? (EntityPlayer) entityLiving : null; + + int remainingUses = stack.getMaxDamage() - stack.getItemDamage(); + if (remainingUses <= 0) + { + return stack; + } + + if (player == null || !player.capabilities.isCreativeMode) + { + stack.setItemDamage(stack.getItemDamage() + 1); + } + + if (!world.isRemote) + { + for (PotionEffect potioneffect : PotionUtils.getEffectsFromStack(stack)) + { + entityLiving.addPotionEffect(new PotionEffect(potioneffect)); + } + } + + return stack; + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) + { + return 32; + } + + @Override + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.DRINK; + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + { + int remainingUses = stack.getMaxDamage() - stack.getItemDamage(); + if (remainingUses <= 0) + { + return new ActionResult(EnumActionResult.PASS, stack); + } + player.setActiveHand(hand); + return new ActionResult(EnumActionResult.SUCCESS, stack); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) + { + PotionUtils.addPotionTooltip(stack, tooltip, 1.0F); + } + +// @Override +// @SideOnly(Side.CLIENT) +// public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) +// { +// for (PotionType potiontype : PotionType.REGISTRY) +// { +// subItems.add(PotionUtils.addPotionToItemStack(new ItemStack(itemIn), potiontype)); +// } +// } + + @Override + public List> getVariants() + { + List> ret = new ArrayList>(); + ret.add(new ImmutablePair(0, "type=normal")); + return ret; + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java new file mode 100644 index 00000000..0597060c --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java @@ -0,0 +1,114 @@ +package WayofTime.bloodmagic.recipe.alchemyTable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionUtils; +import WayofTime.bloodmagic.potion.BMPotionUtils; +import WayofTime.bloodmagic.registry.ModItems; + +public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe +{ + protected double lengthAugment = 0; + protected int powerAugment = 0; + protected Potion wantedPotion; + + public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect, double lengthAugment, int powerAugment) + { + super(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect); + + ArrayList recipe = new ArrayList(); + for (ItemStack stack : inputItems) + { + recipe.add(stack); + } + recipe.add(getAugmentedPotionFlask(baseEffect)); + + this.input = recipe; + + this.wantedPotion = baseEffect.getPotion(); + this.lengthAugment = lengthAugment; + } + + public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment, int powerAugment) + { + this(lpDrained, ticksRequired, tierRequired, Arrays.asList(inputItem), baseEffect, lengthAugment, powerAugment); + } + + @Override + public boolean isPotionFlaskValidInput(ItemStack stack) + { + List effectList = PotionUtils.getEffectsFromStack(stack); + for (PotionEffect eff : effectList) + { + if (eff.getPotion() == wantedPotion) + { + double currentAugment = BMPotionUtils.getLengthAugment(stack, wantedPotion); + + return currentAugment < lengthAugment || eff.getAmplifier() < powerAugment; + } + } + + return false; + } + + @Override + public ItemStack getModifiedFlaskForInput(ItemStack inputStack) + { + if (inputStack == null) + { + ItemStack outputStack = new ItemStack(ModItems.potionFlask); + + List effectList = new ArrayList(); + int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), lengthAugment, powerAugment - baseEffect.getAmplifier()); + effectList.add(new PotionEffect(wantedPotion, potionLength, baseEffect.getAmplifier())); + + BMPotionUtils.setEffects(outputStack, effectList); + + return outputStack; + } + + ItemStack outputStack = inputStack.copy(); + + List effectList = PotionUtils.getEffectsFromStack(outputStack); + List newEffectList = new ArrayList(); + + Iterator effectIterator = effectList.iterator(); + while (effectIterator.hasNext()) + { + PotionEffect effect = effectIterator.next(); + if (effect.getPotion() == wantedPotion) + { + double currentLengthAugment = Math.max(lengthAugment, BMPotionUtils.getLengthAugment(outputStack, wantedPotion)); + int currentPowerAugment = Math.max(powerAugment, effect.getAmplifier()); + int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), currentLengthAugment, currentPowerAugment); + newEffectList.add(new PotionEffect(wantedPotion, potionLength, currentPowerAugment)); + BMPotionUtils.setLengthAugment(outputStack, wantedPotion, currentLengthAugment); + } else + { + newEffectList.add(effect); + } + } + + BMPotionUtils.setEffects(outputStack, newEffectList); + + return outputStack; + } + + public static ItemStack getAugmentedPotionFlask(PotionEffect baseEffect) + { + ItemStack outputStack = new ItemStack(ModItems.potionFlask); + + List effectList = new ArrayList(); + effectList.add(baseEffect); + + BMPotionUtils.setEffects(outputStack, effectList); + + return outputStack; + } +} diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java new file mode 100644 index 00000000..505d1fb5 --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java @@ -0,0 +1,174 @@ +package WayofTime.bloodmagic.recipe.alchemyTable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionUtils; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe; +import WayofTime.bloodmagic.registry.ModItems; + +public class AlchemyTablePotionRecipe extends AlchemyTableRecipe +{ + public static final ItemStack basePotionFlaskStack = new ItemStack(ModItems.potionFlask, 1, OreDictionary.WILDCARD_VALUE); + protected PotionEffect baseEffect; + + public static final int temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember = 3; + + protected double baseAddedImpurity = 5; + + public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect) + { + super(basePotionFlaskStack, lpDrained, ticksRequired, tierRequired); + + ArrayList recipe = new ArrayList(); + for (ItemStack stack : inputItems) + { + recipe.add(stack); + } + recipe.add(basePotionFlaskStack); + + this.input = recipe; + this.baseEffect = baseEffect; + } + + public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect) + { + this(lpDrained, ticksRequired, tierRequired, Arrays.asList(inputItem), baseEffect); + } + + @Override + public ItemStack getRecipeOutput(List inputList) + { + int flaskLocation = -1; + for (int x = 0; x < inputList.size(); x++) + { + ItemStack slot = inputList.get(x); + + if (slot != null) + { + boolean match = slot.getItem() == ModItems.potionFlask; + + if (match) + { + flaskLocation = x; + continue; + } + } + } + + if (flaskLocation != -1) + { + return getModifiedFlaskForInput(inputList.get(flaskLocation)); + } + + return getModifiedFlaskForInput(null); + } + + @Override + public boolean matches(List checkedList, World world, BlockPos pos) + { + ArrayList required = new ArrayList(input); + + for (int x = 0; x < checkedList.size(); x++) + { + ItemStack slot = checkedList.get(x); + + if (slot != null) + { + boolean inRecipe = false; + Iterator req = required.iterator(); + + while (req.hasNext()) + { + boolean match = false; + + Object next = req.next(); + + if (next instanceof ItemStack) + { + match = OreDictionary.itemMatches((ItemStack) next, slot, false); + } else if (next instanceof List) + { + Iterator itr = ((List) next).iterator(); + while (itr.hasNext() && !match) + { + match = OreDictionary.itemMatches(itr.next(), slot, false); + } + } + + if (match) + { + if (next instanceof ItemStack && ((ItemStack) next).getItem() == ModItems.potionFlask) + { + if (!isPotionFlaskValidInput(slot)) + { + break; + } + } + + inRecipe = true; + required.remove(next); + break; + } + } + + if (!inRecipe) + { + return false; + } + } + } + + return required.isEmpty(); + } + + public boolean isPotionFlaskValidInput(ItemStack stack) + { + List effectList = PotionUtils.getEffectsFromStack(stack); + if (effectList.size() + 1 >= temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember) + { + return false; + } + + for (PotionEffect eff : effectList) + { + if (eff.getPotion() == baseEffect.getPotion()) + { + return false; + } + } + + return true; + } + + public ItemStack getModifiedFlaskForInput(ItemStack inputStack) + { + if (inputStack == null) + { + ItemStack outputStack = new ItemStack(ModItems.potionFlask); + + List effectList = new ArrayList(); + effectList.add(baseEffect); + + PotionUtils.appendEffects(outputStack, effectList); + + return outputStack; + } + + ItemStack outputStack = inputStack.copy(); + + List effectList = new ArrayList(); + effectList.add(baseEffect); + + PotionUtils.appendEffects(outputStack, effectList); + + return outputStack; + } +} diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModItems.java b/src/main/java/WayofTime/bloodmagic/registry/ModItems.java index 2122182e..461e654e 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModItems.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModItems.java @@ -78,6 +78,7 @@ import WayofTime.bloodmagic.item.soul.ItemSentientShovel; import WayofTime.bloodmagic.item.soul.ItemSentientSword; import WayofTime.bloodmagic.item.soul.ItemSoulGem; import WayofTime.bloodmagic.item.soul.ItemSoulSnare; +import WayofTime.bloodmagic.potion.item.ItemPotionFlask; import WayofTime.bloodmagic.util.helper.InventoryRenderHelper; public class ModItems @@ -174,6 +175,8 @@ public class ModItems public static Item demonWillGauge; + public static Item potionFlask; + public static Item.ToolMaterial boundToolMaterial = EnumHelper.addToolMaterial("BoundToolMaterial", 4, 1, 10, 8, 50); public static Item.ToolMaterial soulToolMaterial = EnumHelper.addToolMaterial("SoulToolMaterial", 4, 520, 7, 8, 50); @@ -278,6 +281,8 @@ public class ModItems itemPointsUpgrade = registerItem(new ItemLivingArmourPointsUpgrade(), Constants.BloodMagicItem.ARMOUR_POINTS_UPGRADE.getRegName()); demonWillGauge = registerItem(new ItemDemonWillGauge(), Constants.BloodMagicItem.DEMON_WILL_GAUGE.getRegName()); + + potionFlask = registerItem(new ItemPotionFlask(), Constants.BloodMagicItem.POTION_FLASK.getRegName()); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java index 65da3a3b..dc32586f 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java @@ -5,8 +5,10 @@ import java.util.List; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeModContainer; import net.minecraftforge.fml.common.registry.GameRegistry; @@ -45,7 +47,9 @@ import WayofTime.bloodmagic.item.ItemDemonCrystal; import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid; import WayofTime.bloodmagic.item.alchemy.ItemLivingArmourPointsUpgrade; import WayofTime.bloodmagic.item.soul.ItemSoulGem; +import WayofTime.bloodmagic.potion.BMPotionUtils; import WayofTime.bloodmagic.recipe.alchemyTable.AlchemyTableDyeableRecipe; +import WayofTime.bloodmagic.recipe.alchemyTable.AlchemyTablePotionRecipe; import WayofTime.bloodmagic.util.Utils; import com.google.common.base.Stopwatch; @@ -67,6 +71,7 @@ public class ModRecipes addSoulForgeRecipes(); addAlchemyTableRecipes(); addOreDoublingAlchemyRecipes(); + addPotionRecipes(); } public static void initOreDict() @@ -352,6 +357,8 @@ public class ModRecipes AlchemyTableRecipeRegistry.registerRecipe(ItemLivingArmourPointsUpgrade.getStack(ItemLivingArmourPointsUpgrade.DRAFT_ANGELUS), 20000, 400, 3, ItemComponent.getStack(ItemComponent.NEURO_TOXIN), ItemComponent.getStack(ItemComponent.ANTISEPTIC), ItemComponent.getStack(ItemComponent.SAND_GOLD), Items.FERMENTED_SPIDER_EYE, new ItemStack(ModItems.bloodShard, 1, 0), Items.GHAST_TEAR); AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableDyeableRecipe(0, 100, 0, new ItemStack(ModItems.sigilHolding))); + + AlchemyTableRecipeRegistry.registerRecipe(new ItemStack(ModItems.potionFlask), 1000, 200, 2, new ItemStack(Items.POTIONITEM), Items.NETHER_WART, Items.REDSTONE, Items.GLOWSTONE_DUST); } public static void addOreDoublingAlchemyRecipes() @@ -374,4 +381,10 @@ public class ModRecipes } } } + + public static void addPotionRecipes() + { + AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTablePotionRecipe(0, 100, 0, new ItemStack(Items.BLAZE_POWDER), new PotionEffect(MobEffects.STRENGTH, 3600, 0))); + AlchemyTableRecipeRegistry.registerRecipe(BMPotionUtils.getLengthAugmentRecipe(0, 100, 0, new ItemStack(Items.BLAZE_ROD), new PotionEffect(MobEffects.STRENGTH, 3600, 0), 1)); + } } diff --git a/src/main/resources/assets/bloodmagic/blockstates/item/ItemPotionFlask.json b/src/main/resources/assets/bloodmagic/blockstates/item/ItemPotionFlask.json new file mode 100644 index 00000000..35baf151 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/blockstates/item/ItemPotionFlask.json @@ -0,0 +1,16 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item" + }, + "variants": { + "type": { + "normal": { + "textures": { + "layer0": "bloodmagic:items/PotionFlask" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/lang/en_US.lang b/src/main/resources/assets/bloodmagic/lang/en_US.lang index 66c4951d..888adaab 100644 --- a/src/main/resources/assets/bloodmagic/lang/en_US.lang +++ b/src/main/resources/assets/bloodmagic/lang/en_US.lang @@ -175,6 +175,7 @@ item.BloodMagic.sanguineBook.name=Inspectoris Scandalum item.BloodMagic.livingPointUpgrade.draftAngelus.name=Draft of Angelus item.BloodMagic.willGauge.name=Demon Will Aura Gauge +item.BloodMagic.potionFlask.name=Potion Flask # Blocks tile.BloodMagic.fluid.lifeEssence.name=Life Essence diff --git a/src/main/resources/assets/bloodmagic/textures/items/PotionFlask.png b/src/main/resources/assets/bloodmagic/textures/items/PotionFlask.png new file mode 100644 index 0000000000000000000000000000000000000000..b0d3231edabf5f48fc3a0f473efd1e0524f612cb GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#E+-Q|gUFTFb6x|5o_M-AhFF|lI@yq~$v~v7p0k-xYISGa0mu9Y3fi6OA4L54 z<{ddX`G#{zQE{q+P%~pPXVdwEQ#^EdU)b+m^8Ww*>DR@61g~Ay{J6?<-+N{Ty^Fl7 z4}0Fu4rTqa{r94@*|Ekt=RbSgQ+_l@`1zg{rF*w&o`^hCAK$mgz<0fixaE7pXfZh5ExOq{ItqicL5eghK!4n$?+mfvqhXP-%q0~(^HAt#o;+$i~KOZNKQ=en9IS!Y<-IaIxhxBT>v&#ctvZ{Jb VRw_Ao>NL>544$rjF6*2Ung9alf~o)j literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/bloodmagicguide/textures/gui/alchemyArrayCrafting.png b/src/main/resources/assets/bloodmagicguide/textures/gui/alchemyArrayCrafting.png index 2e78b0c6dbd45862a103675983936a7a419f2fd6..fc3a6eabfd31d2aced9e8ca07b3666d390f9dfcf 100644 GIT binary patch delta 2065 zcmV+s2=4dJ6QC22Q-2y3J1sWSwnhK|2`x!PK~#9!?cLpPQ|BGP@!vTy#1=PcfUPgI z-IfrbHv`e3RjgAlCaqNK+Vl_TF4n8@GIbj3-%w5JRd>h!fOXQ!4TP#lYj-iGYN$Xv z>?CcaN|hiqBoS!Cd2!AzQm09vX&WCWj{W&a2x6kclVd+$KYzzQ_#`ve-|mhqt4@7- zKC&!}iK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