Fixed the Liquid Sigils so that they would work on tanks again.
This commit is contained in:
parent
110deaf0e6
commit
634bab7688
|
@ -69,6 +69,7 @@ import WayofTime.alchemicalWizardry.common.achievements.ModAchievements;
|
||||||
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
|
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
|
||||||
import WayofTime.alchemicalWizardry.common.block.ArmourForge;
|
import WayofTime.alchemicalWizardry.common.block.ArmourForge;
|
||||||
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
|
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
|
||||||
|
import WayofTime.alchemicalWizardry.common.book.BloodMagicGuide;
|
||||||
import WayofTime.alchemicalWizardry.common.commands.CommandBind;
|
import WayofTime.alchemicalWizardry.common.commands.CommandBind;
|
||||||
import WayofTime.alchemicalWizardry.common.commands.CommandSN;
|
import WayofTime.alchemicalWizardry.common.commands.CommandSN;
|
||||||
import WayofTime.alchemicalWizardry.common.commands.CommandUnbind;
|
import WayofTime.alchemicalWizardry.common.commands.CommandUnbind;
|
||||||
|
@ -274,6 +275,7 @@ import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
import cpw.mods.fml.common.ModContainer;
|
import cpw.mods.fml.common.ModContainer;
|
||||||
|
@ -1170,6 +1172,11 @@ public class AlchemicalWizardry
|
||||||
{
|
{
|
||||||
this.isThaumcraftLoaded = false;
|
this.isThaumcraftLoaded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Loader.isModLoaded("guideapi"))
|
||||||
|
{
|
||||||
|
this.registerBMBook();
|
||||||
|
}
|
||||||
|
|
||||||
if (Loader.isModLoaded("Forestry"))
|
if (Loader.isModLoaded("Forestry"))
|
||||||
{
|
{
|
||||||
|
@ -1223,6 +1230,12 @@ public class AlchemicalWizardry
|
||||||
|
|
||||||
// this.createItemTextureFiles();
|
// this.createItemTextureFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Optional.Method(modid = "guideapi")
|
||||||
|
public static void registerBMBook()
|
||||||
|
{
|
||||||
|
BloodMagicGuide.registerGuide();
|
||||||
|
}
|
||||||
|
|
||||||
public static void blacklistAccelerators()
|
public static void blacklistAccelerators()
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.book;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import amerifrance.guideapi.api.abstraction.CategoryAbstract;
|
||||||
|
import amerifrance.guideapi.api.base.Book;
|
||||||
|
|
||||||
|
public class BloodMagicGuide
|
||||||
|
{
|
||||||
|
public static Book bloodMagicGuide;
|
||||||
|
public static List<CategoryAbstract> categories = new ArrayList<CategoryAbstract>();
|
||||||
|
|
||||||
|
public static void registerGuide()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,7 @@
|
||||||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import java.util.List;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -16,15 +12,18 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import java.util.List;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
||||||
{
|
{
|
||||||
|
@ -73,92 +72,83 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
||||||
/**
|
/**
|
||||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||||
*/
|
*/
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||||
{
|
{
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!world.canMineBlock(player, x, y, z))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float f = 1.0F;
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f;
|
if (tile instanceof IFluidHandler)
|
||||||
double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset;
|
|
||||||
double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f;
|
|
||||||
|
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
|
|
||||||
|
|
||||||
if (movingobjectposition == null)
|
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
|
||||||
} else
|
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false);
|
||||||
{
|
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
if (amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
{
|
{
|
||||||
int i = movingobjectposition.blockX;
|
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true);
|
||||||
int j = movingobjectposition.blockY;
|
|
||||||
int k = movingobjectposition.blockZ;
|
|
||||||
|
|
||||||
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = par2World.getTileEntity(i, j, k);
|
|
||||||
if (tile instanceof IFluidHandler)
|
|
||||||
{
|
|
||||||
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
|
|
||||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false);
|
|
||||||
|
|
||||||
if (amount > 0 && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
if (movingobjectposition.sideHit == 0)
|
|
||||||
{
|
|
||||||
--j;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 1)
|
|
||||||
{
|
|
||||||
++j;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 2)
|
|
||||||
{
|
|
||||||
--k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 3)
|
|
||||||
{
|
|
||||||
++k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 4)
|
|
||||||
{
|
|
||||||
--i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 5)
|
|
||||||
{
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.canPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
if (side == 0)
|
||||||
|
{
|
||||||
|
--y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 1)
|
||||||
|
{
|
||||||
|
++y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 2)
|
||||||
|
{
|
||||||
|
--z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 3)
|
||||||
|
{
|
||||||
|
++z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 4)
|
||||||
|
{
|
||||||
|
--x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 5)
|
||||||
|
{
|
||||||
|
++x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
|
{
|
||||||
|
return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,26 +1,23 @@
|
||||||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import java.util.List;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.material.MaterialLiquid;
|
import net.minecraft.block.material.MaterialLiquid;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBucket;
|
import net.minecraft.item.ItemBucket;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import java.util.List;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
||||||
{
|
{
|
||||||
|
@ -44,13 +41,13 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
{
|
{
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.voidsigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.voidsigil.desc"));
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null))
|
if (!(stack.getTagCompound() == null))
|
||||||
{
|
{
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,73 +70,59 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
||||||
return this.energyUsed;
|
return this.energyUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
||||||
{
|
{
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
if (!EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float f = 1.0F;
|
float f = 1.0F;
|
||||||
double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f;
|
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||||
double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset;
|
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset;
|
||||||
double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f;
|
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||||
boolean flag = this.isFull == 0;
|
boolean flag = this.isFull == 0;
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag);
|
|
||||||
|
|
||||||
if (movingobjectposition == null)
|
if (!world.canMineBlock(player, x, y, z))
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
return false;
|
||||||
} else
|
|
||||||
{
|
|
||||||
FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition);
|
|
||||||
|
|
||||||
if (MinecraftForge.EVENT_BUS.post(event))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
|
||||||
{
|
|
||||||
int i = movingobjectposition.blockX;
|
|
||||||
int j = movingobjectposition.blockY;
|
|
||||||
int k = movingobjectposition.blockZ;
|
|
||||||
|
|
||||||
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = par2World.getTileEntity(i, j, k);
|
|
||||||
if (tile instanceof IFluidHandler)
|
|
||||||
{
|
|
||||||
FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, false);
|
|
||||||
|
|
||||||
if (amount != null && amount.amount > 0 && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isFull == 0)
|
|
||||||
{
|
|
||||||
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par2World.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
par2World.setBlockToAir(i, j, k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof IFluidHandler)
|
||||||
|
{
|
||||||
|
FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, false);
|
||||||
|
|
||||||
|
if (amount != null && amount.amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
|
{
|
||||||
|
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isFull == 0)
|
||||||
|
{
|
||||||
|
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (world.getBlock(x, y, z).getMaterial() instanceof MaterialLiquid && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
|
{
|
||||||
|
world.setBlockToAir(x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import java.util.List;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|
||||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -15,15 +12,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import java.util.List;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||||
|
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
||||||
{
|
{
|
||||||
|
@ -39,11 +38,11 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
public void onCreated(ItemStack stack, World world, EntityPlayer player)
|
||||||
{
|
{
|
||||||
if (par1ItemStack.getTagCompound() == null)
|
if (stack.getTagCompound() == null)
|
||||||
{
|
{
|
||||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,116 +56,100 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getContainerItem(ItemStack itemStack)
|
public ItemStack getContainerItem(ItemStack itemStack)
|
||||||
{
|
{
|
||||||
ItemStack copiedStack = itemStack.copy();
|
return itemStack;
|
||||||
copiedStack.setItemDamage(copiedStack.getItemDamage() + 1);
|
|
||||||
copiedStack.stackSize = 1;
|
|
||||||
return copiedStack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
{
|
{
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.watersigil.desc"));
|
par3List.add(StatCollector.translateToLocal("tooltip.watersigil.desc"));
|
||||||
|
|
||||||
if (!(par1ItemStack.getTagCompound() == null))
|
if (!(stack.getTagCompound() == null))
|
||||||
{
|
{
|
||||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||||
*/
|
*/
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||||
{
|
{
|
||||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Being called");
|
if (!world.canMineBlock(player, x, y, z))
|
||||||
|
|
||||||
float f = 1.0F;
|
|
||||||
double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f;
|
|
||||||
double d1 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par3EntityPlayer.yOffset;
|
|
||||||
double d2 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double) f;
|
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
|
|
||||||
|
|
||||||
if (movingobjectposition == null)
|
|
||||||
{
|
{
|
||||||
return par1ItemStack;
|
return false;
|
||||||
} else
|
}
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof IFluidHandler)
|
||||||
{
|
{
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000);
|
||||||
|
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false);
|
||||||
|
|
||||||
|
if (amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
{
|
{
|
||||||
int i = movingobjectposition.blockX;
|
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true);
|
||||||
int j = movingobjectposition.blockY;
|
|
||||||
int k = movingobjectposition.blockZ;
|
|
||||||
|
|
||||||
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = par2World.getTileEntity(i, j, k);
|
|
||||||
if (tile instanceof IFluidHandler)
|
|
||||||
{
|
|
||||||
FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000);
|
|
||||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false);
|
|
||||||
|
|
||||||
if (amount > 0 && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
if (movingobjectposition.sideHit == 0)
|
|
||||||
{
|
|
||||||
--j;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 1)
|
|
||||||
{
|
|
||||||
++j;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 2)
|
|
||||||
{
|
|
||||||
--k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 3)
|
|
||||||
{
|
|
||||||
++k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 4)
|
|
||||||
{
|
|
||||||
--i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (movingobjectposition.sideHit == 5)
|
|
||||||
{
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
|
|
||||||
{
|
|
||||||
return par1ItemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.canPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
|
||||||
{
|
|
||||||
this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ItemStack;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
if (side == 0)
|
||||||
|
{
|
||||||
|
--y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 1)
|
||||||
|
{
|
||||||
|
++y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 2)
|
||||||
|
{
|
||||||
|
--z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 3)
|
||||||
|
{
|
||||||
|
++z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 4)
|
||||||
|
{
|
||||||
|
--x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (side == 5)
|
||||||
|
{
|
||||||
|
++x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||||
|
{
|
||||||
|
return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -193,6 +176,7 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
par1World.setBlock(par8, par9, par10, this.isFull, 0, 3);
|
par1World.setBlock(par8, par9, par10, this.isFull, 0, 3);
|
||||||
|
par1World.markBlockForUpdate(par8, par9, par10);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
RoutingFocusParadigm parad = new RoutingFocusParadigm();
|
RoutingFocusParadigm parad = new RoutingFocusParadigm();
|
||||||
|
|
||||||
TileEntity outputChest = null; //Destination
|
TileEntity outputChest = null; //Destination
|
||||||
ForgeDirection inputDirection;;
|
ForgeDirection inputDirection;
|
||||||
|
|
||||||
{
|
{
|
||||||
IInventory outputChestInventory = null;
|
IInventory outputChestInventory = null;
|
||||||
|
|
Loading…
Reference in a new issue