Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

-11 Bad

About Looke81

  • Rank
    Diamond Finder


  • Gender
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Override public boolean isItemValid(ItemStack itemstack) { if (itemstack.getItem() instanceof IBauble ){ for (int a = 0; a < inventory.INV_SIZE; a++) { if(itemstack.areItemStacksEqual(itemstack, inventory.getStackInSlot(a))){ if(inventory.getStackInSlot(a) != null){ return true; } } } } return false; } Thanks. Except now I cant put an item in the inventory at all.
  2. From ItemStack Class @SideOnly(Side.CLIENT) public boolean getIsItemStackEqual(ItemStack p_179549_1_) { return this.isItemStackEqual(p_179549_1_); } private boolean isItemStackEqual(ItemStack other) { return this.stackSize != other.stackSize ? false : (this.item != other.item ? false : (this.itemDamage != other.itemDamage ? false : (this.stackTagCompound == null && other.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(other.stackTagCompound)))); } Nope http://pastebin.com/HkrTf
  3. I want to make sure not more than one type of item can be placed in the inventory. Probably not like this because this crashes? @Override public boolean isItemValid(ItemStack itemstack) { if (itemstack.getItem() instanceof IBauble ){ for (int a = 0; a < inventory.INV_SIZE; a++) { if(itemstack.getIsItemStackEqual(inventory.getStackInSlot(a))){ return true; } } return false; } return false; }
  4. I want to make sure you can only put one type of any item in my custom inventory. I know i need to use the isItemValid method but I don't know how to check if that item already exists in my inventory.
  5. Ok looks like I will have to take a different approach to this. Sorry I should have listened to you in the first place but I'm stubborn.
  6. Very good point. Not to mention every other mod that takes the item out of the players inventory. Is there anyway to tell when the items stacksize has been decreased?Otherwise I may have to use a different approach with this whole thing but for now il continue on. Well I thought it was a server client issue because throwing the item didn't stop my flight but i still took damage and so with this: @SubscribeEvent public void ItemTossEvent(ItemTossEvent event) { EntityPlayer player = event.player; if (event.entityItem.getEntityItem().getItem() == TatItems.itemBaublesBag) { It
  7. So why doesn't it work?(it works for the throwing out of inventory but not for pressing Q)
  8. Yes I do that but their inventory is not an item inventory and so I need to make sure when the player dies (which ive done) or when the player tosses the item that the unequipped method is called.Becasue decrStackSize does not get called when this happens.
  9. Changed to PlayerTickEvent. Changed to .equals . onUnequiped is the method that is called when the bauble item is removed from the baubles inventory. I need to call is because I am basically making my own version of their inventory. If you haven't already: https://github.com/Azanor/Baubles
  10. If you are familiar with the mod baubles it is an api that allows you to add "rings" and "amulets". I am calling the methods that these items use when they need to be activated if they are in my custom inventory. But i need to turn these attributes off if the item inventory is removed from the players inventory. TickHandler public class TatEventHandler { @SubscribeEvent public void PlayerEvent(PlayerEvent event) { EntityPlayer player = event.entityPlayer; if (player instanceof EntityPlayer) { if (player.isDead) { for (int a = 0; a < player.inventory.mainInventory.length; a
  11. I have a custom inventory item that when particular items are in it it does something to the player but i need to stop that thing from happening when the item is removed from the player inventory.
  12. Hmm I'm not sure if you understand what I meant because I just used ItemTossEvent and that: * Event that is fired whenever a player tosses (Q) an item or drag-n-drops a * stack of items outside the inventory GUI screens. Canceling the event will * stop the items from entering the world, but will not prevent them being * removed from the inventory - and thus removed from the system. However the throwing outside the player gui works but the dropping on the ground only works on one side and i need it on both client and server.
  13. Ok. Can I tell if the item is removed by dropping it or if it is removed by picking up out the inventory?
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.