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

[1.53] [SMP/SSP] Turtle "Mines" Entities

Started by civilwargeeky, 13 June 2013 - 04:02 PM
civilwargeeky #1
Posted 13 June 2013 - 06:02 PM
Version Info:
Minecraft 1.5.2
Forge 715
CC 1.53

Description of Problem:
Recently, I have had people complain of my quarry program encountering bedrock when there was none there (on somewhat laggy servers), and so I went into an SSP world to test different things. My mining function works like this (basically):

while not turtle.forward() do
  count = count + 1
  if turtle.dig() then
	 mined = mined + 1
  else
	turtle.attack()
  end
  if count > 20 then
	foundBedrock()
  end
end
I know its not exactly the best solution for bedrock, but it gets the job done, usually. Now the bug comes when it cannot go forward because of an entity (like a sheep or a player). When it tries to mine the sheep, brown particles pop up and turtle.dig() returns true. It does this 20 times and says it found bedrock.
If I'm not mistaken, turtle.dig is not supposed to mine entities, only blocks.
http://imgur.com/a/aY6V4

So, when it mines an entity:
Expected Outcome:
Turtle returns false, as there is no block to mine.
Actual Outcome:
Turtle "mines" entity, and returns true.
Cranium #2
Posted 14 June 2013 - 11:33 AM
turtle.dig() will 'attack' an entity if it's in front of it, and in range. It's been like that for a while, since being able to use swords.
civilwargeeky #3
Posted 14 June 2013 - 01:38 PM
turtle.dig() will 'attack' an entity if it's in front of it, and in range. It's been like that for a while, since being able to use swords.
Attacks? Do you mean like "actually tries to hurt"? Because it just makes a block breaking sound, shoots brown particles like it mined a block, and returns true, without causing any harm to the entity in front of it.
immibis #4
Posted 14 June 2013 - 04:42 PM
turtle.attack attacks entities.
civilwargeeky #5
Posted 15 June 2013 - 03:19 PM
turtle.attack attacks entities.
I know that, but you see, turtle.dig apparently attempts to "attack" entities. This "attack" does not do damage, or cause knockback. It just emits brown particles and returns true for the dig function. I cannot see any reason for this to be intended, as it only introduces inaccuracies in mining programs, which is why I posted this problem in bugs. If this behavior is intended (for whatever reason), I would like to know.
Cloudy #6
Posted 15 June 2013 - 06:42 PM
This is incorrect. It does not try to dig entities at all - I have just tested this. No particles, no anything.
civilwargeeky #7
Posted 16 June 2013 - 06:58 PM
This is incorrect. It does not try to dig entities at all - I have just tested this. No particles, no anything.
I can assure you that it does indeed. I have made a video to describe my situation.
[media]http://youtu.be/AIBnmpMtJlg[/media]
(If you cannot see it, it will be ready within the hour)
Cloudy #8
Posted 16 June 2013 - 08:36 PM
Ok, I have reproduced this. We do not check if the block is an air block before digging. Railcraft drops invisible blocks round players to be used for the goggles which can show where players have been.

For now, you can disable the Railcraft hidden blocks in the config. I'll fix this for the next CC version (when I get the dev environment set up on this laptop, after court tomorrow)!
civilwargeeky #9
Posted 16 June 2013 - 09:12 PM
Ok. Thank you very much. Good luck in the case :)/>