CC: Tweaked

CC: Tweaked

57M Downloads

Turtle.place

Minecraft2p0 opened this issue ยท 5 comments

commented

If I use buckets or shears in the latest version 1.16.1, it no longer works. In version 1.12.2 it worked. Many of my farm programs like sheep farm or concrete mixer are based on this principle. Please add it. Thanks

commented

More in-depth notes for various issues regarding interactions with buckets and the turtle.place, placeUp, and placeDown commands.

When the turtle is in an air block, and an empty bucket is in inventory and its inventory slot is selected, the appropriate place command in the direction of a source block of lava/water will return true and remove the source block of lava/water. The empty bucket in turtle inventory is removed, but a full bucket of lava/water does not appear in inventory in the previous empty bucket slot.

When the turtle is in a water source block and an empty bucket is in inventory and its inventory slot is selected, the appropriate place command in the direction of another source block of water will return true and remove the source block of lava/water in the turtle's current block. It does not remove the water source block being "pointed at" by the place, placeUp, or placeDown command. The empty bucket in turtle inventory is removed, but a full bucket of water does not appear in inventory in the previous empty bucket slot. (This feature could be working as intended if bucket behavior with water is intended to work differently than lava?)

When the turtle is in a water source block and an empty bucket is in inventory and its inventory slot is selected, all place commands will return true and remove the source block of water in the turtle's current block, even if there is no water source block in the block being "pointed at" by the place command. The empty bucket in turtle inventory is removed, but a full bucket of water does not appear in inventory in the previous empty bucket slot. (again this may be working as intended if bucket behavior with water is intended to work differently than lava?)

When a bucket of lava is used for place, placeDown, and placeUp, the command returns false but a lava source block is placed in the correct location in front of/below/above the turtle. The lava bucket in the selected slot remains a lava bucket and is not replaced with an empty bucket.

When a bucket of water is used for place, placeDown, and placeUp, the command returns false but a water source block is placed in the correct location in front of/below/above the turtle. A second water source block erroneously appears in the same space as the turtle. The water bucket in the selected slot of the turtle inventory remains a water bucket and is not replaced with an empty bucket.

All tests were made in Survival mode of Minecraft 1.16.1 with Forge 32.0.108 and CC-T 1.90.3 and no other mods installed.

commented

Also turtle.refuel command is unaffected and is still working properly when using a bucket of lava as fuel.

commented

As you suggested, having a solid block 2 blocks above does solve the placeUp() issue when the turtle is in an air block, with an air block above the turtle, and a water bucket selected in the turtle inventory. The water source block is correctly placed in the block above the turtle, not in the turtle's same block.

However, when the turtle is in a water source block, with an empty bucket in inventory and the appropriate place function is used in the direction of a water source block above/in front of/below the turtle, it will still grab the water source block in the same block as the turtle, regardless of if there is a solid block 2 blocks in the same direction.

If the intended (or unavoidable) default behavior of using a turtle.place/Up/Down function with an empty bucket to collect water is to collect from the turtle's own block first if it is waterlogged, and if not only then to collect in the specified direction, then I would say everything is working as intended aside from the placeUp() issue without a solid block 2 blocks up, if that is able to be addressed.

For complex turtle programming involving collecting water with buckets, one should be able to tell if their turtle will be waterlogged before having the turtle move into a block by using a turtle.inspect/Up/Down function in the direction of movement. If name = "minecraft:water" and state = { level = 0 } then one can program different behaviors for being waterlogged.

Thanks for your work keeping ComputerCraft alive!

commented

As of CC:T version 1.91.0, Minecraft version 1.16.2, Forge version 33.0.22, this issue appears to be resolved for all turtle.place commands involving lava and buckets.

However the following issues remain for water and buckets, mainly with the turtle.placeUp() function or situations where the turtle is in a water source block:

When the turtle is in an air block, with an air block above the turtle, and a water bucket selected in the turtle inventory, when using turtle.placeUp() the water source block is placed in the same block as the turtle, not the air block above the turtle. The water bucket in the turtle inventory is correctly removed and replaced with an empty bucket. However, if the turtle is in a water source block, it will correctly place the water source block above the turtle, and correctly remove the water bucket from inventory and replace it with an empty bucket. In both cases the function returns true.

When the turtle is in a water source block, with an air block above the turtle, and an empty bucket selected in the turtle inventory, when using turtle.placeUp() the water source block in the same space as the turtle is removed. The empty bucket in the turtle inventory is correctly removed and replaced with a water bucket. However, if the block above the turtle is a water source block, it will correctly remove the water source block above the turtle, and correctly remove the water bucket from inventory and replace it with an empty bucket. In both cases the function returns true.

When the turtle is in a water source block, with either an air block or water source block in front of the turtle, and an empty bucket selected in the turtle inventory, in both cases when using turtle.place() the water source block in the same space as the turtle is removed. The empty bucket in the turtle inventory is correctly removed and replaced with a water bucket. In both cases the function returns true.

When the turtle is in a water source block, with either an air block or water source block below the turtle, and an empty bucket selected in the turtle inventory, in both cases when using turtle.placeDown() the water source block in the same space as the turtle is removed. The empty bucket in the turtle inventory is correctly removed and replaced with a water bucket. In both cases the function returns true.

commented

When the turtle is in an air block, with an air block above the turtle, and a water bucket selected in the turtle inventory, when using turtle.placeUp() the water source block is placed in the same block as the turtle, not the air block above the turtle.

I have a feeling this is an unavoidable part of how turtle block placement works, and the fact that turtles are waterloggable. I'll have a fiddle, but can't guarantee anything. Placing a block which the turtle can place the water against (so two blocks in front of/above the turtle) should resolve most of the placement issues.