Finished all porting
This commit is contained in:
parent
93e5e6cca6
commit
d528bdbbf8
30 changed files with 393 additions and 1045 deletions
|
@ -3,42 +3,28 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
||||
{
|
||||
private int isFull;
|
||||
private int energyUsed;
|
||||
|
||||
public SigilVoid()
|
||||
{
|
||||
super(null);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(50);
|
||||
isFull = 0;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:VoidSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,72 +63,74 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float f = 1.0F;
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, false);
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(side, 1000, false);
|
||||
|
||||
if (amount != null && amount.amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, true);
|
||||
((IFluidHandler) tile).drain(side, 1000, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (side == 0)
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
|
||||
if (side.getIndex() == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
if (side.getIndex() == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
if (side.getIndex() == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
if (side.getIndex() == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
if (side.getIndex() == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
if (side.getIndex() == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) //was canPlayerEdit
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SpellHelper.isBlockFluid(world.getBlock(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if (SpellHelper.isBlockFluid(world.getBlockState(new BlockPos(x, y, z)).getBlock()) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.setBlockToAir(new BlockPos(x, y, z));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -150,18 +138,17 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Attempts to place the liquid contained inside the bucket.
|
||||
*/
|
||||
public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean func_180616_a(World world, BlockPos blockPos) //was tryPlaceContainedLiquid
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue