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

Turtle NullPointerException

Started by Challenger, 24 July 2012 - 12:06 AM
Challenger #1
Posted 24 July 2012 - 02:06 AM
I made a program for the turtle to create a collector flower using EE2 MK3 collector and relays, and tested it using cobblestone and it worked perfectly. But when I try with the MK3's I get this error

java.lang.NullPointerException
at java.io.DataOutputStream.writeUTF(Unknown Source)
at java.io.DataOutputStream.writeUTF(Unknown Source)
at ee.network.TileEntityPacket.writeData(TileEntityPacket.java:44)
at ee.network.EEPacket.populate(EEPacket.java:28)
at ee.network.PacketTypeHandler.populatePacket(PacketTypeHandler.java:51)
at ee.network.PacketHandler.getPacketForSending(PacketHandler.java:43)
at ee.TileEE.d(TileEE.java:311)
at ar.a(SourceFile:130)
at ar.a(SourceFile:95)
at zf.b(SourceFile:160)
at jg.b(ServerConfigurationManager.java:368)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:574)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:450)
at dn.run(SourceFile:492)
Is there any way to fix this?
Noodle #2
Posted 24 July 2012 - 09:25 AM
Code?
What exactly did you do?
Video?
Try it again, does it continue?
Cloudy #3
Posted 24 July 2012 - 11:07 AM
That's also nothing to do with our code - its their code which is crashing.
Challenger #4
Posted 24 July 2012 - 03:33 PM
Here is the code

function forward(x)
if x == nil then
  x = 1
end

for i = 1,x do
  if not turtle.forward() then
   turtle.dig()
   turtle.forward()
  end
end
end
function back(x)
turnLeft(2)
forward(x)
turnLeft(2)
end
function left(x)
if x == nil then
  x = 1
end

turnLeft(1)
forward(x)
turnRight(1)
end
function right(x)
if x == nil then
  x = 1
end
turnRight(1)
forward(x)
turnLeft(1)
end
function up(x)
if x == nil then
  x = 1
end

for i = 1,x do
  if not turtle.up() then
   turtle.digUp()
   turtle.up()
  end
end
end
function down(x)
if x == nil then
  x = 1
end

for i = 1,x do
  if not turtle.down() then
   turtle.digDown()
   turtle.down()
  end
end
end
function turnLeft(x)
if x == nil then
  x = 1
end

for i = 1,x do
  turtle.turnLeft()
end
end
function turnRight(x)
if x == nil then
  x = 1
end

for i = 1,x do
  turtle.turnRight()
end
end
function placeForward(x)
if x == nil then
  x = 1
end

turtle.select(x)
if not turtle.place() then
  turtle.dig()
  turtle.place()
end
end
function placeBack(x)
if x == nil then
  x = 1
end

turtle.select(x)

turnLeft(2)
if not turtle.place() then
  turtle.dig()
  turtle.place()
end
turnLeft(2)
end
function placeUp(x)
if x == nil then
  x = 1
end

turtle.select(x)

if not turtle.placeUp() then
  turtle.digUp()
  turtle.placeUp()
end
end
function placeDown(x)
if x == nil then
  x = 1
end

turtle.select(x)
if not turtle.placeDown() then
  turtle.digDown()
  turtle.placeDown()
end
end
function placeLeft(x)
if x == nil then
  x = 1
end

turtle.select(x)
turnLeft()
if not turtle.place() then
  turtle.dig()
  turtle.place()
end
turnRight()
end
function placeRight(x)
if x == nil then
  x = 1
end

turtle.select(x)
turnRight()
if not turtle.place() then
  turtle.dig()
  turtle.place()
end
turnLeft()
end
function select(x)
if x == nil then
  x = 1
end

turtle.select(x)
end
forward(3)
placeForward(1)
placeUp(1)
placeDown(1)
placeLeft(1)
placeRight(1)
back(1)
placeForward(2)
left(1)
placeLeft(1)
placeUp(1)
placeDown(1)
placeBack(1)
right(1)
placeLeft(2)
right(1)
placeRight(1)
placeUp(1)
placeDown(1)
placeBack(1)
left(1)
placeRight(2)
down(1)
placeBack(1)
placeDown(1)
up(1)
placeDown(2)
up(1)
placeUp(1)
placeBack(1)
down(1)
placeUp(2)
back(1)
placeForward(3)
back(1)

I will upload a video later
Lyqyd #5
Posted 24 July 2012 - 03:54 PM
Again, as Cloudy said, it's not a problem in ComputerCraft. Try asking around on the other mod's forums.
Challenger #6
Posted 24 July 2012 - 03:56 PM
Ok I didn't see his post. I will ask on the EE2 forums
Challenger #7
Posted 29 July 2012 - 03:31 AM
This is fixed with the 1.4 update.