-
Hello, I have problems with some Turtles. When I create one turtle and try to get the position of the turtle via a self-made peripheral, the position is correct. But when I place a second Turtle and try to get the position via a self-made peripheral, it returns the position of the first Turtle. More context: IntelligenceModding/AdvancedPeripherals#54 I hope anyone here can understand what I mean. It's like, that every turtle use the same instance of my turtle. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I can't say for sure, but this block looks pretty concerning: That'll only get triggered once, so if the turtle ever moves you'll have a stale tile entity. Ideally this code wouldn't exist at all and you'd just use That said, not sure why turtle instances are merging into one - nothing in the code looks suspect there. |
Beta Was this translation helpful? Give feedback.
I can't say for sure, but this block looks pretty concerning:
https://github.com/Seniorendi/AdvancedPeripherals/blob/49fe99e025de770f4a02ab37d502ee007d3b973f/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/base/BaseTurtle.java#L66-L74
That'll only get triggered once, so if the turtle ever moves you'll have a stale tile entity. Ideally this code wouldn't exist at all and you'd just use
ITurtleAccess
, though I understand why you're doing this.That said, not sure why turtle instances are merging into one - nothing in the code looks suspect there.