Added Arcane Ashes to draw alchemy arrays.
This commit is contained in:
parent
adef7f1ce9
commit
1b9f72b494
|
@ -2,12 +2,14 @@ package WayofTime.bloodmagic.api.registry;
|
|||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffectCrafting;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||
|
@ -15,8 +17,6 @@ import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
|||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AlchemyArrayRecipeRegistry
|
||||
{
|
||||
|
||||
|
@ -29,17 +29,16 @@ public class AlchemyArrayRecipeRegistry
|
|||
* General case for creating an AlchemyArrayEffect for a given input.
|
||||
*
|
||||
* @param inputStack
|
||||
* - Input item that is used to change the Alchemy Circle into
|
||||
* the circle that you are making
|
||||
* - Input item that is used to change the Alchemy Circle into the
|
||||
* circle that you are making
|
||||
* @param catalystStack
|
||||
* - Catalyst item that, when right-clicked onto the array, will
|
||||
* cause an effect
|
||||
* - Catalyst item that, when right-clicked onto the array, will
|
||||
* cause an effect
|
||||
* @param arrayEffect
|
||||
* - The effect that will be activated once the array is
|
||||
* activated
|
||||
* - The effect that will be activated once the array is activated
|
||||
* @param circleRenderer
|
||||
* - Circle rendered when the array is passive - can be
|
||||
* substituted for a special renderer
|
||||
* - Circle rendered when the array is passive - can be substituted
|
||||
* for a special renderer
|
||||
*/
|
||||
public static void registerRecipe(ItemStack inputStack, @Nullable ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer)
|
||||
{
|
||||
|
@ -127,7 +126,7 @@ public class AlchemyArrayRecipeRegistry
|
|||
|
||||
public static AlchemyArrayRecipe getRecipeForInput(ItemStack input)
|
||||
{
|
||||
return recipes.get(input);
|
||||
return recipes.get(ItemStackWrapper.getHolder(input));
|
||||
}
|
||||
|
||||
public static AlchemyArrayEffect getAlchemyArrayEffect(ItemStack inputStack, @Nullable ItemStack catalystStack)
|
||||
|
@ -198,7 +197,7 @@ public class AlchemyArrayRecipeRegistry
|
|||
* Gets the actual AlchemyArrayEffect for the given catalyst.
|
||||
*
|
||||
* @param comparedStack
|
||||
* The catalyst that is being checked
|
||||
* The catalyst that is being checked
|
||||
* @return
|
||||
*/
|
||||
public AlchemyArrayEffect getAlchemyArrayEffectForCatalyst(@Nullable ItemStack comparedStack)
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
|
@ -19,7 +16,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
|
@ -33,6 +30,7 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".alchemyArray");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
this.setHardness(0.1f);
|
||||
this.setBlockBounds(0, 0, 0, 1, 0.1f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,12 +52,6 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0, 0, 0, 1, 0.1f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
|
@ -72,13 +64,16 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
|
||||
if (playerItem != null)
|
||||
{
|
||||
if (array.getStackInSlot(0) == null)
|
||||
if (array.getStackInSlot(0) == null && AlchemyArrayRecipeRegistry.getRecipeForInput(playerItem) != null)
|
||||
{
|
||||
Utils.insertItemToTile(array, player, 0);
|
||||
} else
|
||||
} else if (array.getStackInSlot(0) != null && AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(array.getStackInSlot(0), playerItem) != null)
|
||||
{
|
||||
Utils.insertItemToTile(array, player, 1);
|
||||
array.attemptCraft();
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
|||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
|
|
50
src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java
Normal file
50
src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ItemArcaneAshes extends Item
|
||||
{
|
||||
public ItemArcaneAshes()
|
||||
{
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".arcaneAshes");
|
||||
setMaxDamage(19); //Allows for 20 uses
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||
{
|
||||
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.arcaneAshes"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
return false;
|
||||
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
|
||||
if (world.isAirBlock(newPos))
|
||||
{
|
||||
world.setBlockState(newPos, ModBlocks.alchemyArray.getDefaultState());
|
||||
stack.damageItem(1, player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -61,7 +61,6 @@ public class ItemSigilBase extends ItemBindable implements ISigil
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||
{
|
||||
|
||||
if (StatCollector.canTranslate(tooltipBase + "desc"))
|
||||
tooltip.add(TextHelper.localizeEffect(tooltipBase + "desc"));
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@ public class ModItems
|
|||
|
||||
public static Item altarMaker;
|
||||
|
||||
public static Item arcaneAshes;
|
||||
|
||||
public static Item.ToolMaterial boundToolMaterial = EnumHelper.addToolMaterial("BoundToolMaterial", 4, 0, 12, 8, 50);
|
||||
|
||||
public static void init()
|
||||
|
@ -142,6 +144,8 @@ public class ModItems
|
|||
livingArmourBoots = registerItem(new ItemLivingArmour(3), "ItemLivingArmourBoots");
|
||||
|
||||
altarMaker = registerItem(new ItemAltarMaker());
|
||||
|
||||
arcaneAshes = registerItem(new ItemArcaneAshes());
|
||||
}
|
||||
|
||||
public static void initRenders()
|
||||
|
@ -238,6 +242,8 @@ public class ModItems
|
|||
renderHelper.itemRender(livingArmourBoots);
|
||||
|
||||
renderHelper.itemRender(altarMaker);
|
||||
|
||||
renderHelper.itemRender(arcaneAshes);
|
||||
}
|
||||
|
||||
private static Item registerItem(Item item, String name)
|
||||
|
|
|
@ -44,6 +44,7 @@ public class ModRecipes
|
|||
GameRegistry.addRecipe(new ItemStack(ModItems.ritualDiviner, 1, 1), " S ", "tdt", " S ", 'S', new ItemStack(ModItems.slate, 1, 3), 't', EnumRuneType.DUSK.getScribeStack(), 'd', new ItemStack(ModItems.ritualDiviner));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.bloodStoneBrick), "aa", "aa", 'a', new ItemStack(ModBlocks.bloodStoneBrick, 1, 1));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.bloodStoneBrick, 1, 1), Blocks.stone, ModItems.bloodShard);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.arcaneAshes), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.gunpowder), new ItemStack(Items.gunpowder), new ItemStack(Items.redstone), new ItemStack(Items.flint), new ItemStack(ModItems.slate));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.lavaCrystal), "aba", "bcb", "ded", 'a', Blocks.glass, 'b', Items.lava_bucket, 'c', OrbRegistry.getOrbStack(ModItems.orbWeak), 'd', Blocks.obsidian, 'e', Items.diamond));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(ItemComponent.getStack(ItemComponent.REAGENT_BINDING), "xox", "oSo", "xox", 'S', OrbRegistry.getOrbStack(ModItems.orbMagician), 'o', new ItemStack(Items.redstone), 'x', new ItemStack(Items.glowstone_dust)));
|
||||
|
|
|
@ -104,6 +104,8 @@ item.BloodMagic.ritualDivinernormal.name=Ritual Diviner
|
|||
item.BloodMagic.ritualDivinerdusk.name=Ritual Diviner [Dusk]
|
||||
item.BloodMagic.ritualDivinerdawn.name=Ritual Diviner [Dawn]
|
||||
|
||||
item.BloodMagic.arcaneAshes.name=Arcane Ashes
|
||||
|
||||
# Blocks
|
||||
tile.BloodMagic.fluid.lifeEssence.name=Life Essence
|
||||
|
||||
|
@ -202,6 +204,8 @@ tooltip.BloodMagic.diviner.totalRune=Total Runes: %d
|
|||
tooltip.BloodMagic.diviner.extraInfo=Press shift for extra info
|
||||
tooltip.BloodMagic.diviner.currentDirection=Current Direction: %s
|
||||
|
||||
tooltip.BloodMagic.arcaneAshes=Ashes used to draw a rudimentary circle
|
||||
|
||||
tooltip.BloodMagic.telepositionFocus.coords=Current coordinates: (%d, %d, %d)
|
||||
tooltip.BloodMagic.telepositionFocus.dimension=Dimension ID: %d
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent":"bloodmagic:item/ItemModelBase",
|
||||
"textures": {
|
||||
"layer0":"bloodmagic:items/ArcaneAshes"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 422 B |
Binary file not shown.
Before Width: | Height: | Size: 178 B |
Loading…
Reference in a new issue