mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-28 07:55:36 +00:00
Localized tooltips
And other stuffs...
This commit is contained in:
1 parent
727190b6c8
commit
69391a031b
38 files changed
+1822
-128
No files matched your search
@@ -17,6 +17,7 @@ import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
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;
|
||||
@@ -77,6 +78,7 @@ public class BloodArsenal
|
||||
|
||||
ModBlocks.init();
|
||||
ModBlocks.registerBlocksInPre();
|
||||
ModBlocks.registerTileEntities();
|
||||
|
||||
ModItems.init();
|
||||
ModItems.registerItems();
|
||||
@@ -129,7 +131,7 @@ public class BloodArsenal
|
||||
proxy.registerEvents();
|
||||
|
||||
vampiricAura = new PotionVampiricAura(BloodArsenalConfig.vampiricAuraID, false, 0).setIconIndex(0, 0).setPotionName("Vampiric Aura");
|
||||
bleeding = new PotionVampiricAura(BloodArsenalConfig.bleedingID, false, 0).setIconIndex(1, 0).setPotionName("Bleeding");
|
||||
bleeding = new PotionVampiricAura(BloodArsenalConfig.bleedingID, true, 0).setIconIndex(1, 0).setPotionName("Bleeding");
|
||||
swimming = new PotionVampiricAura(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(2, 0).setPotionName("Swimming");
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class BloodArsenalRecipes
|
||||
@@ -20,7 +21,6 @@ public class BloodArsenalRecipes
|
||||
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), 3, 72000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_torch), new ItemStack(Blocks.torch), 2, 1000, 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_orange), new ItemStack(Items.dye, 1, 14), 1, 200, 5, 5, false);
|
||||
@@ -37,7 +37,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));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_igniter), new ItemStack(Items.flint_and_steel));
|
||||
//Temporary
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_cape), new ItemStack(Items.leather_chestplate));
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_greaves), new ItemStack(Items.leather_leggings));
|
||||
@@ -114,13 +114,12 @@ public class BloodArsenalRecipes
|
||||
{
|
||||
// GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.vampire_ring),"ab ", "bcb", " b ", 'a', ModItems.blood_infused_diamond_bound, 'b', Blocks.stone, 'c', masterOrb));
|
||||
// GameRegistry.addRecipe(new ItemStack(ModItems.self_sacrifice_amulet), "a", 'a', new ItemStack(Items.slime_ball));
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
ItemStack flintSteel = new ItemStack(ModItems.bound_flint_and_steel, 1, craftingConstant);
|
||||
ItemStack igniter = new ItemStack(ModItems.bound_igniter);
|
||||
|
||||
// GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_torch, 2), "a", "b", 'a', flintSteel, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_torch), "a", "b", 'a', igniter, 'b', ModItems.blood_infused_stick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,14 @@ import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityEnderSigilPearl;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.renderer.block.TileLifeInfuserRenderer;
|
||||
import com.arc.bloodarsenal.renderer.block.item.TileLifeInfuserItemRenderer;
|
||||
import com.arc.bloodarsenal.renderer.item.ItemRenderGatling;
|
||||
import com.arc.bloodarsenal.renderer.projectile.RenderEntityBloodBall;
|
||||
import com.arc.bloodarsenal.renderer.projectile.RenderEntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.renderer.block.TilePortableAltarRenderer;
|
||||
import com.arc.bloodarsenal.renderer.block.item.TilePortableAltarItemRenderer;
|
||||
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
@@ -26,9 +29,6 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public static int renderPass;
|
||||
public static int altarRenderType;
|
||||
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
@@ -40,11 +40,7 @@ public class ClientProxy extends CommonProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnderSigilPearl.class, new RenderSnowball(Items.ender_pearl));
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePortableAltar.class, new TilePortableAltarRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEntities()
|
||||
{
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLifeInfuser.class, new TileLifeInfuserRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,5 +59,6 @@ public class ClientProxy extends CommonProxy
|
||||
public void initRendering()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.portable_altar), new TilePortableAltarItemRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.life_infuser), new TileLifeInfuserItemRenderer());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import com.arc.bloodarsenal.entity.EntityBloodTNT;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy
|
||||
@@ -26,7 +28,13 @@ public class CommonProxy
|
||||
|
||||
public void registerTileEntities()
|
||||
{
|
||||
GameRegistry.registerTileEntity(TilePortableAltar.class, "containerPortableAltar");
|
||||
}
|
||||
|
||||
public void registerEntityTrackers()
|
||||
{
|
||||
EntityRegistry.registerModEntity(EntityGatlingProjectile.class, "gatlingProjectile", 0, BloodArsenal.instance, 128, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityBloodTNT.class, "bloodTNT", 1, BloodArsenal.instance, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityBloodBall.class, "bloodBall", 2, BloodArsenal.instance, 128, 5, true);
|
||||
}
|
||||
|
||||
public void initRendering()
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
public class BlockCompactRitual {
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.*;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.event.RitualActivatedEvent;
|
||||
import WayofTime.alchemicalWizardry.api.event.RitualRunEvent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.tileentity.TileCompacter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCompacter extends BlockContainer
|
||||
{
|
||||
public BlockCompacter()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("compacter");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y + 1, z);
|
||||
|
||||
if (tile instanceof TEMasterStone)
|
||||
{
|
||||
TEMasterStone ritualStone = new TEMasterStone();
|
||||
|
||||
if (!ritualStone.getCurrentRitual().isEmpty())
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("It worked"));
|
||||
String ritualName = ritualStone.getCurrentRitual();
|
||||
|
||||
if (ritualStone.getCurrentRitual().equals(ritualName))
|
||||
{
|
||||
|
||||
//ritualStone.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("It failed"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileCompacter();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLifeInfuser extends BlockContainer
|
||||
{
|
||||
public BlockLifeInfuser()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("life_infuser");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(6.0F);
|
||||
setResistance(12.0F);
|
||||
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.875F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TileLifeInfuser tileEntity = (TileLifeInfuser) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
ItemStack bucket = new ItemStack(Items.bucket);
|
||||
|
||||
if (tileEntity.getStackInSlot(0) == null && playerItem != null && !(playerItem.getItem() instanceof IBloodOrb))
|
||||
{
|
||||
if (playerItem.getItem().equals(ModItems.divinationSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
{
|
||||
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem);
|
||||
|
||||
if (item != null && item.getItem().equals(ModItems.divinationSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (playerItem.getItem().equals(ModItems.bucketLife))
|
||||
{
|
||||
--playerItem.stackSize;
|
||||
player.inventory.addItemStackToInventory(bucket);
|
||||
|
||||
tileEntity.fillMainTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
}
|
||||
}
|
||||
else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
}
|
||||
|
||||
if (tileEntity.getStackInSlot(1) != null && playerItem != null)
|
||||
{
|
||||
if (playerItem.getItem() instanceof IBloodOrb)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(1, newItem);
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack item = inventory.getStackInSlot(i);
|
||||
|
||||
if (item != null && item.stackSize > 0)
|
||||
{
|
||||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = rand.nextGaussian() * factor;
|
||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
item.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileLifeInfuser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.items.block.BloodStoneBlock;
|
||||
import com.arc.bloodarsenal.tileentity.TileCompacter;
|
||||
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@@ -22,6 +26,8 @@ public class ModBlocks
|
||||
public static Block blood_lamp;
|
||||
public static Block blood_infused_diamond_block;
|
||||
public static BlockPortableAltar portable_altar;
|
||||
public static Block life_infuser;
|
||||
public static Block compacter;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
@@ -41,25 +47,37 @@ public class ModBlocks
|
||||
blood_lamp = new BlockBloodLamp();
|
||||
blood_infused_diamond_block = new BlockBloodInfusedDiamond();
|
||||
portable_altar = new BlockPortableAltar();
|
||||
life_infuser = new BlockLifeInfuser();
|
||||
compacter = new BlockCompacter();
|
||||
}
|
||||
|
||||
public static void registerBlocksInPre()
|
||||
{
|
||||
GameRegistry.registerBlock(ModBlocks.blood_stone, BloodStoneBlock.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");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_door_iron, "blood_door_iron");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_cake, "blood_cake");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_torch, "blood_torch");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_glowstone, "blood_infused_glowstone");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_lamp, "blood_lamp");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_diamond_block, "blood_infused_diamond_block");
|
||||
GameRegistry.registerBlock(ModBlocks.portable_altar, "portable_altar");
|
||||
GameRegistry.registerBlock(blood_stone, BloodStoneBlock.class, "BloodArsenal" + (ModBlocks.blood_stone.getUnlocalizedName().substring(5)));
|
||||
GameRegistry.registerBlock(blood_tnt, "blood_tnt");
|
||||
GameRegistry.registerBlock(blood_stained_glass, "blood_stained_glass");
|
||||
GameRegistry.registerBlock(blood_infused_wood, "blood_infused_wood");
|
||||
GameRegistry.registerBlock(blood_infused_planks, "blood_infused_planks");
|
||||
GameRegistry.registerBlock(blood_stained_ice, "blood_stained_ice");
|
||||
GameRegistry.registerBlock(blood_stained_ice_packed, "blood_stained_ice_packed");
|
||||
GameRegistry.registerBlock(blood_infused_iron_block, "blood_infused_iron_block");
|
||||
GameRegistry.registerBlock(blood_door_wood, "blood_door_wood");
|
||||
GameRegistry.registerBlock(blood_door_iron, "blood_door_iron");
|
||||
GameRegistry.registerBlock(blood_cake, "blood_cake");
|
||||
GameRegistry.registerBlock(blood_torch, "blood_torch");
|
||||
GameRegistry.registerBlock(blood_infused_glowstone, "blood_infused_glowstone");
|
||||
GameRegistry.registerBlock(blood_lamp, "blood_lamp");
|
||||
GameRegistry.registerBlock(blood_infused_diamond_block, "blood_infused_diamond_block");
|
||||
GameRegistry.registerBlock(portable_altar, "portable_altar");
|
||||
GameRegistry.registerBlock(life_infuser, "life_infuser");
|
||||
GameRegistry.registerBlock(compacter, "compacter");
|
||||
}
|
||||
|
||||
public static void registerTileEntities()
|
||||
{
|
||||
GameRegistry.registerTileEntity(TileOwned.class, "blood_infused_door");
|
||||
GameRegistry.registerTileEntity(TilePortableAltar.class, "container_portable_altar");
|
||||
GameRegistry.registerTileEntity(TileLifeInfuser.class, "container_life_infuser");
|
||||
GameRegistry.registerTileEntity(TileCompacter.class, "compacter_tile");
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -70,31 +71,31 @@ public class ItemBloodArsenal extends Item
|
||||
{
|
||||
if (this.equals(ModItems.amorphic_catalyst))
|
||||
{
|
||||
par3List.add("A coagulated mess");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.amorphic_catalyst"));
|
||||
}
|
||||
if (this.equals(ModItems.blood_infused_stick))
|
||||
{
|
||||
par3List.add("A stick infused with life!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_stick"));
|
||||
}
|
||||
if (this.equals(ModItems.blood_infused_iron))
|
||||
{
|
||||
par3List.add("Mundane iron infused");
|
||||
par3List.add("with life essence");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_iron1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_iron2"));
|
||||
}
|
||||
if (this.equals(ModItems.heart))
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
par3List.add("Bright red in color");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.heart1"));
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Fresh from a body");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.heart2"));
|
||||
}
|
||||
}
|
||||
if (this.equals(ModItems.soul_fragment))
|
||||
{
|
||||
par3List.add("The raw essence of a soul");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_fragment"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,7 +25,7 @@ public class ItemBloodCookie extends ItemFood
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A sugary treat");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_cookie"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemBloodMoney extends Item
|
||||
{
|
||||
public ItemBloodMoney()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,6 +21,6 @@ public class ItemBloodOrange extends ItemFood
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Completely organic");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_orange"));
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -108,8 +109,8 @@ public class ItemSoulBooster extends Item implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Used to increase the");
|
||||
par3List.add("soul's abilities");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_booster1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_booster2"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -133,8 +134,8 @@ public class ItemSoulNullifier extends Item implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Used to nullify the");
|
||||
par3List.add("soul's unnatural abilities");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_nullifier1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_nullifier2"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ModItems
|
||||
public static Item soul_fragment;
|
||||
public static Item item_blood_door_wood;
|
||||
public static Item item_blood_door_iron;
|
||||
public static Item bound_flint_and_steel;
|
||||
public static Item bound_igniter;
|
||||
public static Item soul_booster;
|
||||
public static Item soul_nullifier;
|
||||
public static Item blood_cookie;
|
||||
@@ -93,7 +93,7 @@ public class ModItems
|
||||
soul_fragment = new ItemBloodArsenal().setUnlocalizedName("soul_fragment");
|
||||
item_blood_door_wood = new BloodDoor(Material.wood).setUnlocalizedName("item_blood_door_wood").setTextureName("BloodArsenal:item_blood_door_wood");
|
||||
item_blood_door_iron = new BloodDoor(Material.iron).setUnlocalizedName("item_blood_door_iron").setTextureName("BloodArsenal:item_blood_door_iron");
|
||||
bound_flint_and_steel = new BoundFlintAndSteel();
|
||||
bound_igniter = new BoundIgniter();
|
||||
soul_booster = new ItemSoulBooster();
|
||||
soul_nullifier = new ItemSoulNullifier();
|
||||
blood_cookie = new ItemBloodCookie();
|
||||
@@ -142,7 +142,7 @@ public class ModItems
|
||||
GameRegistry.registerItem(item_blood_door_wood, "item_blood_door_wood");
|
||||
GameRegistry.registerItem(item_blood_door_iron, "item_blood_door_iron");
|
||||
GameRegistry.registerItem(item_blood_cake, "item_blood_cake");
|
||||
GameRegistry.registerItem(bound_flint_and_steel, "bound_flint_and_steel");
|
||||
GameRegistry.registerItem(bound_igniter, "bound_flint_and_steel");
|
||||
GameRegistry.registerItem(soul_booster, "soul_booster");
|
||||
GameRegistry.registerItem(soul_nullifier, "soul_nullfier");
|
||||
GameRegistry.registerItem(blood_cookie, "blood_cookie");
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -38,7 +39,7 @@ public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindab
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("May the Divines protect you!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.divinity"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.item.EntityEnderPearl;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,7 +28,8 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Sticking your hand into the End");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.ender1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.ender2"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -37,7 +38,7 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Just keep swimming!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.swimming"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
@@ -245,7 +246,7 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Let Demon arrows fly!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_bow"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
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.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BoundIgniter extends Item implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
|
||||
public BoundIgniter()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("bound_igniter");
|
||||
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(StatCollector.translateToLocal("tooltip.tool.bound_igniter"));
|
||||
|
||||
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
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem(ItemStack stack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@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");
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
|
||||
@@ -163,9 +164,8 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Demonic solution");
|
||||
par3List.add("to an overgrown lawn");
|
||||
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_shears1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_shears2"));
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
@@ -131,8 +132,8 @@ public class BoundSickle extends ItemTool implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Hacking plants down");
|
||||
par3List.add("like a demon!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_sickle1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_sickle2"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -141,7 +142,7 @@ public class EnergyGatling extends EnergyItems implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Point and click");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.energy_gatling"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,17 +60,17 @@ public class InfusedDiamond extends Item
|
||||
{
|
||||
if (equals(ModItems.blood_infused_diamond_unactive))
|
||||
{
|
||||
par3List.add("Diamond needs to");
|
||||
par3List.add("be activated");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_inactive1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_inactive2"));
|
||||
}
|
||||
if (equals(ModItems.blood_infused_diamond_active))
|
||||
{
|
||||
par3List.add("Diamond infused");
|
||||
par3List.add("with life energy");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_active1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_active2"));
|
||||
}
|
||||
if (equals(ModItems.blood_infused_diamond_bound))
|
||||
{
|
||||
par3List.add("Diamond of Life");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_bound"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -39,7 +40,7 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Demonic deforestation!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_axe"));
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -47,7 +48,7 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A handheld quarry");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_pickaxe"));
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -34,7 +35,7 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Diggy diggy hole!");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_shovel"));
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,7 +37,7 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Cuts easily through flesh");
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_sword"));
|
||||
|
||||
if (par1ItemStack.getItemDamage() == 0)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.arc.bloodarsenal.renderer.block;
|
||||
|
||||
import com.arc.bloodarsenal.renderer.model.ModelLifeInfuser;
|
||||
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelLifeInfuser modelLifeInfuser = new ModelLifeInfuser();
|
||||
private final RenderItem customRenderItem;
|
||||
|
||||
public TileLifeInfuserRenderer()
|
||||
{
|
||||
customRenderItem = new RenderItem()
|
||||
{
|
||||
@Override
|
||||
public boolean shouldBob()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
customRenderItem.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
||||
{
|
||||
if (tileEntity instanceof TileLifeInfuser)
|
||||
{
|
||||
TileLifeInfuser tile = (TileLifeInfuser) tileEntity;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
this.modelLifeInfuser.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (tile.getStackInSlot(0) != null)
|
||||
{
|
||||
float scaleFactor = getGhostItemScaleFactor(tile.getStackInSlot(0));
|
||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||
EntityItem ghostEntityItem = new EntityItem(tile.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tile.getStackInSlot(0));
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.25F, (float) d2 + 0.5F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.25F, (float) d2 + 0.5F);
|
||||
}
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private float getGhostItemScaleFactor(ItemStack itemStack)
|
||||
{
|
||||
float scaleFactor = 1.0F;
|
||||
|
||||
if (itemStack != null)
|
||||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F;
|
||||
|
||||
case 2:
|
||||
return 0.90F;
|
||||
|
||||
case 3:
|
||||
return 0.90F;
|
||||
|
||||
case 4:
|
||||
return 0.90F;
|
||||
|
||||
case 5:
|
||||
return 0.80F;
|
||||
|
||||
default:
|
||||
return 0.90F;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F;
|
||||
|
||||
case 2:
|
||||
return 0.65F;
|
||||
|
||||
case 3:
|
||||
return 0.65F;
|
||||
|
||||
case 4:
|
||||
return 0.65F;
|
||||
|
||||
default:
|
||||
return 0.65F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return scaleFactor;
|
||||
}
|
||||
|
||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
||||
{
|
||||
if (ghostItemStack != null)
|
||||
{
|
||||
if (ghostItemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (forgeDirection)
|
||||
{
|
||||
case DOWN:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UP:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case NORTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F);
|
||||
return;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F);
|
||||
return;
|
||||
}
|
||||
|
||||
case EAST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case WEST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UNKNOWN:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (forgeDirection)
|
||||
{
|
||||
case DOWN:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UP:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case NORTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F);
|
||||
return;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F);
|
||||
return;
|
||||
}
|
||||
|
||||
case EAST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case WEST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UNKNOWN:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
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,8 +1,13 @@
|
||||
package com.arc.bloodarsenal.renderer.model;
|
||||
|
||||
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* LifeInfuser - Arcaratus
|
||||
@@ -10,6 +15,10 @@ import net.minecraft.entity.Entity;
|
||||
*/
|
||||
public class ModelLifeInfuser extends ModelBase
|
||||
{
|
||||
private static final ResourceLocation texture = new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
|
||||
|
||||
private IModelCustom modelLifeInfuser;
|
||||
|
||||
public ModelRenderer Base;
|
||||
public ModelRenderer Pillar1;
|
||||
public ModelRenderer Pillar2;
|
||||
@@ -59,6 +68,28 @@ public class ModelLifeInfuser extends ModelBase
|
||||
this.Pillar1.render(f5);
|
||||
}
|
||||
|
||||
public void renderLifeInfuser()
|
||||
{
|
||||
modelLifeInfuser.renderAll();
|
||||
}
|
||||
|
||||
public void renderLifeInfuser(TileLifeInfuser lifeInfuser, double x, double y, double z)
|
||||
{
|
||||
float scale = 0.1f;
|
||||
// Push a blank matrix onto the stack
|
||||
GL11.glPushMatrix();
|
||||
// Move the object into the correct position on the block (because the OBJ's origin is the center of the object)
|
||||
GL11.glTranslatef((float) x + 0.5f, (float) y, (float) z + 0.5f);
|
||||
// Scale our object to about half-size in all directions (the OBJ file is a little large)
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
// Bind the texture, so that OpenGL properly textures our block.
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
|
||||
// Render the object, using modelTutBox.renderAll();
|
||||
this.renderLifeInfuser();
|
||||
// Pop this matrix from the stack.
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
|
||||
@@ -40,8 +40,9 @@ public enum PacketHandler
|
||||
{
|
||||
FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT);
|
||||
|
||||
String tileAltarCodec = clientChannel.findChannelHandlerNameForType(TilePortableAltarCodec.class);
|
||||
clientChannel.pipeline().addAfter(tileAltarCodec, "TlePortableAltarHandler", new TilePortableAltarMessageHandler());
|
||||
String tileCodec = clientChannel.findChannelHandlerNameForType(TilePortableAltarCodec.class);
|
||||
clientChannel.pipeline().addAfter(tileCodec, "TilePortableAltarHandler", new TilePortableAltarMessageHandler());
|
||||
clientChannel.pipeline().addAfter(tileCodec, "TileLifeInfuserHandler", new TileLifeInfuserMessageHandler());
|
||||
}
|
||||
|
||||
private static class TilePortableAltarMessageHandler extends SimpleChannelInboundHandler<TilePortableAltarMessage>
|
||||
@@ -60,6 +61,22 @@ public enum PacketHandler
|
||||
}
|
||||
}
|
||||
|
||||
private static class TileLifeInfuserMessageHandler extends SimpleChannelInboundHandler<TileLifeInfuserMessage>
|
||||
{
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, TileLifeInfuserMessage msg) throws Exception
|
||||
{
|
||||
World world = BloodArsenal.proxy.getClientWorld();
|
||||
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
|
||||
if (te instanceof TileLifeInfuser)
|
||||
{
|
||||
TileLifeInfuser tile = (TileLifeInfuser) te;
|
||||
|
||||
tile.handlePacketData(msg.items, msg.fluids, msg.capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class BAMessage
|
||||
{
|
||||
int index;
|
||||
@@ -76,11 +93,23 @@ public enum PacketHandler
|
||||
int capacity;
|
||||
}
|
||||
|
||||
public static class TileLifeInfuserMessage extends BAMessage
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
int[] items;
|
||||
int[] fluids;
|
||||
int capacity;
|
||||
}
|
||||
|
||||
private class TilePortableAltarCodec extends FMLIndexedMessageToMessageCodec<BAMessage>
|
||||
{
|
||||
public TilePortableAltarCodec()
|
||||
{
|
||||
addDiscriminator(0, TilePortableAltarMessage.class);
|
||||
addDiscriminator(1, TileLifeInfuserMessage.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,33 +117,70 @@ public enum PacketHandler
|
||||
{
|
||||
target.writeInt(msg.index);
|
||||
|
||||
target.writeInt(((TilePortableAltarMessage) msg).x);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).y);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).z);
|
||||
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).items != null);
|
||||
if (((TilePortableAltarMessage) msg).items != null)
|
||||
switch (msg.index)
|
||||
{
|
||||
int[] items = ((TilePortableAltarMessage) msg).items;
|
||||
for (int j = 0; j < items.length; j++)
|
||||
{
|
||||
int i = items[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
case 0:
|
||||
target.writeInt(((TilePortableAltarMessage) msg).x);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).y);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).z);
|
||||
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).fluids != null);
|
||||
if (((TilePortableAltarMessage) msg).fluids != null)
|
||||
{
|
||||
int[] fluids = ((TilePortableAltarMessage) msg).fluids;
|
||||
for (int j = 0; j < fluids.length; j++)
|
||||
{
|
||||
int i = fluids[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).items != null);
|
||||
if (((TilePortableAltarMessage) msg).items != null)
|
||||
{
|
||||
int[] items = ((TilePortableAltarMessage) msg).items;
|
||||
for (int j = 0; j < items.length; j++)
|
||||
{
|
||||
int i = items[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeInt(((TilePortableAltarMessage) msg).capacity);
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).fluids != null);
|
||||
if (((TilePortableAltarMessage) msg).fluids != null)
|
||||
{
|
||||
int[] fluids = ((TilePortableAltarMessage) msg).fluids;
|
||||
for (int j = 0; j < fluids.length; j++)
|
||||
{
|
||||
int i = fluids[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeInt(((TilePortableAltarMessage) msg).capacity);
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
target.writeInt(((TileLifeInfuserMessage) msg).x);
|
||||
target.writeInt(((TileLifeInfuserMessage) msg).y);
|
||||
target.writeInt(((TileLifeInfuserMessage) msg).z);
|
||||
|
||||
target.writeBoolean(((TileLifeInfuserMessage) msg).items != null);
|
||||
if (((TileLifeInfuserMessage) msg).items != null)
|
||||
{
|
||||
int[] items = ((TileLifeInfuserMessage) msg).items;
|
||||
for (int j = 0; j < items.length; j++)
|
||||
{
|
||||
int i = items[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeBoolean(((TileLifeInfuserMessage) msg).fluids != null);
|
||||
if (((TileLifeInfuserMessage) msg).fluids != null)
|
||||
{
|
||||
int[] fluids = ((TileLifeInfuserMessage) msg).fluids;
|
||||
for (int j = 0; j < fluids.length; j++)
|
||||
{
|
||||
int i = fluids[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeInt(((TileLifeInfuserMessage) msg).capacity);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,45 +188,95 @@ public enum PacketHandler
|
||||
{
|
||||
int index = dat.readInt();
|
||||
|
||||
((TilePortableAltarMessage) msg).x = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).y = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).z = dat.readInt();
|
||||
boolean hasStacks = dat.readBoolean();
|
||||
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
if (hasStacks)
|
||||
switch (index)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).items.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
case 0:
|
||||
((TilePortableAltarMessage) msg).x = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).y = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).z = dat.readInt();
|
||||
boolean hasStacks = dat.readBoolean();
|
||||
|
||||
boolean hasFluids = dat.readBoolean();
|
||||
((TilePortableAltarMessage) msg).fluids = new int[6];
|
||||
if (hasFluids)
|
||||
{
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).fluids.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).fluids[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
if (hasStacks)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).items.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
((TilePortableAltarMessage) msg).capacity = dat.readInt();
|
||||
boolean hasFluids = dat.readBoolean();
|
||||
((TilePortableAltarMessage) msg).fluids = new int[6];
|
||||
if (hasFluids)
|
||||
{
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).fluids.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).fluids[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
((TilePortableAltarMessage) msg).capacity = dat.readInt();
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
((TileLifeInfuserMessage) msg).x = dat.readInt();
|
||||
((TileLifeInfuserMessage) msg).y = dat.readInt();
|
||||
((TileLifeInfuserMessage) msg).z = dat.readInt();
|
||||
boolean hasStacks2 = dat.readBoolean();
|
||||
|
||||
((TileLifeInfuserMessage) msg).items = new int[TileLifeInfuser.sizeInv * 3];
|
||||
if (hasStacks2)
|
||||
{
|
||||
((TileLifeInfuserMessage) msg).items = new int[TileLifeInfuser.sizeInv * 3];
|
||||
for (int i = 0; i < ((TileLifeInfuserMessage) msg).items.length; i++)
|
||||
{
|
||||
((TileLifeInfuserMessage) msg).items[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
boolean hasFluids2 = dat.readBoolean();
|
||||
((TileLifeInfuserMessage) msg).fluids = new int[6];
|
||||
if (hasFluids2)
|
||||
{
|
||||
for (int i = 0; i < ((TileLifeInfuserMessage) msg).fluids.length; i++)
|
||||
{
|
||||
((TileLifeInfuserMessage) msg).fluids[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
((TileLifeInfuserMessage) msg).capacity = dat.readInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Packet getPacket(TilePortableAltar tileAltar)
|
||||
public static Packet getPacket(TilePortableAltar tile)
|
||||
{
|
||||
TilePortableAltarMessage msg = new TilePortableAltarMessage();
|
||||
msg.index = 0;
|
||||
msg.x = tileAltar.xCoord;
|
||||
msg.y = tileAltar.yCoord;
|
||||
msg.z = tileAltar.zCoord;
|
||||
msg.items = tileAltar.buildIntDataList();
|
||||
msg.fluids = tileAltar.buildFluidList();
|
||||
msg.capacity = tileAltar.getCapacity();
|
||||
msg.x = tile.xCoord;
|
||||
msg.y = tile.yCoord;
|
||||
msg.z = tile.zCoord;
|
||||
msg.items = tile.buildIntDataList();
|
||||
msg.fluids = tile.buildFluidList();
|
||||
msg.capacity = tile.getCapacity();
|
||||
|
||||
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
|
||||
}
|
||||
|
||||
public static Packet getPacket(TileLifeInfuser tile)
|
||||
{
|
||||
TileLifeInfuserMessage msg = new TileLifeInfuserMessage();
|
||||
msg.index = 1;
|
||||
msg.x = tile.xCoord;
|
||||
msg.y = tile.yCoord;
|
||||
msg.z = tile.zCoord;
|
||||
msg.items = tile.buildIntDataList();
|
||||
msg.fluids = tile.buildFluidList();
|
||||
msg.capacity = tile.getCapacity();
|
||||
|
||||
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
public class TileCompactRitual {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileCompacter extends TileEntity
|
||||
{
|
||||
public TileCompacter()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,608 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileLifeInfuser extends TileEntity implements IInventory, IFluidTank, IFluidHandler
|
||||
{
|
||||
private ItemStack[] inv;
|
||||
public static final int sizeInv = 1;
|
||||
public static int damageLastTick = 0;
|
||||
private static final int rate = 1 / 10;
|
||||
|
||||
private boolean isLinked;
|
||||
private boolean isActive;
|
||||
public boolean tookLastTick = true;
|
||||
|
||||
protected FluidStack fluid;
|
||||
public int capacity;
|
||||
private boolean canBeFilled;
|
||||
protected FluidStack fluidInput;
|
||||
|
||||
public TileLifeInfuser()
|
||||
{
|
||||
this.inv = new ItemStack[2];
|
||||
isActive = false;
|
||||
fluid = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0);
|
||||
fluidInput = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0);
|
||||
capacity = FluidContainerRegistry.BUCKET_VOLUME * 10;
|
||||
}
|
||||
|
||||
public void setMainFluid(FluidStack fluid)
|
||||
{
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
public void setInputFluid(FluidStack fluid)
|
||||
{
|
||||
this.fluidInput = fluid;
|
||||
}
|
||||
|
||||
public FluidStack getFluid()
|
||||
{
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public int getFluidAmount()
|
||||
{
|
||||
if (fluid == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return fluid.amount;
|
||||
}
|
||||
|
||||
public int getCapacity()
|
||||
{
|
||||
return capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo getInfo()
|
||||
{
|
||||
return new FluidTankInfo(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{
|
||||
TileEntity tile = this;
|
||||
|
||||
if (resource == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (resource.fluidID != (new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 1)).fluidID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!doFill)
|
||||
{
|
||||
if (fluidInput == null)
|
||||
{
|
||||
return resource.amount;
|
||||
}
|
||||
|
||||
if (!fluidInput.isFluidEqual(resource))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.min(fluidInput.amount, resource.amount);
|
||||
}
|
||||
|
||||
if (fluidInput == null)
|
||||
{
|
||||
fluidInput = new FluidStack(resource, resource.amount);
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
}
|
||||
|
||||
return fluidInput.amount;
|
||||
}
|
||||
|
||||
if (!fluidInput.isFluidEqual(resource))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int filled = fluidInput.amount;
|
||||
|
||||
if (resource.amount < filled)
|
||||
{
|
||||
fluidInput.amount += resource.amount;
|
||||
filled = resource.amount;
|
||||
}
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluidInput, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
}
|
||||
|
||||
return filled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(int maxDrain, boolean doDrain)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readFromNBT(par1NBTTagCompound);
|
||||
NBTTagList tagList = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
|
||||
|
||||
for (int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound tag = tagList.getCompoundTagAt(i);
|
||||
int slot = tag.getByte("Slot");
|
||||
|
||||
if (slot >= 0 && slot < inv.length)
|
||||
{
|
||||
inv[slot] = ItemStack.loadItemStackFromNBT(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (!par1NBTTagCompound.hasKey("Empty"))
|
||||
{
|
||||
FluidStack fluid = this.fluid.loadFluidStackFromNBT(par1NBTTagCompound);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
setMainFluid(fluid);
|
||||
}
|
||||
|
||||
FluidStack fluidIn = new FluidStack(AlchemicalWizardry.lifeEssenceFluid, par1NBTTagCompound.getInteger("inputAmount"));
|
||||
|
||||
if (fluidIn != null)
|
||||
{
|
||||
setInputFluid(fluidIn);
|
||||
}
|
||||
}
|
||||
|
||||
isActive = par1NBTTagCompound.getBoolean("isActive");
|
||||
isLinked = par1NBTTagCompound.getBoolean("isLinked");
|
||||
canBeFilled = par1NBTTagCompound.getBoolean("canBeFilled");
|
||||
readCustomNBT(par1NBTTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < inv.length; i++)
|
||||
{
|
||||
if (inv[i] != null)
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setByte("Slot", (byte) i);
|
||||
inv[i].writeToNBT(tag);
|
||||
itemList.appendTag(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
fluid.writeToNBT(par1NBTTagCompound);
|
||||
}
|
||||
else
|
||||
{
|
||||
par1NBTTagCompound.setString("Empty", "");
|
||||
}
|
||||
|
||||
if (fluidInput != null)
|
||||
{
|
||||
par1NBTTagCompound.setInteger("inputAmount", fluidInput.amount);
|
||||
}
|
||||
|
||||
par1NBTTagCompound.setTag("Inventory", itemList);
|
||||
par1NBTTagCompound.setBoolean("isActive", isActive);
|
||||
par1NBTTagCompound.setBoolean("isLinked", isLinked);
|
||||
par1NBTTagCompound.setBoolean("canBeFilled", canBeFilled);
|
||||
writeCustomNBT(par1NBTTagCompound);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
|
||||
|
||||
if (nbttaglist.tagCount() > 0)
|
||||
{
|
||||
NBTTagCompound tagList = nbttaglist.getCompoundTagAt(0);
|
||||
inv[0] = ItemStack.loadItemStackFromNBT(tagList);
|
||||
inv[1] = ItemStack.loadItemStackFromNBT(tagList);
|
||||
}
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
NBTTagCompound tagList = new NBTTagCompound();
|
||||
|
||||
if (inv[0] != null)
|
||||
{
|
||||
tagList.setByte("Slot", (byte) 0);
|
||||
inv[0].writeToNBT(tagList);
|
||||
nbttaglist.appendTag(tagList);
|
||||
}
|
||||
if (inv[1] != null)
|
||||
{
|
||||
tagList.setByte("Slot", (byte) 1);
|
||||
inv[1].writeToNBT(tagList);
|
||||
nbttaglist.appendTag(tagList);
|
||||
}
|
||||
par1NBTTagCompound.setTag("Inventory", nbttaglist);
|
||||
}
|
||||
|
||||
public int fillMainTank(int amount) //TODO STUFFS
|
||||
{
|
||||
int filledAmount = Math.min(capacity - fluid.amount, amount);
|
||||
fluid.amount += filledAmount;
|
||||
|
||||
return filledAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return inv[slot];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amt)
|
||||
{
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
|
||||
if (stack != null)
|
||||
{
|
||||
if (stack.stackSize <= amt)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack = stack.splitStack(amt);
|
||||
|
||||
if (stack.stackSize == 0)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot)
|
||||
{
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
|
||||
if (stack != null)
|
||||
{
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack itemStack)
|
||||
{
|
||||
inv[slot] = itemStack;
|
||||
|
||||
if (itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
return "TileLifeInfuser";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityPlayer)
|
||||
{
|
||||
return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && entityPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
//Logic for the actual block is under here
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (inv[0] != null && inv[0].getItemDamage() > 0)
|
||||
{
|
||||
int damage = inv[0].getItemDamage();
|
||||
|
||||
if (getFluidAmount() >= 80)
|
||||
{
|
||||
takeLPFromTank();
|
||||
inv[0].setItemDamage(Math.max(0, damage - rate));
|
||||
}
|
||||
else if (inv[1] != null)
|
||||
{
|
||||
takeLPFromSN();
|
||||
inv[0].setItemDamage(Math.max(0, damage - rate));
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
markDirty();
|
||||
|
||||
if (damageLastTick != 0 && damageLastTick != damage)
|
||||
{
|
||||
tookLastTick = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
tookLastTick = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tookLastTick = false;
|
||||
}
|
||||
|
||||
damageLastTick = inv[0] == null ? 0 : inv[0].getItemDamage();
|
||||
}
|
||||
|
||||
public void takeLPFromSN()
|
||||
{
|
||||
int cost = 100;
|
||||
|
||||
ItemStack orbStack = this.getStackInSlot(1);
|
||||
if (orbStack == null || !(orbStack.getItem() instanceof IBloodOrb))
|
||||
{
|
||||
isLinked = true;
|
||||
|
||||
if (!SoulNetworkHandler.canSyphonFromOnlyNetwork(orbStack, cost))
|
||||
{
|
||||
SoulNetworkHandler.causeNauseaToPlayer(orbStack);
|
||||
}
|
||||
else if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer(orbStack, cost))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int takeLPFromTank()
|
||||
{
|
||||
return getFluidAmount() - 80;
|
||||
}
|
||||
|
||||
public void setActive()
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public boolean isActive()
|
||||
{
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public boolean isLinked() {return isLinked;}
|
||||
|
||||
public String linkedTo()
|
||||
{
|
||||
ItemStack orbStack = this.getStackInSlot(1);
|
||||
|
||||
return SoulNetworkHandler.getOwnerName(orbStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
return PacketHandler.getPacket(this);
|
||||
}
|
||||
|
||||
public void handlePacketData(int[] intData, int[] fluidData, int capacity)
|
||||
{
|
||||
if (intData == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (intData.length == 3)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
if (intData[i * 3 + 2] != 0)
|
||||
{
|
||||
ItemStack is = new ItemStack(Item.getItemById(intData[i * 3]), intData[i * 3 + 2], intData[i * 3 + 1]);
|
||||
inv[i] = is;
|
||||
}
|
||||
else
|
||||
{
|
||||
inv[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]);
|
||||
|
||||
this.setMainFluid(flMain);
|
||||
this.setInputFluid(flIn);
|
||||
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public int[] buildIntDataList()
|
||||
{
|
||||
int[] sortList = new int[3];//3 ints per stack (1 * 3)
|
||||
int pos;
|
||||
|
||||
for (ItemStack is : inv)
|
||||
{
|
||||
pos = 0;
|
||||
|
||||
if (is != null)
|
||||
{
|
||||
sortList[pos++] = Item.getIdFromItem(is.getItem());
|
||||
sortList[pos++] = is.getItemDamage();
|
||||
sortList[pos++] = is.stackSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[pos++] = 0;
|
||||
sortList[pos++] = 0;
|
||||
sortList[pos++] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return sortList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
//TODO
|
||||
if (resource == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
resource = resource.copy();
|
||||
int totalUsed = 0;
|
||||
int used = this.fill(resource, doFill);
|
||||
resource.amount -= used;
|
||||
totalUsed += used;
|
||||
return totalUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if (resource == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return drain(from, resource.amount, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxEmpty, boolean doDrain)
|
||||
{
|
||||
return this.drain(maxEmpty, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
//I changed this, since fluidstack != fluid... :p dunno if it was a accident? so you might wanna check this //Sure thing!
|
||||
return this.fluidInput != null && this.fluid.getFluid().equals(fluidInput.getFluid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||
{
|
||||
FluidTank compositeTank = new FluidTank(capacity);
|
||||
compositeTank.setFluid(fluid);
|
||||
return new FluidTankInfo[]{compositeTank.getInfo()};
|
||||
}
|
||||
|
||||
public int[] buildFluidList()
|
||||
{
|
||||
int[] sortList = new int[6];
|
||||
|
||||
if (this.fluid == null)
|
||||
{
|
||||
sortList[0] = AlchemicalWizardry.lifeEssenceFluid.getID();
|
||||
sortList[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[0] = this.fluid.fluidID;
|
||||
sortList[1] = this.fluid.amount;
|
||||
}
|
||||
|
||||
if (this.fluidInput == null)
|
||||
{
|
||||
sortList[2] = AlchemicalWizardry.lifeEssenceFluid.getID();
|
||||
sortList[3] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortList[2] = this.fluidInput.fluidID;
|
||||
sortList[3] = this.fluidInput.amount;
|
||||
}
|
||||
|
||||
return sortList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||
{
|
||||
return slot == 0;
|
||||
}
|
||||
|
||||
public void sendChatInfoToPlayer(EntityPlayer player)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("Contains: " + this.getFluidAmount() + "LP"));
|
||||
|
||||
if (isLinked())
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("Linked to: " + this.linkedTo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user