Minecraftmodcustomstuff Wiki
Register
Advertisement
InfiniteChest

This Block is a Chest for only one Block or Item, but incredible much of it. It should contain up to 2^31-1 of its Containing Block/ID.

It hast 2 Slots, the first will always (onUpdate) be Empty, so you can input stuff and the Second will always be filled (up to a full stack), so you can take it out.

2013-05-17 12.12.13


Technical Stuff[]

And Again, for those are interested in Scripting, there is some Magic again:

\config\CustomStuff\mods\_modname_\scriptsInfiniteChestScript.js:

function icUpdate(a)
{
 var b=1;
 var cid=world.getTileEntityIntData(position,'contid')+0;
 var cmeta=world.getTileEntityIntData(position,'contmeta')+0;
 var ccnt=world.getTileEntityIntData(position,'contcount')+0;
 
 
 var cid0=world.getContainerSlotId(position, 0);
 var cmeta0=world.getContainerSlotMetadata(position, 0);
 var ccnt0=world.getContainerSlotStackSize(position, 0);
 var cid1=world.getContainerSlotId(position, 1);
 var cmeta1=world.getContainerSlotMetadata(position, 1);
 var ccnt1=world.getContainerSlotStackSize(position, 1);
 
 
 if(cid<1 || ccnt<1) { cid=cmeta=ccnt=0; }
 if(cid0<0) cid0=0;
 if(cid1<0) cid1=0;
 if(cmeta<0) cmeta=0;
 if(cmeta0<0) cmeta0=0;
 if(cmeta1<0) cmeta1=0;
 if(ccnt<0) ccnt=0;
 if(ccnt0<0) ccnt0=0;
 if(ccnt1<0) ccnt1=0;
 
 if(cid==0) {cmeta=ccnt=0;}
 
 if(cid==0 || cid0==0 || (cid0==cid && cmeta0==cmeta)) if(cid==0 || cid1==0 || (cid1==cid && cmeta1==cmeta))
 {
  ccnt=ccnt+ccnt0+ccnt1+0;
  if(ccnt>0)
  {
   if(a) player.sendMessage("Contains: "+ccnt+" of "+cid+":"+cmeta);
   if(!cid) cid=(cid0>0)?cid0:cid1;
   if(!cid) cmeta=(cid0>0)?cmeta0:cmeta1;
   if(ccnt0>0) world.removeFromContainerSlot(position,0,ccnt0);
   world.setContainerSlot(position, 1, cid, ((ccnt>64)?64:ccnt), cmeta)
   ccnt=(ccnt>64)?(ccnt-64):0;
 
   world.setTileEntityIntData(position,'contid',cid);
   world.setTileEntityIntData(position,'contmeta',cmeta);
   world.setTileEntityIntData(position,'contcount',ccnt);
  } else if(a) player.sendMessage("Empty");
 }
}
 
function icActivated()
{
 icUpdate(1);
 player.openGui('InfiniteChestGUI', position); result = true;
}

Download[]

It's under the Beerware License.

You can download the Infinite Chest here.

Advertisement