Posted May 19, 201312 yr Hello, I made a container and everything works fine. Gui also. Now my problem is that i can put the container-item(right click opens the gui) into another container-item, if i have 2 of them. Is there a funtion to check if the item is the container, then i mustn't put the item ind the container. I hope you understand me
May 19, 201312 yr Look at the furnace code or the crafting table code, and see how they restrict you from placing an item in the output slot.
May 19, 201312 yr Author I looked into ContainerWorkbench, ContainerFurnace, TileentityFurnace and Tileentityworkbench, but i can't find the solution for my problem.
May 19, 201312 yr public boolean isStackValidForSlot(int i, ItemStack itemstack) { return true; } Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 20, 201312 yr Author Thanks. I put this into my ContainerB.java , but i still can put the item into the container. public boolean isStackValidForSlot(int i, ItemStack itemstack) { int id = itemstack.itemID; if(id == Items.backpack.itemID) { return true; } return false; } My InventoryBackpack.java doesn't extend TileEntity. It extend InventoryBasic.
May 20, 201312 yr InventoryBasic might not have that functionality. Open up that class in Eclipse and dig through it to see what's available. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 20, 201312 yr Also: if(id == FoodExItems.backpack.itemID) { return true; } If that code was working, that will only allow a backpack to be placed inside your item's inventory. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 20, 201312 yr hey can I get all of your container codes I need some examples to figure out how containers work If you help me , I will be very happy ... http://r1306.hizliresim.com/1b/1/np1mm.png[/img]
May 20, 201312 yr hey can I get all of your container codes I need some examples to figure out how containers work If you help me , I will be very happy ... You mean my incomplete and non-selective code that uses tile entities? (That is, it lets anything get placed into it, like a chest) Don't think it'll help you much. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 20, 201312 yr I dont need something selective Your code will help me but If you dont want to share no problem mate http://r1306.hizliresim.com/1b/1/np1mm.png[/img]
May 20, 201312 yr I dont need something selective Your code will help me but If you dont want to share no problem mate I'm just saying that my code likely won't help I have "takes everything slots" (like a chest) then two custom slots with don't accept input (like furnace output). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 20, 201312 yr I dont care what slots do you have slots which I cannot get working If you post your code Im sure it will be helpful for me :D http://r1306.hizliresim.com/1b/1/np1mm.png[/img]
May 20, 201312 yr I'll have to dig it up later this evening. Don't have a copy right now. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 21, 201312 yr package draco18s.economy.inventory; import draco18s.economy.EconBankAccounts; import draco18s.economy.entities.EntityShop; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class MySlot extends Slot { public int sellprice = 0; public MySlot(IInventory par1iInventory, int par2, int par3, int par4) { super(par1iInventory, par2, par3, par4); } public boolean canTakeStack(EntityPlayer shopper) { return true; } public boolean isItemValid(ItemStack par1ItemStack) { return false; //returning false prevents the player from putting items into the slot } } Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.