Hello all, I am currently working on a mod and I tin can't seem to figure how to make a crafting tabular array (my own non vanilla) non drop items when you close the GUI! I accept made the other slots, not the crafting matrix keep the items simply the 3x3 troughs them out. Does anyone accept any idea's on how to correct this? (im pretty certain information technology something unproblematic it's just I can't seem to figure information technology out)
My mod and code are here: https://github.com/Z...iedFabrication/
Feel free to check it out!
Rollback Post to RevisionRollBack
#2 Sep 16, 2013
Rollback Post to RevisionRollBack
#3 Sep 16, 2013
Rollback Post to RevisionRollBack
#four Sep 16, 2013
I've noticed this lawmaking in ContainerWorkbench:
/** * Called when the container is closed. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { par1EntityPlayer.dropPlayerItem(itemstack); } } } }
If you lot're using ContainerWorkbench you might want to create your ain container class, and if you lot apply your own already then remove that method. If you lot don't have that method anywhere then I don't know what could be causing it to happen.
EDIT: Yup, you have that method. I wrote my post before I found the class.
Rollback Mail service to RevisionRollBack
If I helped you and then delight press the button. Be sure to quote my mail service if you want a reply. lol @ Cameronazzi re-create-pasting my sig into his
#5 Sep 16, 2013
I've noticed this lawmaking in ContainerWorkbench:
/** * Called when the container is closed. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != nix) { par1EntityPlayer.dropPlayerItem(itemstack); } } } }
If you're using ContainerWorkbench you might desire to create your ain container class, and if y'all use your own already then remove that method. If y'all don't accept that method anywhere and then I don't know what could be causing it to happen.
EDIT: Yup, you have that method. I wrote my postal service before I found the grade.
That worked however at present when I close the GUI the items don't drop (fantastic) but when I open the GUI whatever was in the crafting matrix is gone. It'due south like its destroying the item. Whatever idea's?
My lawmaking is upwardly and so no point in posting all the lawmaking become here to see my code: https://github.com/Zodsmar/AppliedFabrication/
Rollback Mail to RevisionRollBack
#6 Sep 16, 2013
Hither'southward a method in Container.java.
/** * Called when the container is airtight. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { InventoryPlayer inventoryplayer = par1EntityPlayer.inventory; if (inventoryplayer.getItemStack() != null) { par1EntityPlayer.dropPlayerItem(inventoryplayer.getItemStack()); inventoryplayer.setItemStack((ItemStack)null); } }
It looks like is sets all the itemstacks to goose egg when you close the gui. So looking at your method, I guess yous could remove this office:
/** * Called when the container is airtight. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); // RIGHT HERE, sorry strike through doesn't work in [code] thingies. if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != nil) { par1EntityPlayer.dropPlayerItem(itemstack); } } } }
EDIT: Ok, so I read the code incorrect. It looks like
inventoryplayer.setItemStack((ItemStack)null);
is the player's inventory, not the workbench. And so the code might be wrong.
Rollback Post to RevisionRollBack
If I helped you then delight press the push button. Be sure to quote my mail if you want a reply. lol @ Cameronazzi copy-pasting my sig into his
#7 Sep 16, 2013
Hither's a method in Container.java.
/** * Called when the container is closed. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { InventoryPlayer inventoryplayer = par1EntityPlayer.inventory; if (inventoryplayer.getItemStack() != null) { par1EntityPlayer.dropPlayerItem(inventoryplayer.getItemStack()); inventoryplayer.setItemStack((ItemStack)nada); } }
Information technology looks like is sets all the itemstacks to null when you close the gui. So looking at your method, I guess you could remove this part:
/** * Chosen when the container is closed. */ public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); // RIGHT Here, sorry strike through doesn't work in [code] thingies. if (!this.worldObj.isRemote) { for (int i = 0; i < ix; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != cypher) { par1EntityPlayer.dropPlayerItem(itemstack); } } } }
What I did was this:
public void onContainerClosed(EntityPlayer par1EntityPlayer) { if (!this.worldObj.isRemote) { for (int i = 0; i < 9; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != goose egg) { par1EntityPlayer.dropPlayerItem(itemstack); } } } }
Was that right and if it was and so... That didn't piece of work either. Also I establish that when I shut my GUI and get out the game and come back the items are also gone. Whatever other idea's?
Rollback Mail service to RevisionRollBack
#eight Sep 16, 2013
That was right, except I establish out my code is wrong(as the edit says :))I'm no proficient on the crafting table but what I think that happens is that when yous right click the workbench it opens a fresh GUI with no items, so I don't think they're stored anywhere in the lawmaking. Might be completely wrong.Mayhap you can somehow store the crafting grid in the block/tile entity and and then load it when you lot open up the GUI?
Rollback Post to RevisionRollBack
If I helped y'all and so delight press the button. Be sure to quote my post if you lot want a reply. lol @ Cameronazzi copy-pasting my sig into his
#9 Sep sixteen, 2013
Ok so where am I putting this:
Ok, so I read the lawmaking wrong. It looks like inventoryplayer.setItemStack((ItemStack)nix); is the player's inventory, not the workbench. So the lawmaking might be incorrect.
Whatever other idea's also people?
Rollback Post to RevisionRollBack
#10 Sep sixteen, 2013
Await at the furnace container...it holds and stores the items when closing the GUI and as well when exiting and re inbound the game...
Rollback Postal service to RevisionRollBack
#eleven Sep 16, 2013
I was just explaining that my postal service was wrong. I have no idea how to keep the items.
From a quick look at ContainerFurnace, it seems like it's storing variables in it's tile entity class. Does the workbench take a tile entity? I couldn't find one. EDIT: Furnace uses NBT tags I judge. Endeavor putting those somewhere in your cake or container class.
Rollback Mail to RevisionRollBack
If I helped you so please press the button. Be sure to quote my mail service if yous want a respond. lol @ Cameronazzi re-create-pasting my sig into his
#12 Sep 16, 2013
Ok thanks guys I will endeavor to figure it out! If anyone figures it out delight let me know
Thought's Please post I'thousand up for trying anything right at present
Rollback Post to RevisionRollBack
#xiii Sep xvi, 2013
I was just explaining that my postal service was incorrect. I have no idea how to keep the items.
From a quick expect at ContainerFurnace, it seems similar it's storing variables in information technology's tile entity form. Does the workbench have a tile entity? I couldn't find 1. EDIT: Furnace uses NBT tags I guess. Effort putting those somewhere in your block or container class.
The workbench does not have one, nope. Simply can be done I have seen mods do this for various reasons. NBT tags are commonly stored in the tile for loading purposes....Only that would exist the best place to starting time for the code for his needs...
Rollback Mail service to RevisionRollBack
#14 Sep 17, 2013
Anyone else I still haven't figured information technology out. Im looking everywhere?
Rollback Mail to RevisionRollBack
#15 Sep 17, 2013
where exercise i postal service that i need help making a modernistic and looking for people to help me?
Rollback Mail to RevisionRollBack
#16 Sep 17, 2013
where do i mail that i need help making a mod and looking for people to help me?
In modding develpoment fourm.
Anyon fix my problem withal?
Rollback Post to RevisionRollBack
#17 Sep 17, 2013
Anyone else I yet haven't figured it out. Im looking everywhere?
Make your table extend block container, add the create new tile entity method and get tile entity in block class. Then click on the tile in the block and create new, should accept a setup tile prepare to add the functioning code. Should only demand the NBT stuff, there is a tutorial on this by Mrgingerninja I think...but I know nosotros have one here...
where practise i mail that i need assistance making a modern and looking for people to help me?
Create a new thread in this department...or possibly since you are recruiting maybe postal service in the WIP section....
Rollback Mail service to RevisionRollBack
#18 Sep eighteen, 2013
SOLVED! (if anyone wants to know how this was fixed PM me and I can permit you know)
Rollback Post to RevisionRollBack
To post a comment, please login.
Posts Quoted:
Reply
Clear All Quotes
Share this post
0 Response to "Minecraft Crafting Table Keyboard Shortcuts"
#1 Sep 16, 2013
Hello all,
I am currently working on a mod and I tin can't seem to figure how to make a crafting tabular array (my own non vanilla) non drop items when you close the GUI! I accept made the other slots, not the crafting matrix keep the items simply the 3x3 troughs them out. Does anyone accept any idea's on how to correct this? (im pretty certain information technology something unproblematic it's just I can't seem to figure information technology out)
My mod and code are here: https://github.com/Z...iedFabrication/
Feel free to check it out!
Rollback Post to Revision RollBack
#2 Sep 16, 2013
Rollback Post to Revision RollBack
#3 Sep 16, 2013
Rollback Post to Revision RollBack
#four Sep 16, 2013
I've noticed this lawmaking in ContainerWorkbench:
If you lot're using ContainerWorkbench you might want to create your ain container class, and if you lot apply your own already then remove that method. If you lot don't have that method anywhere then I don't know what could be causing it to happen.
EDIT: Yup, you have that method. I wrote my post before I found the class.
Rollback Mail service to Revision RollBack
If I helped you and then delight press the
button.
Be sure to quote my mail service if you want a reply.
lol @ Cameronazzi re-create-pasting my sig into his
#5 Sep 16, 2013
That worked however at present when I close the GUI the items don't drop (fantastic) but when I open the GUI whatever was in the crafting matrix is gone. It'due south like its destroying the item. Whatever idea's?
My lawmaking is upwardly and so no point in posting all the lawmaking become here to see my code: https://github.com/Zodsmar/AppliedFabrication/
Rollback Mail to Revision RollBack
#6 Sep 16, 2013
Hither'southward a method in Container.java.
It looks like is sets all the itemstacks to goose egg when you close the gui. So looking at your method, I guess yous could remove this office:
EDIT: Ok, so I read the code incorrect. It looks like
is the player's inventory, not the workbench. And so the code might be wrong.
Rollback Post to Revision RollBack
If I helped you then delight press the
push button.
Be sure to quote my mail if you want a reply.
lol @ Cameronazzi copy-pasting my sig into his
#7 Sep 16, 2013
What I did was this:
Was that right and if it was and so...
That didn't piece of work either. Also I establish that when I shut my GUI and get out the game and come back the items are also gone. Whatever other idea's?
Rollback Mail service to Revision RollBack
#eight Sep 16, 2013
That was right, except I establish out my code is wrong(as the edit says :))I'm no proficient on the crafting table but what I think that happens is that when yous right click the workbench it opens a fresh GUI with no items, so I don't think they're stored anywhere in the lawmaking. Might be completely wrong.Mayhap you can somehow store the crafting grid in the block/tile entity and and then load it when you lot open up the GUI?
Rollback Post to Revision RollBack
If I helped y'all and so delight press the
button.
Be sure to quote my post if you lot want a reply.
lol @ Cameronazzi copy-pasting my sig into his
#9 Sep sixteen, 2013
Ok so where am I putting this:
Ok, so I read the lawmaking wrong. It looks like
inventoryplayer.setItemStack((ItemStack)nix);
is the player's inventory, not the workbench. So the lawmaking might be incorrect.
Whatever other idea's also people?
Rollback Post to Revision RollBack
#10 Sep sixteen, 2013
Await at the furnace container...it holds and stores the items when closing the GUI and as well when exiting and re inbound the game...
Rollback Postal service to Revision RollBack
#eleven Sep 16, 2013
I was just explaining that my postal service was wrong. I have no idea how to keep the items.
From a quick look at ContainerFurnace, it seems like it's storing variables in it's tile entity class. Does the workbench take a tile entity? I couldn't find one.
EDIT: Furnace uses NBT tags I judge. Endeavor putting those somewhere in your cake or container class.
Rollback Mail to Revision RollBack
If I helped you so please press the
button.
Be sure to quote my mail service if yous want a respond.
lol @ Cameronazzi re-create-pasting my sig into his
#12 Sep 16, 2013
Ok thanks guys I will endeavor to figure it out! If anyone figures it out delight let me know
Thought's Please post I'thousand up for trying anything right at present
Rollback Post to Revision RollBack
#xiii Sep xvi, 2013
The workbench does not have one, nope. Simply can be done I have seen mods do this for various reasons. NBT tags are commonly stored in the tile for loading purposes....Only that would exist the best place to starting time for the code for his needs...
Rollback Mail service to Revision RollBack
#14 Sep 17, 2013
Anyone else I still haven't figured information technology out. Im looking everywhere?
Rollback Mail to Revision RollBack
#15 Sep 17, 2013
where exercise i postal service that i need help making a modernistic and looking for people to help me?
Rollback Mail to Revision RollBack
#16 Sep 17, 2013
In modding develpoment fourm.
Anyon fix my problem withal?
Rollback Post to Revision RollBack
#17 Sep 17, 2013
Make your table extend block container, add the create new tile entity method and get tile entity in block class. Then click on the tile in the block and create new, should accept a setup tile prepare to add the functioning code. Should only demand the NBT stuff, there is a tutorial on this by Mrgingerninja I think...but I know nosotros have one here...
Create a new thread in this department...or possibly since you are recruiting maybe postal service in the WIP section....
Rollback Mail service to Revision RollBack
#18 Sep eighteen, 2013
SOLVED! (if anyone wants to know how this was fixed PM me and I can permit you know)
Rollback Post to Revision RollBack