This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Rasmulde's profile picture

[Question] How to make a turtle place tekkit 3.0.4 microblocks

Started by Rasmulde, 05 June 2012 - 01:05 PM
Rasmulde #1
Posted 05 June 2012 - 03:05 PM
I want to use around 5 turtles to build an elaborate bridge structure in tekkit 3.0.4. I already designed the structure which is repeated segments. in each segment i want to place several microblocks of marble as it is a marble bridge. But i cant find a way to make turtles place redpower microblocks (in this case the halfblock, quarterblock and 1/4 panel in same spatial configuration each time). I figured it was just a question about making them place blocks with metadata, and that i would need to make my own API. Is this completely wrong? Is there some easy way of doing this?

Any help is appreciated!
kazagistar #2
Posted 05 June 2012 - 03:32 PM
As far as I know there is no real way to do this. I wish it were possible…
PixelToast #3
Posted 05 June 2012 - 04:21 PM
actually in SMP it creates a virtual player placing blocks, ill do some tests
Rasmulde #4
Posted 05 June 2012 - 04:38 PM
actually in SMP it creates a virtual player placing blocks, ill do some tests

You would be my hero!
Cloudy #5
Posted 05 June 2012 - 07:10 PM
On bukkit it creates a new player - but only for permission checking. The placement code is the same. There is currently no way to place micro blocks, but we do want to get items working correctly using turtles. However, I doubt micro blocks will ever work properly, just due to the way they work.
Rasmulde #6
Posted 05 June 2012 - 07:38 PM
So its not just about making the turtle API call to the java code able to handle the metadata as a parameter like in the following code?

private boolean place(int i) { int j = xCoord + Facing.offsetsXForSide[i]; int k = yCoord + Facing.offsetsYForSide[i]; int l = zCoord + Facing.offsetsZForSide[i]; if (!canPlaceInBlock(k)) { return false; } int i1 = getOppositeDir(i); ItemStack itemstack = takePlaceableItem(j, k, l, i1); if (itemstack == null) { return false; } Item item = Item.itemsList[itemstack.itemID]; Block block = Block.blocksList[itemstack.itemID]; if (worldObj.setBlockAndMetadataWithNotify(j, k, l, itemstack.itemID, item.getMetadata(itemstack.getItemDamage()))) { if (worldObj.getBlockId(j, k, l) == itemstack.itemID) { block.onBlockPlaced(worldObj, j, k, l, i1); if (item instanceof ItemComputer) { ((ItemComputer) item).setupComputerAfterPlacement( itemstack, worldObj, j, k, l); } } mod_CCTurtle.playBlockSound(worldObj, (float) j + 0.5F, (float) k + 0.5F, (float) l + 0.5F, block); return true; } else { return false; } }

in particular the command with worldObj.setBlockAndMetadataWithNotify(x,y,z,blocID,metadata)


taken from: http://code.google.c...ec=svn104&r=104
Cloudy #7
Posted 05 June 2012 - 07:43 PM
No. That is actually decompiled ComputerCraft code - that is exactly what it does right now!