Changed a few things. Waiting for xcomp to help fix my work environment
This commit is contained in:
parent
d23d90918d
commit
6ad0d3b702
10 changed files with 75 additions and 34 deletions
|
@ -1,12 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -19,8 +14,14 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAltar extends BlockContainer
|
||||
{
|
||||
|
@ -131,7 +132,11 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
|
||||
return true;
|
||||
} else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
}else if(playerItem.getItem() instanceof IAltarManipulator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
{
|
||||
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem);
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockMobSpawner;
|
||||
|
@ -19,8 +17,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockTeleposer extends BlockContainer
|
||||
{
|
||||
|
@ -77,6 +79,8 @@ public class BlockTeleposer extends BlockContainer
|
|||
{
|
||||
if (playerItem.getItem() instanceof TelepositionFocus)
|
||||
{
|
||||
SoulNetworkHandler.checkAndSetItemOwner(playerItem, player);
|
||||
|
||||
if (playerItem.stackTagCompound == null)
|
||||
{
|
||||
playerItem.setTagCompound(new NBTTagCompound());
|
||||
|
@ -173,6 +177,11 @@ public class BlockTeleposer extends BlockContainer
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(tileEntityF instanceof TileMultipart)
|
||||
{
|
||||
((TileMultipart)tileEntityF).createAndLoadEntity(nbttag1);
|
||||
}
|
||||
|
||||
if (blockI instanceof BlockMobSpawner || blockF instanceof BlockMobSpawner)
|
||||
{
|
||||
|
|
|
@ -13,21 +13,21 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade
|
||||
public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator
|
||||
{
|
||||
private static IIcon helmetIcon;
|
||||
private static IIcon plateIcon;
|
||||
private static IIcon leggingsIcon;
|
||||
private static IIcon bootsIcon;
|
||||
|
||||
public static int conversionRate = 100; //LP / half heart
|
||||
public static float activationPoint = 0.5f;
|
||||
public static int tickRate = 20;
|
||||
public static int maxStored = 10000;
|
||||
|
||||
public ItemBloodLetterPack()
|
||||
{
|
||||
|
@ -39,17 +39,13 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Crystal of unimaginable power");
|
||||
par3List.add("This pack really chaffes...");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
|
@ -62,7 +58,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade
|
|||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
return this.itemIcon;
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -109,6 +105,8 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade
|
|||
int filledAmount = altar.fillMainTank(amount);
|
||||
amount -= filledAmount;
|
||||
this.setStoredLP(itemStack, amount);
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,11 +138,31 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade
|
|||
|
||||
return tag.getInteger("storedLP");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
|
||||
{
|
||||
//This is where I need to do the updating
|
||||
if(world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(world.getWorldTime() % tickRate == 0)
|
||||
{
|
||||
boolean shouldExecute = player.getHealth() / player.getMaxHealth() > activationPoint && this.getStoredLP(itemStack) < maxStored;
|
||||
|
||||
if(shouldExecute)
|
||||
{
|
||||
SoulNetworkHandler.hurtPlayer(player, 1.0f);
|
||||
this.setStoredLP(itemStack, Math.min(this.getStoredLP(itemStack) + conversionRate, maxStored));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
//This is where I need to do the updating
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ public class SpellHelper
|
|||
return false;
|
||||
}
|
||||
|
||||
if (player instanceof FakePlayer || SpellHelper.getUsername(player).contains("[CoFH]"))
|
||||
if (player instanceof FakePlayer || SpellHelper.getUsername(player).contains("[CoFH]") || SpellHelper.getUsername(player).contains("[ThaumcraftTablet]"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue