mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-22 13:09:43 +00:00
Version 0.8!
This commit is contained in:
1 parent
7abdfb5501
commit
96cf39acd1
74 files changed
+842
-4667
No files matched your search
@@ -13,11 +13,13 @@ import com.arc.bloodarsenal.blocks.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")
|
||||
import java.io.File;
|
||||
|
||||
@Mod(modid="BloodArsenal", version="0.8.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 VERSION = "0.8.0";
|
||||
public static String NAME = "Blood Arsenal";
|
||||
|
||||
@SidedProxy(clientSide = "com.arc.bloodarsenal.ClientProxy", serverSide = "com.arc.bloodarsenal.CommonProxy")
|
||||
@@ -48,6 +50,8 @@ public class BloodArsenal
|
||||
ModItems.init();
|
||||
ModItems.registerItems();
|
||||
|
||||
BloodArsenalConfig.init(new File(event.getModConfigurationDirectory(), "BloodArsenal.cfg"));
|
||||
|
||||
Object dropsEvent = new ModLivingDropsEvent();
|
||||
MinecraftForge.EVENT_BUS.register(dropsEvent);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class BloodArsenalConfig
|
||||
{
|
||||
public static Configuration config;
|
||||
|
||||
public static void init(File configFile)
|
||||
{
|
||||
config = new Configuration(configFile);
|
||||
|
||||
try
|
||||
{
|
||||
config.load();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.arc.bloodarsenal.items.ModItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -15,12 +16,14 @@ 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_tnt), new ItemStack(Blocks.tnt), 3, 5000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(Blocks.log), 2, 3000, 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);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_cookie), new ItemStack(Items.cookie), 1, 2000, 5, 5, false);
|
||||
}
|
||||
|
||||
public static void registerBindingRecipes()
|
||||
@@ -29,6 +32,7 @@ public class BloodArsenalRecipes
|
||||
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));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_flint_and_steel), new ItemStack(Items.flint_and_steel));
|
||||
}
|
||||
|
||||
public static void registerOrbRecipes()
|
||||
@@ -61,6 +65,8 @@ public class BloodArsenalRecipes
|
||||
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.soul_booster), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', Blocks.beacon, 'c', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.soul_nullifier), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', WayofTime.alchemicalWizardry.ModItems.armourInhibitor, 'c', masterOrb));
|
||||
}
|
||||
|
||||
public static void registerRecipes()
|
||||
@@ -78,5 +84,7 @@ public class BloodArsenalRecipes
|
||||
//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);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.orange_juice), ModItems.blood_orange, Items.glass_bottle);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.juice_and_cookies), Items.cookie, ModItems.orange_juice);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,415 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
@@ -11,10 +12,12 @@ import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.IconFlipped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -34,7 +37,6 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
public BlockInfusedWoodenDoor()
|
||||
{
|
||||
super(Material.wood);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(4.0F);
|
||||
setResistance(6.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
@@ -141,6 +143,17 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
return blockMaterial == Material.iron ? Items.iron_door : ModItems.item_blood_door_wood;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TileOwned && entity instanceof EntityPlayer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int par5, EntityPlayer player)
|
||||
{
|
||||
@@ -287,7 +300,6 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
|
||||
int i1 = func_150012_g(world, x, y, z);
|
||||
int j1 = i1 & 7;
|
||||
j1 ^= 4;
|
||||
@@ -365,15 +377,6 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
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
|
||||
{
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,10 @@ package com.arc.bloodarsenal.entity;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
||||
public class ModLivingDropsEvent
|
||||
@@ -15,19 +18,38 @@ public class ModLivingDropsEvent
|
||||
{
|
||||
if (event.source.getDamageType().equals("player"))
|
||||
{
|
||||
PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness);
|
||||
rand = Math.random();
|
||||
|
||||
if (event.entityLiving instanceof EntityZombie)
|
||||
{
|
||||
if (rand < 0.01F)
|
||||
if (effect != null)
|
||||
{
|
||||
if (rand < 0.01F)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof EntityVillager)
|
||||
{
|
||||
if (effect != null)
|
||||
{
|
||||
if (rand < 0.25F)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
if (effect != null)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.heart, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,299 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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!");
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
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,42 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBloodCookie extends ItemFood
|
||||
{
|
||||
public ItemBloodCookie()
|
||||
{
|
||||
super(2, 0.3F, false);
|
||||
setUnlocalizedName("blood_cookie");
|
||||
setTextureName("BloodArsenal:blood_cookie");
|
||||
setAlwaysEdible();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A sugary treat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 2, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,15 +11,15 @@ public class ItemBloodOrange extends ItemFood
|
||||
{
|
||||
public ItemBloodOrange()
|
||||
{
|
||||
super(2, false);
|
||||
super(2, 0.2F, false);
|
||||
setUnlocalizedName("blood_orange");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setTextureName("BloodArsenal:blood_orange");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Ironic food source");
|
||||
par3List.add("Completely organic");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -14,13 +18,33 @@ public class ItemHeart extends Item
|
||||
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");
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
par3List.add("Bright red in color");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Fresh from a body");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:heart2");
|
||||
}
|
||||
else
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodAresnal:heart");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemJuiceAndCookies extends ItemFood
|
||||
{
|
||||
public ItemJuiceAndCookies()
|
||||
{
|
||||
super(6, 0.6F, false);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("juice_and_cookies");
|
||||
setTextureName("BloodArsenal:juice_and_cookies");
|
||||
setAlwaysEdible();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Eat after losing");
|
||||
par3List.add("some blood");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 6, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemOrangeJuice extends Item
|
||||
{
|
||||
public ItemOrangeJuice()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("orange_juice");
|
||||
setTextureName("BloodArsenal:orange_juice");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
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.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSoulBooster extends Item implements IBindable
|
||||
{
|
||||
public ItemSoulBooster()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("soul_booster");
|
||||
setTextureName("BloodArsenal:soul_booster");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
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, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 2, 0));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2, 0));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.jump.id, 2, 0));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 2, 0));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 2, 0));
|
||||
}
|
||||
}
|
||||
|
||||
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("Used to increase the");
|
||||
par3List.add("soul's abilities");
|
||||
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,7 +14,7 @@ public class ItemSoulFragment extends Item
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("soul_fragment");
|
||||
setTextureName("BloodAresnal:soul_fragment");
|
||||
setTextureName("BloodArsenal:soul_fragment");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSoulNullifier extends Item implements IBindable
|
||||
{
|
||||
public ItemSoulNullifier()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("soul_nullifier");
|
||||
setTextureName("BloodArsenal:soul_nullifier");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Collection<PotionEffect> potions = par3EntityPlayer.getActivePotionEffects();
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
||||
|
||||
if (par3EntityPlayer.isBurning())
|
||||
{
|
||||
par3EntityPlayer.extinguish();
|
||||
}
|
||||
else for (PotionEffect potion : potions)
|
||||
{
|
||||
int id = potion.getPotionID();
|
||||
|
||||
if (!par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray.id))
|
||||
{
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par3EntityPlayer.removePotionEffect(id);
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 100);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
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("Used to nullify the");
|
||||
par3List.add("soul's unnatural abilities");
|
||||
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.items.block.BloodDoorWood;
|
||||
import com.arc.bloodarsenal.items.sigil.TeleportationSigil;
|
||||
import com.arc.bloodarsenal.items.block.*;
|
||||
import com.arc.bloodarsenal.items.tool.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -12,7 +11,6 @@ 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;
|
||||
@@ -35,14 +33,20 @@ public class ModItems
|
||||
public static Item blood_infused_shovel_diamond;
|
||||
public static Item blood_infused_sword_diamond;
|
||||
public static Item heart;
|
||||
public static Item soul_fragment;
|
||||
public static Item item_blood_door_wood;
|
||||
public static Item blood_door_iron;
|
||||
public static Item bound_flint_and_steel;
|
||||
public static Item soul_booster;
|
||||
public static Item soul_nullifier;
|
||||
public static Item blood_cookie;
|
||||
public static Item orange_juice;
|
||||
public static Item juice_and_cookies;
|
||||
|
||||
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();
|
||||
@@ -65,14 +69,20 @@ public class ModItems
|
||||
blood_infused_shovel_diamond = new InfusedDiamondShovel();
|
||||
blood_infused_sword_diamond = new InfusedDiamondSword();
|
||||
heart = new ItemHeart();
|
||||
soul_fragment = new ItemSoulFragment();
|
||||
item_blood_door_wood = new BloodDoorWood(Material.wood);
|
||||
bound_flint_and_steel = new BoundFlintAndSteel();
|
||||
soul_booster = new ItemSoulBooster();
|
||||
soul_nullifier = new ItemSoulNullifier();
|
||||
blood_cookie = new ItemBloodCookie();
|
||||
orange_juice = new ItemOrangeJuice();
|
||||
juice_and_cookies = new ItemJuiceAndCookies();
|
||||
}
|
||||
|
||||
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");
|
||||
@@ -95,6 +105,13 @@ public class ModItems
|
||||
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.heart, "heart");
|
||||
GameRegistry.registerItem(ModItems.soul_fragment, "soul_fragment");
|
||||
GameRegistry.registerItem(ModItems.item_blood_door_wood, "item_blood_door_wood");
|
||||
GameRegistry.registerItem(ModItems.bound_flint_and_steel, "bound_flint_and_steel");
|
||||
GameRegistry.registerItem(ModItems.soul_booster, "soul_booster");
|
||||
GameRegistry.registerItem(ModItems.soul_nullifier, "soul_nullfier");
|
||||
GameRegistry.registerItem(ModItems.blood_cookie, "blood_cookie");
|
||||
GameRegistry.registerItem(ModItems.orange_juice, "orange_juice");
|
||||
GameRegistry.registerItem(ModItems.juice_and_cookies, "juice_and_cookies");
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.items.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+89
-169
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.item.tool;
|
||||
package com.arc.bloodarsenal.items.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
@@ -6,42 +6,32 @@ 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.EntityLivingBase;
|
||||
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.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BoundBow extends ItemBow implements IBindable
|
||||
public class BoundFlintAndSteel extends Item implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
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()
|
||||
public BoundFlintAndSteel()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("bound_flint_and_steel");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setUnlocalizedName("bound_bow");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(100);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
@@ -55,91 +45,26 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
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())
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
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);
|
||||
}
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 200);
|
||||
return active;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passive;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
@@ -156,39 +81,65 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
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()
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int hitSide, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
NBTTagCompound tag = itemStack.stackTagCompound;
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
}
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(itemStack, player, 50);
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
||||
{
|
||||
return 36000;
|
||||
}
|
||||
if (hitSide == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
return par1ItemStack;
|
||||
if (hitSide == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (hitSide == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (hitSide == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (hitSide == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (hitSide == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, hitSide, itemStack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world.isAirBlock(x, y, z))
|
||||
{
|
||||
world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
world.setBlock(x, y, z, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,10 +193,20 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLeftClickEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, Entity par3Entity)
|
||||
{
|
||||
EntityLivingBase living = (EntityLivingBase) par3Entity;
|
||||
living.setFire(4);
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
|
||||
|
||||
return super.onLeftClickEntity(par1ItemStack, par2EntityPlayer, par3Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Let Demon arrows fly!");
|
||||
par3List.add("Burning souls...");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
@@ -265,52 +226,11 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
}
|
||||
}
|
||||
|
||||
@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");
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_flint_and_steel");
|
||||
active = iconRegister.registerIcon("BloodArsenal:bound_flint_and_steel");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,8 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(0);
|
||||
setUnlocalizedName("bound_shears");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
@@ -88,34 +86,38 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(itemstack, player, 50);
|
||||
}
|
||||
NBTTagCompound tag = itemstack.stackTagCompound;
|
||||
|
||||
if (entity.worldObj.isRemote)
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
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))
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -123,33 +125,36 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
NBTTagCompound tag = itemstack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
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))
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
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)
|
||||
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))
|
||||
{
|
||||
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);
|
||||
}
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
Random rand = new Random();
|
||||
|
||||
itemstack.damageItem(1, player);
|
||||
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
|
||||
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);
|
||||
}
|
||||
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -278,10 +283,4 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -60,58 +60,67 @@ public class BoundSickle extends ItemTool implements IBindable
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
NBTTagCompound tag = par1ItemStack.stackTagCompound;
|
||||
|
||||
boolean use = false;
|
||||
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
|
||||
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
|
||||
}
|
||||
|
||||
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
|
||||
{
|
||||
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
|
||||
if (!(par7EntityLivingBase instanceof EntityPlayer))
|
||||
{
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
|
||||
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++)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
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)))
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
|
||||
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;
|
||||
}
|
||||
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++)
|
||||
for (int i = -radiusCrop; i <= radiusCrop; i++)
|
||||
{
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
for (int j = -radiusCrop; j <= radiusCrop; j++)
|
||||
{
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
|
||||
int meta = par2World.getBlockMetadata(x + i, y, z + j);
|
||||
|
||||
if (blockToCheck !=null)
|
||||
{
|
||||
if (blockToCheck.canHarvestBlock(player, meta))
|
||||
if(blockToCheck instanceof BlockBush)
|
||||
{
|
||||
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
|
||||
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;
|
||||
}
|
||||
par2World.setBlock(x + i, y, z + j, Blocks.air);
|
||||
use = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,50 +154,59 @@ public class BoundSickle extends ItemTool implements IBindable
|
||||
|
||||
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);
|
||||
}
|
||||
NBTTagCompound tag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -122,7 +122,7 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
case 2:
|
||||
{
|
||||
Block blck = world.getBlock(x, y, z);
|
||||
if (ToolCapabilities.isWoodLog(world, x, y, z))
|
||||
if (ToolCapabilities.isWood(world, x, y, z))
|
||||
{
|
||||
while (blck != Blocks.air)
|
||||
{
|
||||
|
||||
@@ -102,24 +102,24 @@ public final class ToolCapabilities
|
||||
}
|
||||
}
|
||||
|
||||
static int lastx = 0;
|
||||
static int lasty = 0;
|
||||
static int lastz = 0;
|
||||
static double lastdistance = 0.0D;
|
||||
public static int lastx = 0;
|
||||
public static int lasty = 0;
|
||||
public static int lastz = 0;
|
||||
public static double lastdistance = 0.0D;
|
||||
|
||||
public static boolean isWoodLog(IBlockAccess world, int x, int y, int z)
|
||||
public static boolean isWood(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)
|
||||
Block blk = world.getBlock(x, y, z);
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (blk == Blocks.air)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (bi.canSustainLeaves(world, x, y, z))
|
||||
if (blk.canSustainLeaves(world, x, y, z))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (InfusedDiamondAxe.oreDictLogs.contains(Arrays.asList(new Object[]{bi, Integer.valueOf(md)})))
|
||||
if (InfusedDiamondAxe.oreDictLogs.contains(Arrays.asList(new Object[]{blk, Integer.valueOf(metadata)})))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public final class ToolCapabilities
|
||||
{
|
||||
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))
|
||||
if ((world.getBlock(lastx + xx, lasty + yy, lastz + zz) == block) && (isWood(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;
|
||||
@@ -197,12 +197,12 @@ public final class ToolCapabilities
|
||||
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);
|
||||
int metadata = 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));
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (metadata << 12));
|
||||
|
||||
boolean flag = false;
|
||||
if (player.capabilities.isCreativeMode)
|
||||
@@ -214,12 +214,12 @@ public final class ToolCapabilities
|
||||
boolean flag1 = false;
|
||||
if (block != null)
|
||||
{
|
||||
flag1 = block.canHarvestBlock(player, i1);
|
||||
flag1 = block.canHarvestBlock(player, metadata);
|
||||
}
|
||||
flag = removeBlock(world, x, y, z, player);
|
||||
if ((flag) && (flag1))
|
||||
{
|
||||
block.harvestBlock(world, player, x, y, z, i1);
|
||||
block.harvestBlock(world, player, x, y, z, metadata);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -228,15 +228,15 @@ public final class ToolCapabilities
|
||||
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);
|
||||
int metadata = world.getBlockMetadata(par1, par2, par3);
|
||||
if (block != null)
|
||||
{
|
||||
block.onBlockHarvested(world, par1, par2, par3, l, player);
|
||||
block.onBlockHarvested(world, par1, par2, par3, metadata, player);
|
||||
}
|
||||
boolean flag = (block != null) && (block.removedByPlayer(world, player, par1, par2, par3));
|
||||
if ((block != null) && (flag))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, par1, par2, par3, l);
|
||||
block.onBlockDestroyedByPlayer(world, par1, par2, par3, metadata);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
@@ -252,8 +252,12 @@ public final class ToolCapabilities
|
||||
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);
|
||||
@@ -263,9 +267,12 @@ public final class ToolCapabilities
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RitualEffectMidas extends RitualEffect
|
||||
ItemStack spawnedItem = new ItemStack(Items.gold_ingot);
|
||||
rand = Math.random();
|
||||
|
||||
if (rand > 0.9F)
|
||||
if (rand + 0.5F > 0.6F)
|
||||
{
|
||||
if (spawnedItem != null)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -18,6 +19,10 @@ import java.util.List;
|
||||
|
||||
public class RitualEffectWithering extends RitualEffect
|
||||
{
|
||||
public static final int reductusDrain = 15;
|
||||
public static final int virtusDrain = 15;
|
||||
public static final int praesidiumDrain = 5;
|
||||
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone ritualStone)
|
||||
{
|
||||
@@ -44,8 +49,10 @@ public class RitualEffectWithering extends RitualEffect
|
||||
return;
|
||||
}
|
||||
|
||||
int range = 15;
|
||||
int vertRange = 15;
|
||||
boolean hasPraesidium = canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, false);
|
||||
|
||||
int range = 15 * (hasPraesidium ? 3 : 1);
|
||||
int vertRange = 15 * (hasPraesidium ? 3 : 1);
|
||||
|
||||
List<EntityLivingBase> list = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, range, vertRange);
|
||||
int entityCount = 0;
|
||||
@@ -56,13 +63,17 @@ public class RitualEffectWithering extends RitualEffect
|
||||
if (livingEntity instanceof EntityPlayer)
|
||||
{
|
||||
entityCount += 10;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
entityCount++;
|
||||
}
|
||||
}
|
||||
|
||||
int cost = getCostPerRefresh();
|
||||
boolean hasVirtus = canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false);
|
||||
|
||||
int cost = getCostPerRefresh() * (hasVirtus ? 3 : 1);
|
||||
int potency = hasVirtus ? 1 : 0;
|
||||
|
||||
if (currentEssence < cost * entityCount)
|
||||
{
|
||||
@@ -72,30 +83,50 @@ public class RitualEffectWithering extends RitualEffect
|
||||
{
|
||||
entityCount = 0;
|
||||
|
||||
for(EntityLivingBase livingEntity : list)
|
||||
boolean hasReductus = canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
|
||||
|
||||
for (EntityLivingBase livingEntity : list)
|
||||
{
|
||||
if(!(livingEntity instanceof EntityPlayer))
|
||||
hasReductus = hasReductus && canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false);
|
||||
if (hasReductus && !(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)
|
||||
PotionEffect effect = livingEntity.getActivePotionEffect(Potion.wither);
|
||||
if (effect == null || (effect != null && effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay))
|
||||
{
|
||||
if (!hasVirtus || (canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false)))
|
||||
{
|
||||
entityCount += 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
entityCount++;
|
||||
livingEntity.addPotionEffect(new PotionEffect(Potion.wither.id, timeDelay + 2, potency));
|
||||
if (hasReductus)
|
||||
{
|
||||
canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, true);
|
||||
}
|
||||
if (hasVirtus)
|
||||
{
|
||||
canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true);
|
||||
}
|
||||
|
||||
if (livingEntity instanceof EntityPlayer)
|
||||
{
|
||||
entityCount += 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
entityCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entityCount > 0)
|
||||
if(entityCount > 0)
|
||||
{
|
||||
if (hasPraesidium)
|
||||
{
|
||||
canDrainReagent(ritualStone, ReagentRegistry.praesidiumReagent, praesidiumDrain, true);
|
||||
}
|
||||
data.currentEssence = currentEssence - cost * entityCount;
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ public class TileOwned extends TileBloodArsenal
|
||||
{
|
||||
public String owner = "";
|
||||
public ArrayList<String> accessList = new ArrayList();
|
||||
public boolean safeToRemove = false;
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
@@ -53,4 +52,9 @@ public class TileOwned extends TileBloodArsenal
|
||||
{
|
||||
nbttagcompound.setString("owner", this.owner);
|
||||
}
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
return this.owner;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user