Fixed Harvest sigil in armour giving bad items
Finished optimization of compression handler.
This commit is contained in:
parent
e21f6941ba
commit
d7d8aedd42
8 changed files with 259 additions and 117 deletions
|
@ -49,6 +49,7 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding
|
|||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
System.out.println("Being called");
|
||||
if(!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -185,6 +185,10 @@ public class ItemHarvestSigil extends EnergyItems implements IHolding, ArmourUpg
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int range = 3;
|
||||
int verticalRange = 1;
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
|
|
|
@ -171,6 +171,10 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ItemStack stack = CompressionRegistry.compressInventory(player.inventory.mainInventory, world);
|
||||
if(stack != null)
|
||||
{
|
||||
|
|
|
@ -95,11 +95,37 @@ public class SigilOfHolding extends EnergyItems
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer))
|
||||
{
|
||||
int currentSlot = this.getSelectedSlot(par1ItemStack);
|
||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemUsed = inv[currentSlot];
|
||||
|
||||
if (itemUsed == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
saveInternalInventory(par1ItemStack, inv);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
//TODO Might be a good idea to have this item need to be in the player's first slot
|
||||
if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
{
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue