mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-27 15:33:06 +00:00
1.1-6 Update
This commit is contained in:
1 parent
79cdb45028
commit
35e4415b11
200 files changed
+115
-1805
No files matched your search
@@ -17,19 +17,14 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -53,9 +48,9 @@ public class BloodArsenal
|
||||
public static Potion bleeding;
|
||||
public static Potion swimming;
|
||||
|
||||
public static Item.ToolMaterial infusedWood = EnumHelper.addToolMaterial("InfusedWood", 1, 0, 4.0F, 1.0F, 0);
|
||||
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 4, 0, 10.0F, 4.0F, 0);
|
||||
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 6, 0, 16.0F, 9.0F, 0);
|
||||
public static Item.ToolMaterial infusedWood = EnumHelper.addToolMaterial("InfusedWood", 1, 0, 5.0F, 1.0F, 0);
|
||||
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 4, 0, 11.0F, 4.0F, 0);
|
||||
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 6, 0, 17.0F, 9.0F, 0);
|
||||
public static Item.ToolMaterial infusedNetherium = EnumHelper.addToolMaterial("InfusedNetherium", 9, 0, 31.0F, 18.0F, 0);
|
||||
|
||||
public static ItemArmor.ArmorMaterial vampireArmor = EnumHelper.addArmorMaterial("VampireArmor", 0, new int[]{2, 7, 4, 2}, 0);
|
||||
|
||||
@@ -31,6 +31,8 @@ import net.minecraftforge.event.entity.living.LivingHealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BloodArsenalEventHooks
|
||||
{
|
||||
public static double rand = Math.random();
|
||||
@@ -66,7 +68,7 @@ public class BloodArsenalEventHooks
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacked instanceof EntityPlayer)
|
||||
if (entityAttacked instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
selfSacrificeHandler(event);
|
||||
}
|
||||
@@ -82,7 +84,7 @@ public class BloodArsenalEventHooks
|
||||
{
|
||||
Entity killer = event.source.getEntity();
|
||||
|
||||
if (killer instanceof EntityPlayer)
|
||||
if (killer instanceof EntityPlayer && BloodArsenalConfig.baublesIntegration)
|
||||
{
|
||||
sacrificeHandler(event);
|
||||
}
|
||||
@@ -169,17 +171,22 @@ public class BloodArsenalEventHooks
|
||||
{
|
||||
Block block = event.block;
|
||||
EntityPlayer player = event.harvester;
|
||||
Random random = new Random();
|
||||
|
||||
if (player != null)
|
||||
if (!event.world.isRemote && !event.isSilkTouching)
|
||||
{
|
||||
if (block != null && block instanceof BlockGlass)
|
||||
if (player != null)
|
||||
{
|
||||
if (!event.isSilkTouching)
|
||||
if (block != null && block instanceof BlockGlass)
|
||||
{
|
||||
if (player.getCurrentEquippedItem().getItem() == Items.flint)
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint)
|
||||
{
|
||||
event.drops.add(new ItemStack(ModItems.glass_shard));
|
||||
event.dropChance = 0.75F;
|
||||
if (random.nextInt() + 5 < 8)
|
||||
{
|
||||
event.drops.add(new ItemStack(ModItems.glass_shard));
|
||||
}
|
||||
event.dropChance = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,14 +196,13 @@ public class BloodArsenalEventHooks
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
|
||||
{
|
||||
if (event.modID.equals("BloodArsenal"))
|
||||
if (event.modID.equals(BloodArsenal.MODID))
|
||||
{
|
||||
BloodArsenalConfig.syncConfig();
|
||||
BloodArsenal.logger.info("Refreshing configuration file");
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Baubles")
|
||||
private void sacrificeHandler(LivingDeathEvent event)
|
||||
{
|
||||
Entity killer = event.source.getEntity();
|
||||
@@ -247,7 +253,6 @@ public class BloodArsenalEventHooks
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Baubles")
|
||||
private void selfSacrificeHandler(LivingAttackEvent event)
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
|
||||
@@ -24,16 +24,16 @@ public class BloodArsenalRecipes
|
||||
{
|
||||
public static void registerAltarRecipes()
|
||||
{
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 5000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 10000, 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), 3, 72000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), new ItemStack(Blocks.iron_block), 3, 54000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.item_blood_cake), new ItemStack(Items.cake), 3, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 3, 8000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 3, 6000, 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, 80000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 75000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_cookie), new ItemStack(Items.cookie), 1, 2000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(Items.glowstone_dust), 3, 2500, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(Items.glowstone_dust), 3, 5000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_ball), new ItemStack(Items.snowball), 2, 500, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_money), new ItemStack(Items.paper), 4, 10000, 5, 5, false);
|
||||
}
|
||||
@@ -116,6 +116,7 @@ public class BloodArsenalRecipes
|
||||
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 1));
|
||||
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 2));
|
||||
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 3));
|
||||
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.baseAlchemyItems, 9, 27), new ItemStack(ModBlocks.blood_stone, 1, 4));
|
||||
//This is a long one
|
||||
addShapelessOreDictRecipe(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);
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.blood_infused_iron, 9), ModBlocks.blood_infused_iron_block);
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
public class BlockCompactRitual {
|
||||
}
|
||||
@@ -1,400 +0,0 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockInfusedIronDoor extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorUp;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorDown;
|
||||
|
||||
public BlockInfusedIronDoor()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(8.0F);
|
||||
setResistance(12.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
disableStats();
|
||||
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 world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side != 1 && side != 0)
|
||||
{
|
||||
int i1 = getFullMetadata(world, x, y, z);
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = (i1 & 4) != 0;
|
||||
boolean flag1 = false;
|
||||
boolean flag2 = (i1 & 8) != 0;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (j1 == 0 && side == 2)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && side == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && side == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && side == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (j1 == 0 && side == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && side == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && side == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && side == 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("BloodArsenal:blood_door_iron_upper");
|
||||
doorDown[0] = iconRegister.registerIcon("BloodArsenal:blood_door_iron_lower");
|
||||
doorUp[1] = new IconFlipped(doorUp[0], true, false);
|
||||
doorDown[1] = new IconFlipped(doorDown[0], true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random random, int j)
|
||||
{
|
||||
return (i & 8) != 0 ? null : (ModItems.item_blood_door_iron);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return ModItems.item_blood_door_iron;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int l = getFullMetadata(world, x, y, z);
|
||||
return (l & 4) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
setDoorRotation(getFullMetadata(world, x, y, z));
|
||||
}
|
||||
|
||||
public int getDoorOrientation(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return getFullMetadata(world, x, y, z) & 3;
|
||||
}
|
||||
|
||||
public boolean isDoorOpen(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return (getFullMetadata(world, x, y, z) & 4) != 0;
|
||||
}
|
||||
|
||||
private void setDoorRotation(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
String playerName = player.getCommandSenderName();
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity.owner.equals(null))
|
||||
{
|
||||
tileEntity.setOwner(playerName);
|
||||
player.addChatMessage(new ChatComponentTranslation("Door successfully bounded to you!"));
|
||||
}
|
||||
else if (tileEntity.owner.equals(playerName))
|
||||
{
|
||||
player.addChatMessage(new ChatComponentTranslation("Door is already bound to you!"));
|
||||
}
|
||||
else if (!tileEntity.owner.equals(playerName))
|
||||
{
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation("You feel an odd draining sensation as the door actively resists you."));
|
||||
player.setHealth(player.getHealth() - 1);
|
||||
|
||||
if (player.getHealth() <= 0.0005f)
|
||||
{
|
||||
player.onDeath(BloodArsenal.deathFromBlood);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
if (block != this)
|
||||
{
|
||||
onNeighborBlockChange(world, x, y - 1, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getFullMetadata(IBlockAccess block, int x, int y, int z)
|
||||
{
|
||||
int l = block.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l & 8) != 0;
|
||||
int i1;
|
||||
int j1;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
i1 = block.getBlockMetadata(x, y - 1, z);
|
||||
j1 = l;
|
||||
}
|
||||
else
|
||||
{
|
||||
i1 = l;
|
||||
j1 = block.getBlockMetadata(x, y + 1, z);
|
||||
}
|
||||
|
||||
boolean flag1 = (j1 & 1) != 0;
|
||||
return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
{
|
||||
return y < 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileOwned();
|
||||
}
|
||||
}
|
||||
@@ -1,460 +0,0 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.item.Item;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorUp;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] doorDown;
|
||||
|
||||
public BlockInfusedWoodenDoor()
|
||||
{
|
||||
super(Material.wood);
|
||||
setHardness(4.0F);
|
||||
setResistance(6.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
disableStats();
|
||||
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 world, int x, int y, int z, int side)
|
||||
{
|
||||
if (side != 1 && side != 0)
|
||||
{
|
||||
int i1 = getFullMetadata(world, x, y, z);
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = (i1 & 4) != 0;
|
||||
boolean flag1 = false;
|
||||
boolean flag2 = (i1 & 8) != 0;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (j1 == 0 && side == 2)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && side == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && side == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && side == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (j1 == 0 && side == 5)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 1 && side == 3)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 2 && side == 4)
|
||||
{
|
||||
flag1 = !flag1;
|
||||
}
|
||||
else if (j1 == 3 && side == 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("BloodArsenal:blood_door_wood_upper");
|
||||
doorDown[0] = iconRegister.registerIcon("BloodArsenal:blood_door_wood_lower");
|
||||
doorUp[1] = new IconFlipped(doorUp[0], true, false);
|
||||
doorDown[1] = new IconFlipped(doorDown[0], true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random random, int j)
|
||||
{
|
||||
return (i & 8) != 0 ? null : (ModItems.item_blood_door_wood);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return ModItems.item_blood_door_wood;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int par5, EntityPlayer player)
|
||||
{
|
||||
String playerHarvest = player.getCommandSenderName();
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
|
||||
if (player.capabilities.isCreativeMode && (par5 & 8) != 0 && world.getBlock(x, y - 1, z) == this)
|
||||
{
|
||||
world.setBlockToAir(x, y - 1, z);
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!(tileEntity.getOwner().equals(playerHarvest)))
|
||||
{
|
||||
player.setHealth(player.getHealth() - 8);
|
||||
player.addChatMessage(new ChatComponentText("You have severed a connection to the Soul Network!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
int l = getFullMetadata(world, x, y, z);
|
||||
return (l & 4) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
setDoorRotation(getFullMetadata(world, x, y, z));
|
||||
}
|
||||
|
||||
public int getDoorOrientation(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return getFullMetadata(world, x, y, z) & 3;
|
||||
}
|
||||
|
||||
public boolean isDoorOpen(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return (getFullMetadata(world, x, y, z) & 4) != 0;
|
||||
}
|
||||
|
||||
private void setDoorRotation(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
String playerName = player.getCommandSenderName();
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity.getOwner() == null)
|
||||
{
|
||||
tileEntity.setOwner(playerName);
|
||||
player.addChatMessage(new ChatComponentText("Door successfully bounded to you!"));
|
||||
}
|
||||
else if (tileEntity.getOwner().equals(playerName))
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("Door is already bound to you!"));
|
||||
}
|
||||
else if (!(tileEntity.getOwner().equals(playerName)))
|
||||
{
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
player.addChatMessage(new ChatComponentText("You feel an odd draining sensation as the door actively resists you."));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
tileEntity.setOwner(tileEntity.owner);
|
||||
|
||||
if (player.getCommandSenderName().equals(tileEntity.getOwner()))
|
||||
{
|
||||
int i1 = getFullMetadata(world, x, y, z);
|
||||
int j1 = i1 & 7;
|
||||
j1 ^= 4;
|
||||
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, tileEntity.owner);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(tileEntity.owner);
|
||||
worldSave.setItemData(tileEntity.owner, data);
|
||||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
|
||||
if (currentEssence < 10)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("You are too weak to open the door."));
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
SoulNetworkHandler.syphonFromNetwork(tileEntity.owner, 5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
player.addChatMessage(new ChatComponentText("You feel an odd draining sensation as the door actively resists you."));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
if (block != this)
|
||||
{
|
||||
onNeighborBlockChange(world, x, y - 1, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getFullMetadata(IBlockAccess block, int x, int y, int z)
|
||||
{
|
||||
int l = block.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l & 8) != 0;
|
||||
int i1;
|
||||
int j1;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
i1 = block.getBlockMetadata(x, y - 1, z);
|
||||
j1 = l;
|
||||
}
|
||||
else
|
||||
{
|
||||
i1 = l;
|
||||
j1 = block.getBlockMetadata(x, y + 1, z);
|
||||
}
|
||||
|
||||
boolean flag1 = (j1 & 1) != 0;
|
||||
return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
{
|
||||
return y < 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileOwned();
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.arc.bloodarsenal.entity.projectile;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityEnderPearl;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
|
||||
public class EntityEnderSigilPearl extends EntityEnderPearl
|
||||
{
|
||||
public EntityEnderSigilPearl(World par1World, EntityLivingBase par2EntityLivingBase)
|
||||
{
|
||||
super(par1World, par2EntityLivingBase);
|
||||
this.setSize(0.01F, 0.01F);
|
||||
}
|
||||
|
||||
public EntityEnderSigilPearl(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityEnderSigilPearl(World par1World, double par2, double par4, double par6)
|
||||
{
|
||||
super(par1World, par2, par4, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float func_70182_d()
|
||||
{
|
||||
return 1.2F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity()
|
||||
{
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
||||
{
|
||||
if (par1MovingObjectPosition.entityHit != null)
|
||||
{
|
||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian());
|
||||
}
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP)
|
||||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP)this.getThrower();
|
||||
if (entityplayermp.worldObj == this.worldObj)
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5);
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
|
||||
this.getThrower().fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,11 @@ import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.items.armor.VampireCostume;
|
||||
import com.arc.bloodarsenal.items.bauble.*;
|
||||
import com.arc.bloodarsenal.items.block.*;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilDivinity;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilEnder;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilSwimming;
|
||||
import com.arc.bloodarsenal.items.tool.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemReed;
|
||||
|
||||
|
||||
@@ -8,5 +8,6 @@ public class LifeImbuedArmor extends ItemArmor
|
||||
public LifeImbuedArmor(int armorType)
|
||||
{
|
||||
super(BloodArsenal.lifeImbuedArmor, 0, armorType);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
}
|
||||
@@ -55,24 +55,27 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
|
||||
String owner = par1ItemStack.stackTagCompound.getString("ownerName");
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
if (!owner.equals(""))
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (player instanceof EntityPlayer)
|
||||
if (!owner.equals(""))
|
||||
{
|
||||
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
|
||||
if (player instanceof EntityPlayer)
|
||||
{
|
||||
|
||||
if (!world.isRemote)
|
||||
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
|
||||
{
|
||||
if (this.getStoredLP(par1ItemStack) >= 50)
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
|
||||
}
|
||||
else if (this.getStoredLP(par1ItemStack) > 0)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, 0);
|
||||
if (this.getStoredLP(par1ItemStack) >= 50)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
|
||||
}
|
||||
else if (this.getStoredLP(par1ItemStack) > 0)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,19 +102,21 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
|
||||
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (getDamage(itemStack) == 1)
|
||||
{
|
||||
this.setDamage(itemStack, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDamage(itemStack, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (movingobjectposition == null || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS)
|
||||
{
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (getDamage(itemStack) == 1)
|
||||
{
|
||||
this.setDamage(itemStack, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDamage(itemStack, 1);
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -54,24 +54,26 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
|
||||
String owner = par1ItemStack.getTagCompound().getString("ownerName");
|
||||
World world = player.worldObj;
|
||||
|
||||
if (!owner.equals(""))
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (player instanceof EntityPlayer)
|
||||
if (!owner.equals(""))
|
||||
{
|
||||
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
|
||||
if (player instanceof EntityPlayer)
|
||||
{
|
||||
|
||||
if (!world.isRemote)
|
||||
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
|
||||
{
|
||||
if (this.getStoredLP(par1ItemStack) >= 50)
|
||||
if (!world.isRemote)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
|
||||
}
|
||||
else if (this.getStoredLP(par1ItemStack) > 0)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, 0);
|
||||
if (this.getStoredLP(par1ItemStack) >= 50)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
|
||||
}
|
||||
else if (this.getStoredLP(par1ItemStack) > 0)
|
||||
{
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
|
||||
setStoredLP(par1ItemStack, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,19 +100,21 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
|
||||
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (getDamage(itemStack) == 1)
|
||||
{
|
||||
this.setDamage(itemStack, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDamage(itemStack, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (movingobjectposition == null || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS)
|
||||
{
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (getDamage(itemStack) == 1)
|
||||
{
|
||||
this.setDamage(itemStack, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDamage(itemStack, 1);
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BloodDoor extends Item
|
||||
{
|
||||
private Material doorMaterial;
|
||||
|
||||
public BloodDoor(Material par1Material)
|
||||
{
|
||||
doorMaterial = par1Material;
|
||||
setMaxStackSize(64);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++y;
|
||||
Block block;
|
||||
|
||||
if (doorMaterial == Material.wood)
|
||||
{
|
||||
block = ModBlocks.blood_door_wood;
|
||||
}
|
||||
else
|
||||
{
|
||||
block = ModBlocks.blood_door_iron;
|
||||
}
|
||||
|
||||
if (player.canPlayerEdit(x, y, z, side, itemStack) && player.canPlayerEdit(x, y + 1, z, side, itemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(world, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
placeDoorBlock(world, x, y, z, i1, block);
|
||||
--itemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void placeDoorBlock(World world, int x, int y, int z, int side, Block block)
|
||||
{
|
||||
byte b0 = 0;
|
||||
byte b1 = 0;
|
||||
|
||||
if (side == 0)
|
||||
{
|
||||
b1 = 1;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
{
|
||||
b0 = -1;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
b1 = -1;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
int i1 = (world.getBlock(x - b0, y, z - b1).isNormalCube() ? 1 : 0) + (world.getBlock(x - b0, y + 1, z - b1).isNormalCube() ? 1 : 0);
|
||||
int j1 = (world.getBlock(x + b0, y, z + b1).isNormalCube() ? 1 : 0) + (world.getBlock(x + b0, y + 1, z + b1).isNormalCube() ? 1 : 0);
|
||||
boolean flag = world.getBlock(x - b0, y, z - b1) == block || world.getBlock(x - b0, y + 1, z - b1) == block;
|
||||
boolean flag1 = world.getBlock(x + b0, y, z + b1) == block || world.getBlock(x + b0, y + 1, z + b1) == block;
|
||||
boolean flag2 = false;
|
||||
|
||||
if (flag && !flag1)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
else if (j1 > i1)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, block, side, 2);
|
||||
world.setBlock(x, y + 1, z, block, 8 | (flag2 ? 1 : 0), 2);
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, block);
|
||||
world.notifyBlocksOfNeighborChange(x, y + 1, z, block);
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BloodDoorWood extends Item
|
||||
{
|
||||
private Material doorMaterial;
|
||||
|
||||
public BloodDoorWood(Material par1Material)
|
||||
{
|
||||
doorMaterial = par1Material;
|
||||
setMaxStackSize(64);
|
||||
setUnlocalizedName("item_blood_door_wood");
|
||||
setTextureName("BloodArsenal:item_blood_door_wood");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (par7 != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++y;
|
||||
Block block;
|
||||
|
||||
if (doorMaterial == Material.wood)
|
||||
{
|
||||
block = ModBlocks.blood_door_wood;
|
||||
}
|
||||
else
|
||||
{
|
||||
block = ModBlocks.blood_infused_iron_block;
|
||||
}
|
||||
|
||||
if (player.canPlayerEdit(x, y, z, par7, itemStack) && player.canPlayerEdit(x, y + 1, z, par7, itemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(world, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
placeDoorBlock(world, x, y, z, i1, block);
|
||||
--itemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void placeDoorBlock(World world, int x, int y, int z, int par4, Block block)
|
||||
{
|
||||
byte b0 = 0;
|
||||
byte b1 = 0;
|
||||
|
||||
if (par4 == 0)
|
||||
{
|
||||
b1 = 1;
|
||||
}
|
||||
|
||||
if (par4 == 1)
|
||||
{
|
||||
b0 = -1;
|
||||
}
|
||||
|
||||
if (par4 == 2)
|
||||
{
|
||||
b1 = -1;
|
||||
}
|
||||
|
||||
if (par4 == 3)
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
int i1 = (world.getBlock(x - b0, y, z - b1).isNormalCube() ? 1 : 0) + (world.getBlock(x - b0, y + 1, z - b1).isNormalCube() ? 1 : 0);
|
||||
int j1 = (world.getBlock(x + b0, y, z + b1).isNormalCube() ? 1 : 0) + (world.getBlock(x + b0, y + 1, z + b1).isNormalCube() ? 1 : 0);
|
||||
boolean flag = world.getBlock(x - b0, y, z - b1) == block || world.getBlock(x - b0, y + 1, z - b1) == block;
|
||||
boolean flag1 = world.getBlock(x + b0, y, z + b1) == block || world.getBlock(x + b0, y + 1, z + b1) == block;
|
||||
boolean flag2 = false;
|
||||
|
||||
if (flag && !flag1)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
else if (j1 > i1)
|
||||
{
|
||||
flag2 = true;
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, block, par4, 2);
|
||||
world.setBlock(x, y + 1, z, block, 8 | (flag2 ? 1 : 0), 2);
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, block);
|
||||
world.notifyBlocksOfNeighborChange(x, y + 1, z, block);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.arc.bloodarsenal.items.sigil;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
@@ -17,34 +16,7 @@ public class EnderSigilUtils
|
||||
float var17 = MathHelper.sin(-pitch * 0.01745329F);
|
||||
float var18 = var15 * var16;
|
||||
float var20 = var14 * var16;
|
||||
double var21 = range;
|
||||
Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21);
|
||||
|
||||
return world.func_147447_a(var13, var23, par3, !par3, false);
|
||||
}
|
||||
|
||||
public static MovingObjectPosition getTargetBlock(World world, Entity entity, boolean par3)
|
||||
{
|
||||
float var4 = 1.0F;
|
||||
float var5 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * var4;
|
||||
|
||||
float var6 = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * var4;
|
||||
|
||||
double var7 = entity.prevPosX + (entity.posX - entity.prevPosX) * var4;
|
||||
|
||||
double var9 = entity.prevPosY + (entity.posY - entity.prevPosY) * var4 + 1.62D - entity.getYOffset();//field_70129_M
|
||||
|
||||
double var11 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * var4;
|
||||
|
||||
Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11);
|
||||
float var14 = MathHelper.cos(-var6 * 0.01745329F - 3.141593F);
|
||||
float var15 = MathHelper.sin(-var6 * 0.01745329F - 3.141593F);
|
||||
float var16 = -MathHelper.cos(-var5 * 0.01745329F);
|
||||
float var17 = MathHelper.sin(-var5 * 0.01745329F);
|
||||
float var18 = var15 * var16;
|
||||
float var20 = var14 * var16;
|
||||
double var21 = 10.0D;
|
||||
Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21);
|
||||
Vec3 var23 = var13.addVector(var18 * range, var17 * range, var20 * range);
|
||||
|
||||
return world.func_147447_a(var13, var23, par3, !par3, false);
|
||||
}
|
||||
|
||||
@@ -42,9 +42,7 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(itemStack, player);
|
||||
|
||||
double playerPrevX = player.prevPosX;
|
||||
double playerPrevY = player.prevPosY;
|
||||
double playerPrevZ = player.prevPosZ;
|
||||
Vec3 playerPrevPos = Vec3.createVectorHelper(player.prevPosX, player.prevPosY, player.prevPosZ);
|
||||
|
||||
if (itemStack.stackTagCompound == null)
|
||||
{
|
||||
@@ -86,26 +84,23 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
break;
|
||||
}
|
||||
|
||||
player.setVelocity(0.0D, 0.0D, 0.0D);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(ex, wy, zee);
|
||||
double distance = playerPrevPos.distanceTo(vec3);
|
||||
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
|
||||
for (int k = 0; k < 8; ++k)
|
||||
if (EnergyItems.getCurrentEssence(itemStack.getTagCompound().getString("ownerName")) >= distance * 200 || player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.spawnParticle("portal", player.posX + (world.rand.nextDouble() - 0.5D) * (double)player.width, player.posY + world.rand.nextDouble() * (double)player.height - 0.25D, player.posZ + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0);
|
||||
for (int k = 0; k < 8; ++k)
|
||||
{
|
||||
world.spawnParticle("portal", player.posX + (world.rand.nextDouble() - 0.5D) * (double)player.width, player.posY + world.rand.nextDouble() * (double)player.height - 0.25D, player.posZ + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0);
|
||||
world.spawnParticle("portal", ex + (world.rand.nextDouble() - 0.5D) * (double)player.width, wy + world.rand.nextDouble() * (double) player.height - 0.25D, zee + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0);
|
||||
}
|
||||
|
||||
player.setPositionAndUpdate(ex, wy, zee);
|
||||
EnergyItems.syphonBatteries(itemStack, player, (int) distance * 250);
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
player.swingItem();
|
||||
player.setVelocity(0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
double xDifference = (Math.abs(player.posX) < Math.abs(playerPrevX) ? Math.abs(playerPrevX) - Math.abs(player.posX) : Math.abs(player.posX) - Math.abs(playerPrevX));
|
||||
double yDifference = (Math.abs(player.posY) < Math.abs(playerPrevY) ? Math.abs(playerPrevY) - Math.abs(player.posY) : Math.abs(player.posY) - Math.abs(playerPrevY));
|
||||
double zDifference = (Math.abs(player.posZ) < Math.abs(playerPrevZ) ? Math.abs(playerPrevZ) - Math.abs(player.posZ) : Math.abs(player.posZ) - Math.abs(playerPrevZ));
|
||||
Vec3 vec3 = Vec3.createVectorHelper(playerPrevX, playerPrevY, playerPrevZ);
|
||||
Vec3 newVec3 = Vec3.createVectorHelper(player.posX, player.posY, player.posZ);
|
||||
int distance = (int) vec3.distanceTo(newVec3);
|
||||
EnergyItems.syphonBatteries(itemStack, player, 2000); //This will not be for long!
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentText("this: " + newVec3 + " " + vec3));
|
||||
player.setPositionAndUpdate(ex, wy, zee);
|
||||
player.swingItem();
|
||||
}
|
||||
}
|
||||
else if (!player.isSneaking())
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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 java.util.List;
|
||||
|
||||
public class BoundFlintAndSteel extends Item implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
|
||||
public BoundFlintAndSteel()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("bound_flint_and_steel");
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(50);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@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 boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int hitSide, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
NBTTagCompound tag = itemStack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(itemStack, player, 50);
|
||||
}
|
||||
|
||||
if (hitSide == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
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
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
|
||||
}
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public 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("Burning souls...");
|
||||
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_flint_and_steel");
|
||||
active = iconRegister.registerIcon("BloodArsenal:bound_flint_and_steel");
|
||||
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionBleeding extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionBleeding(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionSoulBurn extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionSoulBurn(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionSwimming extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionSwimming(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionVampiricAura extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionVampiricAura(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
package com.arc.bloodarsenal.renderer.block.item;
|
||||
|
||||
import com.arc.bloodarsenal.renderer.model.ModelLifeInfuser;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TileLifeInfuserItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelLifeInfuser modelLifeInfuser;
|
||||
|
||||
public TileLifeInfuserItemRenderer()
|
||||
{
|
||||
modelLifeInfuser = new ModelLifeInfuser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
float scale = 0.08f;
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderLifeInfuser((RenderBlocks) data[0], item, 0, 0, 0, scale);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderLifeInfuser((RenderBlocks) data[0], item, 0, 0, 0.5f, scale);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderLifeInfuser((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderLifeInfuser((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderLifeInfuser(RenderBlocks render, ItemStack item, float x, float y, float z, float scale)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
ResourceLocation test = new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
modelLifeInfuser.renderLifeInfuser();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
public class TileCompactRitual {
|
||||
}
|
||||
@@ -542,11 +542,6 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
return new FluidTankInfo[]{compositeTank.getInfo()};
|
||||
}
|
||||
|
||||
public int getBufferCapacity()
|
||||
{
|
||||
return bufferCapacity;
|
||||
}
|
||||
|
||||
public int[] buildFluidList()
|
||||
{
|
||||
int[] sortList = new int[4];
|
||||
@@ -558,7 +553,7 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[0] = this.fluid.fluidID;
|
||||
sortList[0] = this.fluid.getFluid().getID();
|
||||
sortList[1] = this.fluid.amount;
|
||||
}
|
||||
|
||||
@@ -569,7 +564,7 @@ public class TileLPMaterializer extends TileEntity implements IInventory, IFluid
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[2] = this.fluidOutput.fluidID;
|
||||
sortList[2] = this.fluidOutput.getFluid().getID();
|
||||
sortList[3] = this.fluidOutput.amount;
|
||||
}
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (resource.fluidID != (fluidInput).fluidID)
|
||||
if (resource.getFluid().getID() != (fluidInput).getFluid().getID())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -567,7 +567,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[0] = this.fluid.fluidID;
|
||||
sortList[0] = this.fluid.getFluid().getID();
|
||||
sortList[1] = this.fluid.amount;
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTan
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[2] = this.fluidInput.fluidID;
|
||||
sortList[2] = this.fluidInput.getFluid().getID();
|
||||
sortList[3] = this.fluidInput.amount;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileOwned extends TileEntity
|
||||
{
|
||||
public String owner;
|
||||
|
||||
public TileOwned()
|
||||
{
|
||||
owner = "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setOwner(String owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.readFromNBT(tag);
|
||||
this.owner = tag.getString("owner");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.writeToNBT(tag);
|
||||
tag.setString("owner", owner);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
|
||||
{
|
||||
super.onDataPacket(net, pkt);
|
||||
readCustomNBT(pkt.func_148857_g());
|
||||
}
|
||||
}
|
||||
@@ -576,7 +576,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (resource.fluidID != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).fluidID)
|
||||
if (resource.getFluid().getID() != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).getFluid().getID())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1097,7 +1097,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[0] = this.fluid.fluidID;
|
||||
sortList[0] = this.fluid.getFluid().getID();
|
||||
sortList[1] = this.fluid.amount;
|
||||
}
|
||||
|
||||
@@ -1108,7 +1108,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[2] = this.fluidInput.fluidID;
|
||||
sortList[2] = this.fluidInput.getFluid().getID();
|
||||
sortList[3] = this.fluidInput.amount;
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ public class TilePortableAltar extends TileEntity implements IInventory, IFluidT
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[4] = this.fluidOutput.fluidID;
|
||||
sortList[4] = this.fluidOutput.getFluid().getID();
|
||||
sortList[5] = this.fluidOutput.amount;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user