mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-18 19:39:14 +00:00
First commit!
First commit!
This commit is contained in:
1 parent
96a30b0e01
commit
3c8ecf2134
104 files changed
+5456
No files matched your search
@@ -0,0 +1,64 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import com.arc.bloodarsenal.entity.ModLivingDropsEvent;
|
||||
import com.arc.bloodarsenal.item.ModItems;
|
||||
import com.arc.bloodarsenal.rituals.RitualRegistry;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
@Mod(modid="BloodArsenal", version="1.0.0", name="Blood Arsenal", dependencies="required-after:AWWayofTime")
|
||||
public class BloodArsenal
|
||||
{
|
||||
public static String MODID = "BloodArsenal";
|
||||
public static String VERSION = "1.0.0";
|
||||
public static String NAME = "Blood Arsenal";
|
||||
|
||||
@SidedProxy(clientSide = "com.arc.bloodarsenal.ClientProxy", serverSide = "com.arc.bloodarsenal.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
@Mod.Instance("BloodArsenal")
|
||||
public static BloodArsenal instance;
|
||||
|
||||
public static Item.ToolMaterial infusedWood = EnumHelper.addToolMaterial("InfusedWood", 1, 0, 4.0F, 1.0F, 0);
|
||||
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 3, 0, 10.0F, 4.0F, 0);
|
||||
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 4, 0, 16.0F, 9.0F, 0);
|
||||
public static Item.ToolMaterial infusedNetherium = EnumHelper.addToolMaterial("InfusedNetherium", 5, 0, 21.0F, 11.0F, 0);
|
||||
|
||||
public static CreativeTabs BA_TAB = new CreativeTabs("BA_TAB")
|
||||
{
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
{
|
||||
return ModItems.bound_bow;
|
||||
}
|
||||
};
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
ModBlocks.init();
|
||||
ModBlocks.registerBlocksInPre();
|
||||
|
||||
ModItems.init();
|
||||
ModItems.registerItems();
|
||||
|
||||
Object dropsEvent = new ModLivingDropsEvent();
|
||||
MinecraftForge.EVENT_BUS.register(dropsEvent);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
BloodArsenalRecipes.registerBindingRecipes();
|
||||
BloodArsenalRecipes.registerAltarRecipes();
|
||||
BloodArsenalRecipes.registerOrbRecipes();
|
||||
BloodArsenalRecipes.registerRecipes();
|
||||
RitualRegistry.initRituals();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.item.ModItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class BloodArsenalRecipes
|
||||
{
|
||||
public static void registerAltarRecipes()
|
||||
{
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 3000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(Blocks.log), 2, 2000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), new ItemStack(Blocks.iron_block), 2, 40000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 2, 5000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_orange), new ItemStack(Items.dye, 1, 14), 1, 200, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_diamond_active), new ItemStack(ModItems.blood_infused_diamond_unactive), 4, 50000, 5, 5, false);
|
||||
}
|
||||
|
||||
public static void registerBindingRecipes()
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_bow), new ItemStack(Items.bow));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_sickle), new ItemStack(Items.diamond_hoe));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_shears), new ItemStack(Items.shears));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.blood_infused_diamond_bound), new ItemStack(ModItems.blood_infused_diamond_active));
|
||||
}
|
||||
|
||||
public static void registerOrbRecipes()
|
||||
{
|
||||
int craftingConstant = OreDictionary.WILDCARD_VALUE;
|
||||
|
||||
ItemStack blankSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.blankSlate);
|
||||
ItemStack reinforcedSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate);
|
||||
ItemStack imbuedSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate);
|
||||
ItemStack demonicSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate);
|
||||
ItemStack weakOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.weakBloodOrb, 1, craftingConstant);
|
||||
ItemStack apprenticeOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, craftingConstant);
|
||||
ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', blankSlate, 'c', weakOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 1), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', reinforcedSlate, 'c', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 2), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', imbuedSlate, 'c', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 3), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', demonicSlate, 'c', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_ice, 8), "aaa", "aba", "aaa", 'a', Blocks.ice, 'b', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_glass, 8), "aaa", "aba", "aaa", 'a', Blocks.glass, 'b', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), "aaa", "aba", "aaa", 'a', ModItems.blood_infused_iron, 'b', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_axe_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_axe_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_pickaxe_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_pickaxe_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_shovel_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_shovel_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sword_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_sword_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sickle_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_sickle_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_diamond), "aba", "bcb", "aba", 'a', Blocks.glass, 'b', Items.diamond, 'c', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_diamond_unactive), "aba", "bcb", "ada", 'a', ModItems.amorphic_catalyst, 'b', ModBlocks.blood_infused_iron_block, 'c', ModItems.blood_diamond, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_axe_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_axe_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_pickaxe_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_pickaxe_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_shovel_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_shovel_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sword_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_sword_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sickle_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_sickle_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
}
|
||||
|
||||
public static void registerRecipes()
|
||||
{
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stained_ice_packed), "aa", "aa", 'a', ModBlocks.blood_stained_ice);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_door_wood), "aa", "aa", "aa", 'a', ModBlocks.blood_infused_planks);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_stick), "a", "a", 'a', ModBlocks.blood_infused_planks);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_pickaxe_wood), "aaa", " b ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_axe_wood), "aa ", "ab ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_shovel_wood), " a ", " b ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_sword_wood), " a ", " a ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_sickle_wood), " aa", " a", "baa", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.blood_infused_planks, 4), ModBlocks.blood_infused_wood);
|
||||
//This is a long one
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.amorphic_catalyst), WayofTime.alchemicalWizardry.ModItems.blankSlate, WayofTime.alchemicalWizardry.ModItems.aether, WayofTime.alchemicalWizardry.ModItems.terrae, WayofTime.alchemicalWizardry.ModItems.crystallos, WayofTime.alchemicalWizardry.ModItems.sanctus, WayofTime.alchemicalWizardry.ModItems.magicales, WayofTime.alchemicalWizardry.ModItems.crepitous, WayofTime.alchemicalWizardry.ModItems.incendium, WayofTime.alchemicalWizardry.ModItems.aquasalus);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.blood_infused_iron, 8), ModBlocks.blood_infused_iron_block);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import com.arc.bloodarsenal.item.ModItems;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static class BloodArsenalRecipes extends BindingRegistry
|
||||
{
|
||||
public static void initBindingRecipes()
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_bow), new ItemStack(Items.bow));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
public void registerRenders()
|
||||
{
|
||||
//Absolutely nothing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockBloodInfusedPlanks extends Block
|
||||
{
|
||||
public BlockBloodInfusedPlanks()
|
||||
{
|
||||
super(Material.wood);
|
||||
setBlockName("blood_infused_planks");
|
||||
setBlockTextureName("BloodArsenal:blood_infused_planks");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(3.0F);
|
||||
setResistance(6.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockBloodInfusedWood extends BlockRotatedPillar
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon top;
|
||||
|
||||
public BlockBloodInfusedWood()
|
||||
{
|
||||
super(Material.wood);
|
||||
setBlockName("blood_infused_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(3.0F);
|
||||
setResistance(6.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getSideIcon(int par1)
|
||||
{
|
||||
return blockIcon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getTopIcon(int par1)
|
||||
{
|
||||
return top;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_wood");
|
||||
top = iconRegister.registerIcon("BloodArsenal:blood_infused_wood_top");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodStainedGlass extends BlockBreakable
|
||||
{
|
||||
public BlockBloodStainedGlass()
|
||||
{
|
||||
super("blood_stained_glass", Material.glass, false);
|
||||
setBlockName("blood_stained_glass");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(1.0F);
|
||||
setResistance(4.0F);
|
||||
setStepSound(soundTypeGlass);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random) {return 0;}
|
||||
|
||||
protected boolean canSilkHarvest() {return true;}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_stained_glass");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodStainedIce extends BlockBreakable
|
||||
{
|
||||
public BlockBloodStainedIce()
|
||||
{
|
||||
super("blood_stained_ice", Material.ice, false);
|
||||
slipperiness = 0.99F;
|
||||
setBlockName("blood_stained_ice");
|
||||
setTickRandomly(true);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setLightOpacity(3);
|
||||
setHardness(1.0F);
|
||||
setResistance(2.0F);
|
||||
setStepSound(soundTypeGlass);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5);
|
||||
}
|
||||
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
|
||||
par2EntityPlayer.addExhaustion(0.025F);
|
||||
|
||||
if (canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
{
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
ItemStack itemstack = createStackedBlock(par6);
|
||||
|
||||
if (itemstack != null) items.add(itemstack);
|
||||
|
||||
ForgeEventFactory.fireBlockHarvesting(items, par1World, this, par3, par4, par5, par6, 0, 1.0f, true, par2EntityPlayer);
|
||||
for (ItemStack is : items)
|
||||
dropBlockAsItem(par1World, par3, par4, par5, is);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par1World.provider.isHellWorld)
|
||||
{
|
||||
par1World.setBlockToAir(par3, par4, par5);
|
||||
return;
|
||||
}
|
||||
|
||||
int i1 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer);
|
||||
harvesters.set(par2EntityPlayer);
|
||||
dropBlockAsItem(par1World, par3, par4, par5, par6, i1);
|
||||
harvesters.set(null);
|
||||
Material material = par1World.getBlock(par3, par4 - 1, par5).getMaterial();
|
||||
|
||||
if (material.blocksMovement() || material.isLiquid())
|
||||
{
|
||||
par1World.setBlock(par3, par4, par5, Blocks.flowing_water);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5)
|
||||
{
|
||||
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11 - getLightOpacity())
|
||||
{
|
||||
if (par1World.provider.isHellWorld)
|
||||
{
|
||||
par1World.setBlock(par2, par3, par4, Blocks.air);
|
||||
return;
|
||||
}
|
||||
|
||||
dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||
par1World.setBlock(par2, par3, par4, Blocks.water);
|
||||
}
|
||||
}
|
||||
|
||||
public int getMobilityFlag()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_stained_ice");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodStainedPackedIce extends Block
|
||||
{
|
||||
public BlockBloodStainedPackedIce()
|
||||
{
|
||||
super(Material.packedIce);
|
||||
slipperiness = 0.99F;
|
||||
setBlockName("blood_stained_ice_packed");
|
||||
setBlockTextureName("BloodArsenal:blood_stained_ice_packed");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(1.0F);
|
||||
setResistance(3.0F);
|
||||
setStepSound(soundTypeGlass);
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBloodStone extends Block
|
||||
{
|
||||
private IIcon blood_stone_1;
|
||||
private IIcon blood_stone_2;
|
||||
private IIcon blood_stone_3;
|
||||
private IIcon blood_stone_4;
|
||||
|
||||
public BlockBloodStone()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("blood_stone");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypePiston);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blood_stone_1 = iconRegister.registerIcon("BloodArsenal:blood_stone_1");
|
||||
blood_stone_2 = iconRegister.registerIcon("BloodArsenal:blood_stone_2");
|
||||
blood_stone_3 = iconRegister.registerIcon("BloodArsenal:blood_stone_3");
|
||||
blood_stone_4 = iconRegister.registerIcon("BloodArsenal:blood_stone_4");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1Item, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if(this.equals(ModBlocks.blood_stone))
|
||||
{
|
||||
par3List.add(new ItemStack(par1Item, 1, 0));
|
||||
par3List.add(new ItemStack(par1Item, 1, 1));
|
||||
par3List.add(new ItemStack(par1Item, 1, 2));
|
||||
par3List.add(new ItemStack(par1Item, 1, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.getSubBlocks(par1Item, par2CreativeTabs, par3List);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return blood_stone_1;
|
||||
|
||||
case 1:
|
||||
return blood_stone_2;
|
||||
|
||||
case 2:
|
||||
return blood_stone_3;
|
||||
|
||||
case 3:
|
||||
return blood_stone_4;
|
||||
|
||||
default:
|
||||
return blood_stone_1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.EntityBloodTNT;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodTNT extends Block
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon top;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottom;
|
||||
|
||||
public BlockBloodTNT()
|
||||
{
|
||||
super(Material.tnt);
|
||||
setBlockName("blood_tnt");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(0.0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2)
|
||||
{
|
||||
return par1 == 0 ? bottom : (par1 == 1 ? top : blockIcon);
|
||||
}
|
||||
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
super.onBlockAdded(par1World, par2, par3, par4);
|
||||
|
||||
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
|
||||
{
|
||||
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5Block)
|
||||
{
|
||||
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
|
||||
{
|
||||
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion)
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
EntityBloodTNT entitytntprimed = new EntityBloodTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5Explosion.getExplosivePlacedBy());
|
||||
entitytntprimed.fuse = par1World.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
|
||||
par1World.spawnEntityInWorld(entitytntprimed);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
spawnTNT(par1World, par2, par3, par4, par5, (EntityLivingBase) null);
|
||||
}
|
||||
|
||||
public void spawnTNT(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase)
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
if ((par5 & 1) == 1)
|
||||
{
|
||||
EntityBloodTNT entitytntprimed = new EntityBloodTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLivingBase);
|
||||
par1World.spawnEntityInWorld(entitytntprimed);
|
||||
par1World.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
if (par5.getCurrentEquippedItem() != null && par5.getCurrentEquippedItem().getItem() == Items.flint_and_steel)
|
||||
{
|
||||
spawnTNT(par1World, par2, par3, par4, 1, par5);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
par5.getCurrentEquippedItem().damageItem(1, par5);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.onBlockActivated(par1World, par2, par3, par4, par5, par6, par7, par8, par9);
|
||||
}
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
||||
{
|
||||
if (par5Entity instanceof EntityArrow && !par1World.isRemote)
|
||||
{
|
||||
EntityArrow entityarrow = (EntityArrow)par5Entity;
|
||||
|
||||
if (entityarrow.isBurning())
|
||||
{
|
||||
spawnTNT(par1World, par2, par3, par4, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canDropFromExplosion(Explosion par1Explosion)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_tnt_side");
|
||||
top = iconRegister.registerIcon("BloodArsenal:blood_tnt_top");
|
||||
bottom = iconRegister.registerIcon("BloodArsenal:blood_tnt_bottom");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockInfusedIron extends Block
|
||||
{
|
||||
public BlockInfusedIron()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("blood_infused_iron_block");
|
||||
setBlockTextureName("BloodArsenal:blood_infused_iron_block");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(7.5F);
|
||||
setResistance(1.0F);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.IconFlipped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockInfusedWoodenDoor extends Block
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorUp;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorDown;
|
||||
|
||||
public BlockInfusedWoodenDoor(Material par1Material)
|
||||
{
|
||||
super(par1Material);
|
||||
setBlockName("blood_door_wood");
|
||||
setBlockTextureName("BloodArsenal:blood_door_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(4.0F);
|
||||
setResistance(6.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
float f = 0.5F;
|
||||
float f1 = 1.0F;
|
||||
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2)
|
||||
{
|
||||
return doorDown[0];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
if (par5 != 1 && par5 != 0)
|
||||
{
|
||||
int i1 = func_150012_g(blockAccess, par2, par3, par4);
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = (i1 & 4) != 0;
|
||||
boolean flag1 = false;
|
||||
boolean flag2 = (i1 & 8) != 0;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (j1 == 0 && par5 == 2)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && par5 == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && par5 == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && par5 == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (j1 == 0 && par5 == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && par5 == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && par5 == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && par5 == 2)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
|
||||
if ((i1 & 16) != 0)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
}
|
||||
return flag2 ? doorUp[flag1?1:0] : doorDown[flag1?1:0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return doorDown[0];
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
doorUp = new IIcon[2];
|
||||
doorDown = new IIcon[2];
|
||||
doorUp[0] = iconRegister.registerIcon(getTextureName() + "_upper");
|
||||
doorDown[0] = iconRegister.registerIcon(getTextureName() + "_lower");
|
||||
doorUp[1] = new IconFlipped(doorUp[0], true, false);
|
||||
doorDown[1] = new IconFlipped(doorDown[0], true, false);
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getBlocksMovement(IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
int l = func_150012_g(blockAccess, x, y, z);
|
||||
return (l & 4) != 0;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getRenderType()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
public int func_150013_e(IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
return func_150012_g(blockAccess, x, y, z) & 3;
|
||||
}
|
||||
|
||||
public boolean func_150015_f(IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
return (func_150012_g(blockAccess, x, y, z) & 4) != 0;
|
||||
}
|
||||
|
||||
private void func_150011_b(int par1)
|
||||
{
|
||||
float f = 0.1875F;
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
int j = par1 & 3;
|
||||
boolean flag = (par1 & 4) != 0;
|
||||
boolean flag1 = (par1 & 16) != 0;
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
if (!flag1)
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else if (j == 1)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
if (!flag1)
|
||||
{
|
||||
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
}
|
||||
}
|
||||
else if (j == 2)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
if (!flag1)
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else if (j == 3)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
if (!flag1)
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {}
|
||||
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float xs, float ys, float zs)
|
||||
{
|
||||
if (blockMaterial == Material.iron)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = func_150012_g(world, x, y, z);
|
||||
int j1 = i1 & 7;
|
||||
j1 ^= 4;
|
||||
|
||||
if ((i1 & 8) == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, j1, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y - 1, z, j1, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z);
|
||||
}
|
||||
|
||||
world.playAuxSFXAtEntity(player, 1003, x, y, z, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void func_150014_a(World world, int x, int y, int z, boolean par5)
|
||||
{
|
||||
int l = func_150012_g(world, x, y, z);
|
||||
boolean flag1 = (l & 4) != 0;
|
||||
|
||||
if (flag1 != par5)
|
||||
{
|
||||
int i1 = l & 7;
|
||||
i1 ^= 4;
|
||||
|
||||
if ((l & 8) == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, i1, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y - 1, z, i1, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z);
|
||||
}
|
||||
|
||||
world.playAuxSFXAtEntity((EntityPlayer)null, 1003, x, y, z, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
int l = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if ((l & 8) == 0)
|
||||
{
|
||||
boolean flag = false;
|
||||
|
||||
if (world.getBlock(x, y + 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z))
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
flag = true;
|
||||
|
||||
if (world.getBlock(x, y + 1, z) == this)
|
||||
{
|
||||
world.setBlockToAir(x, y + 1, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
dropBlockAsItem(world, x, y, z, l, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean flag1 = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
|
||||
|
||||
if ((flag1 || block.canProvidePower()) && block != this)
|
||||
{
|
||||
func_150014_a(world, x, y, z, flag1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
if (block != this)
|
||||
{
|
||||
onNeighborBlockChange(world, x, y - 1, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItemDropped(int par1, Random random, int par3)
|
||||
{
|
||||
return (par1 & 8) != 0 ? null : (blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door);
|
||||
}
|
||||
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 par5, Vec3 par6)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.collisionRayTrace(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
{
|
||||
return y >= world.getHeight() - 1 && World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && super.canPlaceBlockAt(world, x, y, z) && super.canPlaceBlockAt(world, x, y + 1, z);
|
||||
}
|
||||
|
||||
public int getMobilityFlag()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int func_150012_g(IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
int l = blockAccess.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l & 8) != 0;
|
||||
int i1;
|
||||
int j1;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
i1 = blockAccess.getBlockMetadata(x, y - 1, z);
|
||||
j1 = l;
|
||||
}
|
||||
else
|
||||
{
|
||||
i1 = l;
|
||||
j1 = blockAccess.getBlockMetadata(x, y + 1, z);
|
||||
}
|
||||
|
||||
boolean flag1 = (j1 & 1) != 0;
|
||||
return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door;
|
||||
}
|
||||
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int par5, EntityPlayer player)
|
||||
{
|
||||
if (player.capabilities.isCreativeMode && (par5 & 8) != 0 && world.getBlock(x, y - 1, z) == this)
|
||||
{
|
||||
world.setBlockToAir(x, y - 1, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.item.ItemBloodStoneBlock;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class ModBlocks
|
||||
{
|
||||
public static Block blood_stone;
|
||||
public static Block blood_tnt;
|
||||
public static Block blood_stained_glass;
|
||||
public static Block blood_infused_wood;
|
||||
public static Block blood_infused_planks;
|
||||
public static Block blood_stained_ice;
|
||||
public static Block blood_stained_ice_packed;
|
||||
public static Block blood_infused_iron_block;
|
||||
public static Block blood_door_wood;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
blood_stone = new BlockBloodStone();
|
||||
blood_tnt = new BlockBloodTNT();
|
||||
blood_stained_glass = new BlockBloodStainedGlass();
|
||||
blood_infused_wood = new BlockBloodInfusedWood();
|
||||
blood_infused_planks = new BlockBloodInfusedPlanks();
|
||||
blood_stained_ice = new BlockBloodStainedIce();
|
||||
blood_stained_ice_packed = new BlockBloodStainedPackedIce();
|
||||
blood_infused_iron_block = new BlockInfusedIron();
|
||||
blood_door_wood = new BlockInfusedWoodenDoor(Material.wood);
|
||||
}
|
||||
|
||||
public static void registerBlocksInPre()
|
||||
{
|
||||
GameRegistry.registerBlock(ModBlocks.blood_stone, ItemBloodStoneBlock.class, "BloodArsenal" + (ModBlocks.blood_stone.getUnlocalizedName().substring(5)));
|
||||
GameRegistry.registerBlock(ModBlocks.blood_tnt, "blood_tnt");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_stained_glass, "blood_stained_glass");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_wood, "blood_infused_wood");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_planks, "blood_infused_planks");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_stained_ice, "blood_stained_ice");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_stained_ice_packed, "blood_stained_ice_packed");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_iron_block, "blood_infused_iron_block");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_door_wood, "blood_door_wood");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.arc.bloodarsenal.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityBloodTNT extends Entity
|
||||
{
|
||||
public int fuse;
|
||||
private EntityLivingBase tntPlacedBy;
|
||||
|
||||
public EntityBloodTNT(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
preventEntitySpawning = true;
|
||||
setSize(0.98F, 0.98F);
|
||||
yOffset = height / 2.0F;
|
||||
}
|
||||
|
||||
public EntityBloodTNT(World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase)
|
||||
{
|
||||
this(par1World);
|
||||
setPosition(par2, par4, par6);
|
||||
float f = (float)(Math.random() * Math.PI * 2.0D);
|
||||
motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
|
||||
motionY = 0.20000000298023224D;
|
||||
motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
|
||||
fuse = 60;
|
||||
prevPosX = par2;
|
||||
prevPosY = par4;
|
||||
prevPosZ = par6;
|
||||
tntPlacedBy = par8EntityLivingBase;
|
||||
}
|
||||
|
||||
public void entityInit() {}
|
||||
|
||||
public boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canBeCollidedWith()
|
||||
{
|
||||
return !isDead;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
motionY -= 0.03999999910593033D;
|
||||
moveEntity(motionX, motionY, motionZ);
|
||||
motionX *= 0.9800000190734863D;
|
||||
motionY *= 0.9800000190734863D;
|
||||
motionZ *= 0.9800000190734863D;
|
||||
|
||||
if (onGround)
|
||||
{
|
||||
motionY *= -0.5D;
|
||||
}
|
||||
|
||||
if (fuse-- <= 0)
|
||||
{
|
||||
setDead();
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
explode();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
worldObj.spawnParticle("smoke", posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
private void explode()
|
||||
{
|
||||
float f = 6.0F;
|
||||
worldObj.createExplosion(this, posX, posY, posZ, f, true);
|
||||
}
|
||||
|
||||
protected void writeEntityToNBT(NBTTagCompound par1)
|
||||
{
|
||||
par1.setByte("Fuse", (byte) fuse);
|
||||
}
|
||||
|
||||
protected void readEntityFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
fuse = par1.getByte("Fuse");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public EntityLivingBase getTntPlacedBy()
|
||||
{
|
||||
return tntPlacedBy;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.arc.bloodarsenal.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
|
||||
public class EntityTeleportationSigil extends EntityThrowable
|
||||
{
|
||||
public EntityTeleportationSigil(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityTeleportationSigil(World par1World, EntityLivingBase par2EntityLivingBase)
|
||||
{
|
||||
super(par1World, par2EntityLivingBase);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EntityTeleportationSigil(World par2World, double par2, double par4, double par6)
|
||||
{
|
||||
super(par2World, par2, par4, par6);
|
||||
}
|
||||
|
||||
public void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
||||
{
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
worldObj.spawnParticle("portal", posX, posY + rand.nextDouble() * 2.0D, posZ, rand.nextGaussian(), 0.0D, rand.nextGaussian());
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
if (getThrower() != null && getThrower() instanceof EntityPlayerMP)
|
||||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP)getThrower();
|
||||
|
||||
if (entityplayermp.playerNetServerHandler.func_147362_b().isChannelOpen() && entityplayermp.worldObj == worldObj)
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, posX, posY, posZ, 5.0F);
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
if (getThrower().isRiding())
|
||||
{
|
||||
getThrower().mountEntity((Entity)null);
|
||||
}
|
||||
|
||||
getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
|
||||
getThrower().fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.arc.bloodarsenal.entity;
|
||||
|
||||
import com.arc.bloodarsenal.item.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
||||
public class ModLivingDropsEvent
|
||||
{
|
||||
public static double rand;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDrop(LivingDropsEvent event)
|
||||
{
|
||||
if (event.source.getDamageType().equals("player"))
|
||||
{
|
||||
rand = Math.random();
|
||||
|
||||
if (event.entityLiving instanceof EntityZombie)
|
||||
{
|
||||
if (rand < 0.01F)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAmorphicCatalyst extends Item
|
||||
{
|
||||
public ItemAmorphicCatalyst()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("amorphic_catalyst");
|
||||
setTextureName("BloodArsenal:amorphic_catalyst");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A coagulated mess");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBloodOrange extends ItemFood
|
||||
{
|
||||
public ItemBloodOrange()
|
||||
{
|
||||
super(2, false);
|
||||
setUnlocalizedName("blood_orange");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setTextureName("BloodArsenal:blood_orange");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Ironic food source");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBloodStoneBlock extends ItemBlock
|
||||
{
|
||||
public ItemBloodStoneBlock(Block block)
|
||||
{
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
String name = "";
|
||||
|
||||
switch (itemStack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
name = "blood_stone_1";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
name = "blood_stone_2";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
name = "blood_stone_3";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
name = "blood_stone_4";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "blood_stone";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemHeart extends Item
|
||||
{
|
||||
public ItemHeart()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("heart");
|
||||
setTextureName("BloodArsenal:heart");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Fresh from a body");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSoulFragment extends Item
|
||||
{
|
||||
public ItemSoulFragment()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("soul_fragment");
|
||||
setTextureName("BloodAresnal:soul_fragment");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("The raw essence");
|
||||
par3List.add("of a soul");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.arc.bloodarsenal.item;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.item.sigil.TeleportationSigil;
|
||||
import com.arc.bloodarsenal.item.tool.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ModItems
|
||||
{
|
||||
public static Item bound_bow;
|
||||
public static Item blood_orange;
|
||||
public static Item teleportation_sigil;
|
||||
public static Item blood_infused_pickaxe_wood;
|
||||
public static Item blood_infused_axe_wood;
|
||||
public static Item blood_infused_shovel_wood;
|
||||
public static Item blood_infused_sword_wood;
|
||||
public static Item amorphic_catalyst;
|
||||
public static Item blood_infused_stick;
|
||||
public static Item bound_sickle;
|
||||
public static Item blood_infused_pickaxe_iron;
|
||||
public static Item blood_infused_axe_iron;
|
||||
public static Item blood_infused_shovel_iron;
|
||||
public static Item blood_infused_sword_iron;
|
||||
public static Item blood_infused_iron;
|
||||
public static Item bound_shears;
|
||||
public static Item blood_diamond;
|
||||
public static Item blood_infused_diamond_unactive;
|
||||
public static Item blood_infused_diamond_active;
|
||||
public static Item blood_infused_diamond_bound;
|
||||
public static Item blood_infused_sickle_wood;
|
||||
public static Item blood_infused_sickle_iron;
|
||||
public static Item blood_infused_pickaxe_diamond;
|
||||
public static Item blood_infused_axe_diamond;
|
||||
public static Item blood_infused_shovel_diamond;
|
||||
public static Item blood_infused_sword_diamond;
|
||||
public static Item blood_infused_sickle_diamond;
|
||||
public static Item heart;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
bound_bow = new BoundBow();
|
||||
blood_orange = new ItemBloodOrange();
|
||||
teleportation_sigil = new TeleportationSigil();
|
||||
blood_infused_pickaxe_wood = new InfusedWoodPickaxe();
|
||||
blood_infused_axe_wood = new InfusedWoodAxe();
|
||||
blood_infused_shovel_wood = new InfusedWoodShovel();
|
||||
blood_infused_sword_wood = new InfusedWoodSword();
|
||||
blood_infused_sickle_wood = new InfusedWoodSickle(BloodArsenal.infusedWood);
|
||||
amorphic_catalyst = new ItemAmorphicCatalyst();
|
||||
blood_infused_stick = new InfusedStick();
|
||||
bound_sickle = new BoundSickle(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
blood_infused_pickaxe_iron = new InfusedIronPickaxe();
|
||||
blood_infused_axe_iron = new InfusedIronAxe();
|
||||
blood_infused_shovel_iron = new InfusedIronShovel();
|
||||
blood_infused_sword_iron = new InfusedIronSword();
|
||||
blood_infused_sickle_iron = new InfusedIronSickle(BloodArsenal.infusedIron);
|
||||
blood_infused_iron = new InfusedIron();
|
||||
bound_shears = new BoundShears();
|
||||
blood_diamond = new InfusedDiamond().setUnlocalizedName("blood_diamond");
|
||||
blood_infused_diamond_unactive = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_unactive");
|
||||
blood_infused_diamond_active = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_active");
|
||||
blood_infused_diamond_bound = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_bound");
|
||||
blood_infused_pickaxe_diamond = new InfusedDiamondPickaxe();
|
||||
blood_infused_axe_diamond = new InfusedDiamondAxe();
|
||||
blood_infused_shovel_diamond = new InfusedDiamondShovel();
|
||||
blood_infused_sword_diamond = new InfusedDiamondSword();
|
||||
blood_infused_sickle_diamond = new InfusedDiamondSickle(BloodArsenal.infusedDiamond);
|
||||
heart = new ItemHeart();
|
||||
}
|
||||
|
||||
public static void registerItems()
|
||||
{
|
||||
GameRegistry.registerItem(ModItems.bound_bow, "bound_bow");
|
||||
GameRegistry.registerItem(ModItems.blood_orange, "blood_orange");
|
||||
GameRegistry.registerItem(ModItems.teleportation_sigil, "teleportation_sigil");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_wood, "blood_infused_pickaxe_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_wood, "blood_infused_axe_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_wood, "blood_infused_shovel_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_wood, "blood_infused_sword_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sickle_wood, "blood_infused_sickle_wood");
|
||||
GameRegistry.registerItem(ModItems.amorphic_catalyst, "amorphic_catalyst");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_stick, "blood_infused_stick");
|
||||
GameRegistry.registerItem(ModItems.bound_sickle, "bound_sickle");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_iron, "blood_infused_pickaxe_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_iron, "blood_infused_axe_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_iron, "blood_infused_shovel_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_iron, "blood_infused_sword_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sickle_iron, "blood_infused_sickle_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_iron, "blood_infused_iron");
|
||||
GameRegistry.registerItem(ModItems.bound_shears, "bound_shears");
|
||||
GameRegistry.registerItem(ModItems.blood_diamond, "blood_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_unactive, "blood_infused_diamond_unactive");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_active, "blood_infused_diamond_active");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_bound, "blood_infused_diamond_bound");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_diamond, "blood_infused_pickaxe_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_diamond, "blood_infused_axe_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_diamond, "blood_infused_shovel_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_diamond, "blood_infused_sword_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sickle_diamond, "blood_infused_sickle_diamond");
|
||||
GameRegistry.registerItem(ModItems.heart, "heart");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.arc.bloodarsenal.item.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.EntityTeleportationSigil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TeleportationSigil extends EnergyItems
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public TeleportationSigil()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setEnergyUsed(500);
|
||||
// setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setUnlocalizedName("teleportation_sigil");
|
||||
setTextureName("BloodArsenal:teleportation_sigil");
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Like infinte ender pearls!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
|
||||
if (par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityTeleportationSigil(par2World, par3EntityPlayer));
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BoundBow extends ItemBow implements IBindable
|
||||
{
|
||||
private static IIcon active;
|
||||
private static IIcon active_1;
|
||||
private static IIcon active_2;
|
||||
private static IIcon active_3;
|
||||
private static IIcon passive;
|
||||
|
||||
private int energyUsed;
|
||||
|
||||
public BoundBow()
|
||||
{
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setUnlocalizedName("bound_bow");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(100);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
|
||||
{
|
||||
int j = getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
|
||||
ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
if (event.isCanceled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
j = event.charge;
|
||||
|
||||
boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
|
||||
|
||||
if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow))
|
||||
{
|
||||
float f = (float)j / 6.0F;
|
||||
f = (f * f + f * 2.0F) / 3.0F;
|
||||
|
||||
if ((double)f < 0.1D)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (f > 1.0F)
|
||||
{
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 3.0F);
|
||||
|
||||
if (f == 1.0F)
|
||||
{
|
||||
entityarrow.setIsCritical(true);
|
||||
}
|
||||
|
||||
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
|
||||
|
||||
if (k > 0)
|
||||
{
|
||||
entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
|
||||
}
|
||||
|
||||
int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
|
||||
|
||||
if (l > 0)
|
||||
{
|
||||
entityarrow.setKnockbackStrength(l);
|
||||
}
|
||||
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
|
||||
{
|
||||
entityarrow.setFire(100);
|
||||
}
|
||||
|
||||
par1ItemStack.damageItem(1, par3EntityPlayer);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
entityarrow.canBePickedUp = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3EntityPlayer.inventory.consumeInventoryItem(Items.arrow);
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(entityarrow);
|
||||
entityarrow.setDamage(entityarrow.getDamage() * 1.259178F);
|
||||
}
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 200);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
if (event.isCanceled())
|
||||
{
|
||||
return event.result;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow))
|
||||
{
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
||||
{
|
||||
return 36000;
|
||||
}
|
||||
|
||||
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
|
||||
}
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Let Demon arrows fly!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_bow");
|
||||
active = iconRegister.registerIcon("BloodArsenal:bound_bow");
|
||||
active_1 = iconRegister.registerIcon("BloodArsenal:bound_bow_pulling_0");
|
||||
active_2 = iconRegister.registerIcon("BloodArsenal:bound_bow_pulling_1");
|
||||
active_3 = iconRegister.registerIcon("BloodArsenal:bound_bow_pulling_2");
|
||||
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
if (useRemaining > 0)
|
||||
{
|
||||
int draw = stack.getMaxItemUseDuration() - useRemaining;
|
||||
|
||||
if (draw > 17)
|
||||
{
|
||||
return active_3;
|
||||
}
|
||||
else if (draw > 13)
|
||||
{
|
||||
return active_2;
|
||||
}
|
||||
else if (draw > 0)
|
||||
{
|
||||
return active_1;
|
||||
}
|
||||
}
|
||||
return active;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passive;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BoundShears extends ItemShears implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
|
||||
public BoundShears()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setUnlocalizedName("bound_shears");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
|
||||
}
|
||||
|
||||
if (par3Block.getMaterial() != Material.leaves && par3Block != Blocks.web && par3Block != Blocks.tallgrass && par3Block != Blocks.vine && par3Block != Blocks.tripwire && !(par3Block instanceof IShearable))
|
||||
{
|
||||
return super.onBlockDestroyed(par1ItemStack, par2World, par3Block, par4, par5, par6, par7EntityLivingBase);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_150897_b(Block par1Block)
|
||||
{
|
||||
return par1Block == Blocks.web || par1Block == Blocks.redstone_wire || par1Block == Blocks.tripwire;
|
||||
}
|
||||
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
return par2Block != Blocks.web && par2Block.getMaterial() != Material.leaves ? (par2Block == Blocks.wool ? 5.0F : super.func_150893_a(par1ItemStack, par2Block)) : 15.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(itemstack, player, 50);
|
||||
}
|
||||
|
||||
if (entity.worldObj.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (entity instanceof IShearable)
|
||||
{
|
||||
IShearable target = (IShearable)entity;
|
||||
if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
|
||||
{
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
|
||||
Random rand = new Random();
|
||||
for (ItemStack stack : drops)
|
||||
{
|
||||
EntityItem ent = entity.entityDropItem(stack, 1.0F);
|
||||
ent.motionY += rand.nextFloat() * 0.05F;
|
||||
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
||||
}
|
||||
itemstack.damageItem(1, entity);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Block block = player.worldObj.getBlock(x, y, z);
|
||||
if (block instanceof IShearable)
|
||||
{
|
||||
IShearable target = (IShearable)block;
|
||||
if (target.isShearable(itemstack, player.worldObj, x, y, z))
|
||||
{
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
Random rand = new Random();
|
||||
|
||||
for(ItemStack stack : drops)
|
||||
{
|
||||
float f = 0.7F;
|
||||
double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
player.worldObj.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
|
||||
itemstack.damageItem(1, player);
|
||||
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Demonic solution");
|
||||
par3List.add("to an overgrown lawn");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_shears");
|
||||
active = iconRegister.registerIcon("BloodArsenal:bound_shears");
|
||||
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return active;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passive;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20);
|
||||
}
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.google.common.collect.Sets;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class BoundSickle extends ItemTool implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private int radiusLeaf = 3;
|
||||
private int radiusCrop = 4;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
|
||||
private static final Set toolBlocks = Sets.newHashSet(new Block[] { Blocks.leaves, Blocks.leaves2, Blocks.wheat, Blocks.potatoes, Blocks.carrots, Blocks.nether_wart, Blocks.red_mushroom, Blocks.brown_mushroom, Blocks.reeds, Blocks.tallgrass, Blocks.vine, Blocks.waterlily, Blocks.red_flower, Blocks.yellow_flower });
|
||||
|
||||
public BoundSickle(ToolMaterial toolMaterial)
|
||||
{
|
||||
super(1.0F, toolMaterial, toolBlocks);
|
||||
setUnlocalizedName("bound_sickle");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setFull3D();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
boolean use = false;
|
||||
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
|
||||
}
|
||||
|
||||
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
|
||||
{
|
||||
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
|
||||
{
|
||||
for (int j = -radiusLeaf; j <= radiusLeaf; j++)
|
||||
{
|
||||
for (int k = -radiusLeaf; k <= radiusLeaf; k++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y + j, z + k);
|
||||
int meta = par2World.getBlockMetadata(x + i, y + j, z + k);
|
||||
|
||||
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y + j, z + k, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = -radiusCrop; i <= radiusCrop; i++)
|
||||
{
|
||||
for (int j = -radiusCrop; j <= radiusCrop; j++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
{
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y, z + j, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return use;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Hacking plants down");
|
||||
par3List.add("like a demon!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Block block = par3World.getBlock(x, y, z);
|
||||
|
||||
if (par7 != 0 && par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt))
|
||||
{
|
||||
Block block1 = Blocks.farmland;
|
||||
par3World.playSoundEffect((double)((float) x + 0.5F), (double)((float) y + 0.5F), (double)((float) z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3World.setBlock(x, y, z, block1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_sickle");
|
||||
active = iconRegister.registerIcon("BloodArsenal:bound_sickle");
|
||||
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return active;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passive;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
|
||||
}
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedDiamond extends Item
|
||||
{
|
||||
public InfusedDiamond()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (equals(ModItems.blood_diamond))
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_diamond");
|
||||
}
|
||||
else if (equals(ModItems.blood_infused_diamond_unactive))
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_unactive");
|
||||
}
|
||||
else if (equals(ModItems.blood_infused_diamond_active))
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_active");
|
||||
}
|
||||
else if (equals(ModItems.blood_infused_diamond_bound))
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_bound");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack)
|
||||
{
|
||||
if (equals(ModItems.blood_infused_diamond_bound))
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return EnumRarity.common;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
if (equals(ModItems.blood_infused_diamond_unactive))
|
||||
{
|
||||
par3List.add("Diamond needs to");
|
||||
par3List.add("be activated");
|
||||
}
|
||||
if (equals(ModItems.blood_infused_diamond_active))
|
||||
{
|
||||
par3List.add("Diamond infused");
|
||||
par3List.add("with life energy");
|
||||
}
|
||||
if (equals(ModItems.blood_infused_diamond_bound))
|
||||
{
|
||||
par3List.add("Diamond of Life");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
if (equals(ModItems.blood_infused_diamond_bound))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public static ArrayList<List> oreDictLogs = new ArrayList();
|
||||
|
||||
public InfusedDiamondAxe()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_axe_diamond");
|
||||
setTextureName("BloodArsenal:blood_infused_axe_diamond");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Demonic deforestation!");
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
par3List.add("Normal Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 1)
|
||||
{
|
||||
par3List.add("Area Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 2)
|
||||
{
|
||||
par3List.add("Tree Mode");
|
||||
}
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
ToolCapabilities.changeMode(par1ItemStack);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
World world = player.worldObj;
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsAxe))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, player, true, 4.5);
|
||||
if (block == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
|
||||
|
||||
switch (ToolCapabilities.getMode(stack))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 100);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 1000);
|
||||
}
|
||||
|
||||
boolean doX = direction.offsetX == 0;
|
||||
boolean doY = direction.offsetY == 0;
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolCapabilities.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsAxe);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
Block blck = world.getBlock(x, y, z);
|
||||
if (ToolCapabilities.isWoodLog(world, x, y, z))
|
||||
{
|
||||
while (blck != Blocks.air)
|
||||
{
|
||||
ToolCapabilities.breakFurthestBlock(world, x, y, z, blck, player);
|
||||
blck = world.getBlock(x, y, z);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5));
|
||||
for (EntityItem item : items)
|
||||
{
|
||||
item.setPosition(x + 0.5, y + 0.5, z + 0.5);
|
||||
item.ticksExisted += 20;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedDiamondPickaxe()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_pickaxe_diamond");
|
||||
setTextureName("BloodArsenal:blood_infused_pickaxe_diamond");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setHasSubtypes(true);
|
||||
setEnergyUsed(300);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A handheld quarry");
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
par3List.add("Normal Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 1)
|
||||
{
|
||||
par3List.add("Line Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 2)
|
||||
{
|
||||
par3List.add("Square Mode");
|
||||
}
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
ToolCapabilities.changeMode(par1ItemStack);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer)
|
||||
{
|
||||
World world = par5EntityPlayer.worldObj;
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsPick))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, par5EntityPlayer, true, 4.5);
|
||||
if (block == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
|
||||
|
||||
switch (ToolCapabilities.getMode(par1ItemStack))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 1000);
|
||||
}
|
||||
|
||||
int xo = -direction.offsetX;
|
||||
int yo = -direction.offsetY;
|
||||
int zo = -direction.offsetZ;
|
||||
|
||||
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, xo >= 0 ? 0 : -10, yo >= 0 ? 0 : -10, zo >= 0 ? 0 : -10, xo > 0 ? 10 : 1, yo > 0 ? 10 : 1, zo > 0 ? 10 : 1, null, ToolCapabilities.materialsPick);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 2500);
|
||||
}
|
||||
|
||||
boolean doX = direction.offsetX == 0;
|
||||
boolean doY = direction.offsetY == 0;
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsPick);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedDiamondShovel extends ItemSpade implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedDiamondShovel()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_shovel_diamond");
|
||||
setTextureName("BloodArsenal:blood_infused_shovel_diamond");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Diggy diggy hole!");
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
par3List.add("Normal Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 1)
|
||||
{
|
||||
par3List.add("Line Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 2)
|
||||
{
|
||||
par3List.add("Square Mode");
|
||||
}
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
ToolCapabilities.changeMode(par1ItemStack);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer)
|
||||
{
|
||||
World world = par5EntityPlayer.worldObj;
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsShovel))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, par5EntityPlayer, true, 4.5);
|
||||
if (block == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
|
||||
|
||||
switch (ToolCapabilities.getMode(par1ItemStack))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 1000);
|
||||
}
|
||||
|
||||
int xo = -direction.offsetX;
|
||||
int yo = -direction.offsetY;
|
||||
int zo = -direction.offsetZ;
|
||||
|
||||
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, xo >= 0 ? 0 : -10, yo >= 0 ? 0 : -10, zo >= 0 ? 0 : -10, xo > 0 ? 10 : 1, yo > 0 ? 10 : 1, zo > 0 ? 10 : 1, null, ToolCapabilities.materialsShovel);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 2500);
|
||||
}
|
||||
|
||||
boolean doX = direction.offsetX == 0;
|
||||
boolean doY = direction.offsetY == 0;
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsShovel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.google.common.collect.Sets;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class InfusedDiamondSickle extends ItemTool implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private int radiusLeaf = 3;
|
||||
private int radiusCrop = 4;
|
||||
|
||||
private static final Set toolBlocks = Sets.newHashSet(new Block[]{Blocks.leaves, Blocks.leaves2, Blocks.wheat, Blocks.potatoes, Blocks.carrots, Blocks.nether_wart, Blocks.red_mushroom, Blocks.brown_mushroom, Blocks.reeds, Blocks.tallgrass, Blocks.vine, Blocks.waterlily, Blocks.red_flower, Blocks.yellow_flower});
|
||||
|
||||
public InfusedDiamondSickle(ToolMaterial toolMaterial)
|
||||
{
|
||||
super(1.0F, toolMaterial, toolBlocks);
|
||||
setUnlocalizedName("blood_infused_sickle_diamond");
|
||||
setTextureName("BloodArsenal:blood_infused_sickle_diamond");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setFull3D();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
boolean use = false;
|
||||
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 100);
|
||||
}
|
||||
|
||||
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
|
||||
{
|
||||
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
|
||||
{
|
||||
for (int j = -radiusLeaf; j <= radiusLeaf; j++)
|
||||
{
|
||||
for (int k = -radiusLeaf; k <= radiusLeaf; k++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y + j, z + k);
|
||||
int meta = par2World.getBlockMetadata(x + i, y + j, z + k);
|
||||
|
||||
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y + j, z + k, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = -radiusCrop; i <= radiusCrop; i++)
|
||||
{
|
||||
for (int j = -radiusCrop; j <= radiusCrop; j++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
{
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y, z + j, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return use;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 100);
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Block block = par3World.getBlock(x, y, z);
|
||||
|
||||
if (par7 != 0 && par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt))
|
||||
{
|
||||
Block block1 = Blocks.farmland;
|
||||
par3World.playSoundEffect((double)((float) x + 0.5F), (double)((float) y + 0.5F), (double)((float) z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3World.setBlock(x, y, z, block1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Mad farming skills");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedDiamondSword extends ItemSword implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedDiamondSword()
|
||||
{
|
||||
super(BloodArsenal.infusedDiamond);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_sword_diamond");
|
||||
setTextureName("BloodArsenal:blood_infused_sword_diamond");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Cuts easily through flesh");
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
par3List.add("Normal Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 1)
|
||||
{
|
||||
par3List.add("Area Mode");
|
||||
}
|
||||
else if (par1ItemStack.getItemDamage() == 2)
|
||||
{
|
||||
par3List.add("Fire Mode");
|
||||
}
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean ignoreLeftClick = false;
|
||||
|
||||
@Override
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
|
||||
{
|
||||
if (!ignoreLeftClick && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).hurtTime == 0 && !((EntityLivingBase) entity).isDead)
|
||||
switch (ToolCapabilities.getMode(stack))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
int range = 3;
|
||||
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range));
|
||||
ignoreLeftClick = true;
|
||||
for (Entity entity_ : entities)
|
||||
{
|
||||
player.attackTargetEntityWithCurrentItem(entity_);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 3000);
|
||||
}
|
||||
}
|
||||
ignoreLeftClick = false;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
living.setFire(3);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 300);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
if (par3EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase);
|
||||
}
|
||||
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
ToolCapabilities.changeMode(par1ItemStack);
|
||||
}
|
||||
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIron extends Item
|
||||
{
|
||||
public InfusedIron()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("blood_infused_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Mundane iron infused");
|
||||
par3List.add("with life essence");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIronAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedIronAxe()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_axe_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_axe_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(75);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIronPickaxe extends ItemPickaxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedIronPickaxe()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_pickaxe_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_pickaxe_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(75);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIronShovel extends ItemSpade implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedIronShovel()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_shovel_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_shovel_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(75);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.google.common.collect.Sets;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class InfusedIronSickle extends ItemTool implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private int radiusLeaf = 2;
|
||||
private int radiusCrop = 3;
|
||||
|
||||
private static final Set toolBlocks = Sets.newHashSet(new Block[]{Blocks.leaves, Blocks.leaves2, Blocks.wheat, Blocks.potatoes, Blocks.carrots, Blocks.nether_wart, Blocks.red_mushroom, Blocks.brown_mushroom, Blocks.reeds, Blocks.tallgrass, Blocks.vine, Blocks.waterlily, Blocks.red_flower, Blocks.yellow_flower});
|
||||
|
||||
public InfusedIronSickle(ToolMaterial toolMaterial)
|
||||
{
|
||||
super(1.0F, toolMaterial, toolBlocks);
|
||||
setUnlocalizedName("blood_infused_sickle_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_sickle_iron");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setFull3D();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
boolean use = false;
|
||||
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 75);
|
||||
}
|
||||
|
||||
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
|
||||
{
|
||||
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
|
||||
{
|
||||
for (int j = -radiusLeaf; j <= radiusLeaf; j++)
|
||||
{
|
||||
for (int k = -radiusLeaf; k <= radiusLeaf; k++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y + j, z + k);
|
||||
int meta = par2World.getBlockMetadata(x + i, y + j, z + k);
|
||||
|
||||
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y + j, z + k, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = -radiusCrop; i <= radiusCrop; i++)
|
||||
{
|
||||
for (int j = -radiusCrop; j <= radiusCrop; j++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
{
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y, z + j, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return use;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 75);
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Block block = par3World.getBlock(x, y, z);
|
||||
|
||||
if (par7 != 0 && par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt))
|
||||
{
|
||||
Block block1 = Blocks.farmland;
|
||||
par3World.playSoundEffect((double)((float) x + 0.5F), (double)((float) y + 0.5F), (double)((float) z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3World.setBlock(x, y, z, block1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIronSword extends ItemSword implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedIronSword()
|
||||
{
|
||||
super(BloodArsenal.infusedIron);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_sword_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_sword_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(75);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
if (par3EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase);
|
||||
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, getEnergyUsed()))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedStick extends Item
|
||||
{
|
||||
public InfusedStick()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("blood_infused_stick");
|
||||
setTextureName("BloodArsenal:blood_infused_stick");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("It's a stick");
|
||||
par3List.add("infused with life!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedWoodAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedWoodAxe()
|
||||
{
|
||||
super(BloodArsenal.infusedWood);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_axe_wood");
|
||||
setTextureName("BloodArsenal:blood_infused_axe_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedWoodPickaxe extends ItemPickaxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedWoodPickaxe()
|
||||
{
|
||||
super(BloodArsenal.infusedWood);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_pickaxe_wood");
|
||||
setTextureName("BloodArsenal:blood_infused_pickaxe_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedWoodShovel extends ItemSpade implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedWoodShovel()
|
||||
{
|
||||
super(BloodArsenal.infusedWood);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_shovel_wood");
|
||||
setTextureName("BloodArsenal:blood_infused_shovel_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.google.common.collect.Sets;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class InfusedWoodSickle extends ItemTool implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private int radiusLeaf = 1;
|
||||
private int radiusCrop = 2;
|
||||
|
||||
private static final Set toolBlocks = Sets.newHashSet(new Block[]{Blocks.leaves, Blocks.leaves2, Blocks.wheat, Blocks.potatoes, Blocks.carrots, Blocks.nether_wart, Blocks.red_mushroom, Blocks.brown_mushroom, Blocks.reeds, Blocks.tallgrass, Blocks.vine, Blocks.waterlily, Blocks.red_flower, Blocks.yellow_flower});
|
||||
|
||||
public InfusedWoodSickle(ToolMaterial toolMaterial)
|
||||
{
|
||||
super(1.0F, toolMaterial, toolBlocks);
|
||||
setUnlocalizedName("blood_infused_sickle_wood");
|
||||
setTextureName("BloodArsenal:blood_infused_sickle_wood");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setFull3D();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
boolean use = false;
|
||||
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
|
||||
}
|
||||
|
||||
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
|
||||
{
|
||||
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
|
||||
{
|
||||
for (int j = -radiusLeaf; j <= radiusLeaf; j++)
|
||||
{
|
||||
for (int k = -radiusLeaf; k <= radiusLeaf; k++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y + j, z + k);
|
||||
int meta = par2World.getBlockMetadata(x + i, y + j, z + k);
|
||||
|
||||
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y + j, z + k, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = -radiusCrop; i <= radiusCrop; i++)
|
||||
{
|
||||
for (int j = -radiusCrop; j <= radiusCrop; j++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
{
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
|
||||
}
|
||||
par2World.setBlock(x + i, y, z + j, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return use;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Block block = par3World.getBlock(x, y, z);
|
||||
|
||||
if (par7 != 0 && par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt))
|
||||
{
|
||||
Block block1 = Blocks.farmland;
|
||||
par3World.playSoundEffect((double)((float) x + 0.5F), (double)((float) y + 0.5F), (double)((float) z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3World.setBlock(x, y, z, block1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedWoodSword extends ItemSword implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public InfusedWoodSword()
|
||||
{
|
||||
super(BloodArsenal.infusedWood);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("blood_infused_sword_wood");
|
||||
setTextureName("BloodArsenal:blood_infused_sword_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int par1)
|
||||
{
|
||||
energyUsed = par1;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
if (par3EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase);
|
||||
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, getEnergyUsed()))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class ToolCapabilities
|
||||
{
|
||||
public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil };
|
||||
public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
|
||||
public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood };
|
||||
|
||||
public static int getMode(ItemStack tool
|
||||
) {
|
||||
return tool.getItemDamage();
|
||||
}
|
||||
|
||||
public static int getNextMode(int mode)
|
||||
{
|
||||
return mode == 2 ? 0 : mode + 1;
|
||||
}
|
||||
|
||||
public static void changeMode(ItemStack tool)
|
||||
{
|
||||
int mode = getMode(tool);
|
||||
tool.setItemDamage(getNextMode(mode));
|
||||
}
|
||||
|
||||
public static boolean isRightMaterial(Material material, Material[] materialsListing)
|
||||
{
|
||||
for (Material mat : materialsListing)
|
||||
{
|
||||
if (material == mat) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void removeBlocksInIteration(EntityPlayer player, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing)
|
||||
{
|
||||
float blockHardness = (block == null) ? 1.0f : block.getBlockHardness(world, x, y, z);
|
||||
for (int x1 = xs; x1 < xe; x1++)
|
||||
{
|
||||
for (int y1 = ys; y1 < ye; y1++)
|
||||
{
|
||||
for (int z1 = zs; z1 < ze; z1++)
|
||||
{
|
||||
ToolCapabilities.removeBlockWithDrops(player, world, x1 + x, y1 + y, z1 + z, x, y, z, block, materialsListing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeBlockWithDrops(EntityPlayer player, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing)
|
||||
{
|
||||
if (!world.blockExists(x, y, z))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Block blk = world.getBlock(x, y, z);
|
||||
|
||||
if (block != null && blk != block)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if (blk != null && !blk.isAir(world, x, y, z) && ((blk.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0)))
|
||||
{
|
||||
if (!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
int localMeta = world.getBlockMetadata(x, y, z);
|
||||
if (blk.removedByPlayer(world, player, x, y, z))
|
||||
{
|
||||
blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
|
||||
}
|
||||
blk.harvestBlock(world, player, x, y, z, localMeta);
|
||||
blk.onBlockHarvested(world, x, y, z, localMeta, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @author Azanor
|
||||
*/
|
||||
|
||||
static int lastx = 0;
|
||||
static int lasty = 0;
|
||||
static int lastz = 0;
|
||||
static double lastdistance = 0.0D;
|
||||
|
||||
public static boolean isWoodLog(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
if (bi == Blocks.air)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (bi.canSustainLeaves(world, x, y, z))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (InfusedDiamondAxe.oreDictLogs.contains(Arrays.asList(new Object[]{bi, Integer.valueOf(md)})))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean breakFurthestBlock(World world, int x, int y, int z, Block block, EntityPlayer player)
|
||||
{
|
||||
lastx = x;
|
||||
lasty = y;
|
||||
lastz = z;
|
||||
lastdistance = 0.0D;
|
||||
|
||||
findBlocks(world, x, y, z, block);
|
||||
|
||||
boolean worked = harvestBlock(world, player, lastx, lasty, lastz);
|
||||
if (worked)
|
||||
{
|
||||
for (int xx = -3; xx <= 3; xx++)
|
||||
{
|
||||
for (int yy = -3; yy <= 3; yy++)
|
||||
{
|
||||
for (int zz = -3; zz <= 3; zz++)
|
||||
{
|
||||
world.scheduleBlockUpdate(lastx + xx, lasty + yy, lastz + zz, world.getBlock(lastx + xx, lasty + yy, lastz + zz), 150 + world.rand.nextInt(150));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return worked;
|
||||
}
|
||||
|
||||
private static void findBlocks(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
int count = 0;
|
||||
for (int xx = -2; xx <= 2; xx++)
|
||||
{
|
||||
for (int yy = 2; yy >= -2; yy--)
|
||||
{
|
||||
for (int zz = -2; zz <= 2; zz++)
|
||||
{
|
||||
if (Math.abs(lastx + xx - x) > 24)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Math.abs(lasty + yy - y) > 48)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Math.abs(lastz + zz - z) > 24)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((world.getBlock(lastx + xx, lasty + yy, lastz + zz) == block) && (isWoodLog(world, lastx + xx, lasty + yy, lastz + zz)) && (block.getBlockHardness(world, lastx + xx, lasty + yy, lastz + zz) >= 0.0F))
|
||||
{
|
||||
double xd = lastx + xx - x;
|
||||
double yd = lasty + yy - y;
|
||||
double zd = lastz + zz - z;
|
||||
double d = xd * xd + yd * yd + zd * zd;
|
||||
if (d > lastdistance)
|
||||
{
|
||||
lastdistance = d;
|
||||
lastx += xx;
|
||||
lasty += yy;
|
||||
lastz += zz;
|
||||
findBlocks(world, x, y, z, block);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean harvestBlock(World world, EntityPlayer player, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int i1 = world.getBlockMetadata(x, y, z);
|
||||
if (block.getBlockHardness(world, x, y, z) < 0.0F)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (i1 << 12));
|
||||
|
||||
boolean flag = false;
|
||||
if (player.capabilities.isCreativeMode)
|
||||
{
|
||||
flag = removeBlock(world, x, y, z, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean flag1 = false;
|
||||
if (block != null)
|
||||
{
|
||||
flag1 = block.canHarvestBlock(player, i1);
|
||||
}
|
||||
flag = removeBlock(world, x, y, z, player);
|
||||
if ((flag) && (flag1))
|
||||
{
|
||||
block.harvestBlock(world, player, x, y, z, i1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean removeBlock(World world, int par1, int par2, int par3, EntityPlayer player)
|
||||
{
|
||||
Block block = world.getBlock(par1, par2, par3);
|
||||
int l = world.getBlockMetadata(par1, par2, par3);
|
||||
if (block != null)
|
||||
{
|
||||
block.onBlockHarvested(world, par1, par2, par3, l, player);
|
||||
}
|
||||
boolean flag = (block != null) && (block.removedByPlayer(world, player, par1, par2, par3));
|
||||
if ((block != null) && (flag))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, par1, par2, par3, l);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/*
|
||||
* @author mDiyo
|
||||
*/
|
||||
|
||||
public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range)
|
||||
{
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += 1.62D;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.017453292F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
|
||||
return world.rayTraceBlocks(vec3, vec31, par3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.arc.bloodarsenal.rituals;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class RitualEffectFishing extends RitualEffect
|
||||
{
|
||||
private static final int terraeDrain = 20;
|
||||
private static final int orbisTerraeDrain = 20;
|
||||
|
||||
protected Random random = null;
|
||||
protected float next = Float.NaN;
|
||||
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone ritualStone)
|
||||
{
|
||||
String owner = ritualStone.getOwner();
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(owner);
|
||||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorld();
|
||||
|
||||
if (world.getWorldTime() % 10 != 5)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
TileEntity tile = world.getTileEntity(x, y + 1, z);
|
||||
IInventory tileEntity;
|
||||
|
||||
if (tile instanceof IInventory)
|
||||
{
|
||||
tileEntity = (IInventory) tile;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileEntity.getSizeInventory() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasRoom = false;
|
||||
for (int i=0; i<tileEntity.getSizeInventory(); i++)
|
||||
{
|
||||
if (tileEntity.getStackInSlot(i) == null)
|
||||
{
|
||||
hasRoom = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasRoom)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentEssence < getCostPerRefresh())
|
||||
{
|
||||
SoulNetworkHandler.causeNauseaToPlayer(owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean hasTerrae = canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false);
|
||||
boolean hasOrbisTerrae = canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, false);
|
||||
|
||||
int speed = getSpeedForReagents(hasTerrae, hasOrbisTerrae);
|
||||
if (world.getWorldTime() % speed != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int flag = 0;
|
||||
|
||||
for (int i = -1; i <= 1; i++)
|
||||
{
|
||||
for (int j = -1; j <= 1; j++)
|
||||
{
|
||||
Block block = world.getBlock(x + i, y - 1, z + j);
|
||||
|
||||
{
|
||||
if (block.isAssociatedBlock(Blocks.water) || block.isAssociatedBlock(Blocks.flowing_water))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCostPerRefresh()
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RitualComponent> getRitualComponentList()
|
||||
{
|
||||
ArrayList<RitualComponent> fishingRitual = new ArrayList();
|
||||
fishingRitual.add(new RitualComponent(1, 0, 0, 1));
|
||||
fishingRitual.add(new RitualComponent(-1, 0, 0, 1));
|
||||
fishingRitual.add(new RitualComponent(0, 0, 1, 1));
|
||||
fishingRitual.add(new RitualComponent(1, 0, -1, 1));
|
||||
fishingRitual.add(new RitualComponent(-1, 0, 1, 3));
|
||||
fishingRitual.add(new RitualComponent(1, 0, 1, 3));
|
||||
fishingRitual.add(new RitualComponent(-1, 0, -1, 3));
|
||||
fishingRitual.add(new RitualComponent(1, 0, -1, 3));
|
||||
fishingRitual.add(new RitualComponent(1, 1, 0, 4));
|
||||
fishingRitual.add(new RitualComponent(-1, 1, 0, 4));
|
||||
fishingRitual.add(new RitualComponent(0, 1, 1, 4));
|
||||
fishingRitual.add(new RitualComponent(0, 1, -1, 4));
|
||||
return fishingRitual;
|
||||
}
|
||||
|
||||
public int getSpeedForReagents(boolean hasTerrae, boolean hasOrbisTerrae)
|
||||
{
|
||||
if (hasOrbisTerrae)
|
||||
{
|
||||
if (hasTerrae)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasTerrae)
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.arc.bloodarsenal.rituals;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class RitualEffectMidas extends RitualEffect
|
||||
{
|
||||
public static double rand;
|
||||
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone ritualStone)
|
||||
{
|
||||
String owner = ritualStone.getOwner();
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(owner);
|
||||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
||||
if (currentEssence < getCostPerRefresh())
|
||||
{
|
||||
SoulNetworkHandler.causeNauseaToPlayer(owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ritualStone.getVar1() == 0)
|
||||
{
|
||||
int d0 = 0;
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double) x, (double) y + 1, (double) z, (double) (x + 1), (double) (y + 2), (double) (z + 1)).expand(d0, d0, d0);
|
||||
List list = world.getEntitiesWithinAABB(EntityItem.class, axisalignedbb);
|
||||
Iterator iterator = list.iterator();
|
||||
EntityItem item;
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
item = (EntityItem) iterator.next();
|
||||
ItemStack itemStack = item.getEntityItem();
|
||||
|
||||
if (itemStack == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (itemStack.getItem() == Items.iron_ingot)
|
||||
{
|
||||
item.setDead();
|
||||
ritualStone.setVar1(+1);
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 1, z));
|
||||
ritualStone.setCooldown(ritualStone.getCooldown() - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (world.rand.nextInt(10) == 0)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 1, x, y, z);
|
||||
}
|
||||
}
|
||||
data.currentEssence = currentEssence - getCostPerRefresh();
|
||||
data.markDirty();
|
||||
}
|
||||
else
|
||||
{
|
||||
ritualStone.setCooldown(ritualStone.getCooldown() - 1);
|
||||
|
||||
if (world.rand.nextInt(20) == 0)
|
||||
{
|
||||
int lightningPoint = world.rand.nextInt(4);
|
||||
|
||||
switch (lightningPoint)
|
||||
{
|
||||
case 0:
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 6, z + 3));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x + 3, y + 6, z - 3));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 6, z + 3));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x - 3, y + 6, z - 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ritualStone.getCooldown() <= 0)
|
||||
{
|
||||
ItemStack spawnedItem = new ItemStack(Items.gold_ingot);
|
||||
rand = Math.random();
|
||||
|
||||
if (rand > 0.9F)
|
||||
{
|
||||
if (spawnedItem != null)
|
||||
{
|
||||
EntityItem newItem = new EntityItem(world, x + 0.5, y + 1, z + 0.5, spawnedItem.copy());
|
||||
world.spawnEntityInWorld(newItem);
|
||||
}
|
||||
}
|
||||
ritualStone.setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCostPerRefresh()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInitialCooldown()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RitualComponent> getRitualComponentList()
|
||||
{
|
||||
ArrayList<RitualComponent> midasRitual = new ArrayList();
|
||||
midasRitual.add(new RitualComponent(1, 0, 0, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(0, 0, 1, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(0, 0, -1, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(1, 0, 1, RitualComponent.AIR));
|
||||
midasRitual.add(new RitualComponent(1, 0, -1, RitualComponent.AIR));
|
||||
midasRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.AIR));
|
||||
midasRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.AIR));
|
||||
midasRitual.add(new RitualComponent(1, 3, 1, RitualComponent.FIRE));
|
||||
midasRitual.add(new RitualComponent(1, 3, -1, RitualComponent.FIRE));
|
||||
midasRitual.add(new RitualComponent(-1, 3, 1, RitualComponent.FIRE));
|
||||
midasRitual.add(new RitualComponent(-1, 3, -1, RitualComponent.FIRE));
|
||||
midasRitual.add(new RitualComponent(2, 1, 2, RitualComponent.WATER));
|
||||
midasRitual.add(new RitualComponent(2, 1, -2, RitualComponent.WATER));
|
||||
midasRitual.add(new RitualComponent(-2, 1, 2, RitualComponent.WATER));
|
||||
midasRitual.add(new RitualComponent(-2, 1, -2, RitualComponent.WATER));
|
||||
midasRitual.add(new RitualComponent(2, 2, 2, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(2, 2, -2, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(-2, 2, 2, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(-2, 2, -2, RitualComponent.EARTH));
|
||||
midasRitual.add(new RitualComponent(3, 4, 3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(3, 4, -3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(-3, 4, 3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(-3, 4, -3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(3, 5, 3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(3, 5, -3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(-3, 5, 3, RitualComponent.DUSK));
|
||||
midasRitual.add(new RitualComponent(-3, 5, -3, RitualComponent.DUSK));
|
||||
return midasRitual;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.arc.bloodarsenal.rituals;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RitualEffectWithering extends RitualEffect
|
||||
{
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone ritualStone)
|
||||
{
|
||||
String owner = ritualStone.getOwner();
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(owner);
|
||||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
||||
int timeDelay = 50;
|
||||
|
||||
if (world.getWorldTime() % timeDelay != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int range = 15;
|
||||
int vertRange = 15;
|
||||
|
||||
List<EntityLivingBase> list = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, vertRange);
|
||||
int entityCount = 0;
|
||||
boolean flag = false;
|
||||
|
||||
for(EntityLivingBase livingEntity : list)
|
||||
{
|
||||
if (livingEntity instanceof EntityPlayer)
|
||||
{
|
||||
entityCount += 10;
|
||||
} else
|
||||
{
|
||||
entityCount++;
|
||||
}
|
||||
}
|
||||
|
||||
int cost = getCostPerRefresh();
|
||||
|
||||
if (currentEssence < cost * entityCount)
|
||||
{
|
||||
SoulNetworkHandler.causeNauseaToPlayer(owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
entityCount = 0;
|
||||
|
||||
for(EntityLivingBase livingEntity : list)
|
||||
{
|
||||
if(!(livingEntity instanceof EntityPlayer))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PotionEffect effect = livingEntity.getActivePotionEffect(Potion.wither);
|
||||
if(effect == null || (effect != null && effect.getDuration() <= timeDelay))
|
||||
{
|
||||
livingEntity.addPotionEffect(new PotionEffect(Potion.wither.id, timeDelay + 2));
|
||||
|
||||
if (livingEntity instanceof EntityPlayer)
|
||||
{
|
||||
entityCount += 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
entityCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entityCount > 0)
|
||||
{
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCostPerRefresh()
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RitualComponent> getRitualComponentList()
|
||||
{
|
||||
ArrayList<RitualComponent> witherRitual = new ArrayList();
|
||||
witherRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 0, 2, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(2, 0, 0, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(1, 0, -3, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(1, 0, 3, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(3, 0, 1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(3, 0, -1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-3, 0, -1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-3, 0, 1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-1, 0, -3, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-1, 0, 3, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(1, 3, 0, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-1, 3, 0, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(0, 3, -1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(-2, 3, 2, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-2, 3, -2, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(2, 3, 2, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(2, 3, -2, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(0, 3, 1, RitualComponent.FIRE));
|
||||
witherRitual.add(new RitualComponent(4, 1, 0, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(0, 1, -4, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(-4, 1, 0, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(0, 1, 4, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(4, 0, -4, RitualComponent.EARTH));
|
||||
witherRitual.add(new RitualComponent(-4, 0, -4, RitualComponent.EARTH));
|
||||
witherRitual.add(new RitualComponent(4, 0, 4, RitualComponent.EARTH));
|
||||
witherRitual.add(new RitualComponent(-4, 0, 4, RitualComponent.EARTH));
|
||||
witherRitual.add(new RitualComponent(-3, 1, 3, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(3, 1, -3, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(3, 1, 3, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(-3, 1, -3, RitualComponent.AIR));
|
||||
witherRitual.add(new RitualComponent(3, 2, 0, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-3, 2, 0, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 2, -3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 2, 3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(3, 2, -3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(3, 2, 3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-3, 2, -3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(-3, 2, 3, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(3, 0, -4, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(3, 0, 4, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(4, 0, -3, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(4, 0, 3, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-3, 0, 4, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-3, 0, -4, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-4, 0, 3, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-4, 0, -3, RitualComponent.WATER));
|
||||
witherRitual.add(new RitualComponent(-5, 0, 0, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 0, 5, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(0, 0, -5, RitualComponent.DUSK));
|
||||
witherRitual.add(new RitualComponent(5, 0, 0, RitualComponent.DUSK));
|
||||
return witherRitual;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.arc.bloodarsenal.rituals;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RitualRegistry
|
||||
{
|
||||
public static void initRituals()
|
||||
{
|
||||
Rituals.registerRitual("ARC001Wither", 1, 75000, new RitualEffectWithering(), "Ritual of Withering", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false));
|
||||
Rituals.registerRitual("ARC002Midas", 1, 5000, new RitualEffectMidas(), "Midas Touch", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 2.5, false));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user