Jump to content

Recommended Posts

Posted (edited)

I created code that recognize what object is in input slot and if it's white it add white item to output slot and if it's orange it outputs orange item.
if (button.id == 0){

if((Filamencik.getStackInSlot(00) !=null ) &&Filamencik.getStackInSlot(00).getItem() == bialyfilament.block){ Filamencik.setInventorySlotContents(01, new ItemStack(bialymarfin.block, 1)); }

if((Filamencik.getStackInSlot(00) !=null ) &&Filamencik.getStackInSlot(00).getItem() == bialyfilament.block){ Filamencik.setInventorySlotContents(00, null); }

if((Filamencik.getStackInSlot( 00) !=null ) &&Filamencik.getStackInSlot( 00).getItem() == pomaranczowyfilament.block){ Filamencik.setInventorySlotContents(01, new ItemStack(pomaranczowyMarfin.block, 1)); }

if((Filamencik.getStackInSlot( 00) !=null ) &&Filamencik.getStackInSlot( 00).getItem() == pomaranczowyfilament.block){ Filamencik.setInventorySlotContents(00, null); } } }
 

if i insert item to input slot and press event button input item dissapear, output item shows. If i quit GUI in that moment output item will come out, but when i click output item in GUI it disappears and input item shows again

Edited by kisiel23
Posted (edited)
8 minutes ago, diesieben07 said:

Your code is unreadable.

I fixed it. Now yoy can read it

 

Edited by kisiel23
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.