For every tick, there's a random chance an (insert item here) will be added to the chest.
I can't seem to figure out how to use/manipulate the one used with temple loots and bonus chests.
EDIT:
everything works with the block's slot/inventory, I can place items on it and take it back. the problem is that it doesn't generate/add/create the item (fishRaw).
everything works with the block's slot/inventory, I can place items on it and take it back. the problem is that it doesn't generate/add/create the item (fishRaw).
TileEntityChest tec = new TileEntityChest();
tec.setInventorySlotContents(g, new ItemStack(Item.paper, rand.nextInt(5)));
world.setBlockWithNotify(i, y, k, Block.chest.blockID);
world.setBlockTileEntity(i, y, k, tec);
tec.updateEntity();
I suggest replacing that massively retarded if statement with a simple method. as far as i can see you're trying to determine if all the surrounding blocks are made of either waterStill or waterMoving.
then why not use a "triple for-loop"?
something like this:
public boolean isSurroundedByWater(int x, int y, int z)
{
if(!mc.theWorld.isRemote)
return false;
for(int i=-1; i<=1; i++)
{
for(int j=-1; j<=1; j++)
{
for(int k=-1; k<=1; k++)
{
int id = mc.theWorld.getBlockId(x+i, y+j, z+k);
if(id != Block.waterStill || id != Block.waterMoving)
return false;
}
}
}
return true;
}
I didn't test it so you might have to tweak it a bit but it is sure as hell alot less confusing than that monster of an if statement.
perhaps you're simply not generating a 0 with the random next integer?
Why not leave out the random part and just let it run. See if it then actually puts some fish in your block.
If it does then you know you just have to change the random next int to 1 or so.
For every tick, there's a random chance an (insert item here) will be added to the chest.
I can't seem to figure out how to use/manipulate the one used with temple loots and bonus chests.EDIT:
everything works with the block's slot/inventory, I can place items on it and take it back. the problem is that it doesn't generate/add/create the item (fishRaw).
Thanks .
Check out my mods! :-)
(Sorry about the huge condition line. Basically, it just checks if the sides of the block and its top is water (moving or still). )
Still doesn't work :C (It doesn't add any items.)
Check out my mods! :-)
Check out my mods! :-)
Check out my mods! :-)
section's pretty dead.
more info in case you still need more:
everything works with the block's slot/inventory, I can place items on it and take it back. the problem is that it doesn't generate/add/create the item (fishRaw).
Check out my mods! :-)
to infinity and beyond!
Check out my mods! :-)
anyone
Check out my mods! :-)
:/
Check out my mods! :-)
Works fine for me.
I suggest replacing that massively retarded if statement with a simple method. as far as i can see you're trying to determine if all the surrounding blocks are made of either waterStill or waterMoving.
then why not use a "triple for-loop"?
something like this:
I didn't test it so you might have to tweak it a bit but it is sure as hell alot less confusing than that monster of an if statement.
At last, thanks for the help. But it still doesn't work. (No fish is added to the block's inventory).
Check out my mods! :-)
Why not leave out the random part and just let it run. See if it then actually puts some fish in your block.
If it does then you know you just have to change the random next int to 1 or so.
Check out my mods! :-)
Check out my mods! :-)
Check out my mods! :-)
Check out my mods! :-)
Check out my mods! :-)
Check out my mods! :-)