Advanced Peripherals

Advanced Peripherals

29M Downloads

NullPointer exception when picking up pocket computers using the mouse

imevul opened this issue ยท 1 comments

commented

Describe

Some peripherals that require the peripheral itself being in the world cause nullpointer exceptions (and I believe sometimes also cause client disconnects) when you have a running program on a pocket computer and pick it up using the mouse, or put it in a backpack or similar. I've seen both the GeoScanner and PlayerDetector display this issue.

Steps to reproduce

  1. Create an Advanced Geo Pocket Computer or Advanced Player Detector Pocket Computer
  2. Run a program that has an infinite loop, and continually scans using the chosen peripheral. Either scan() or getPlayerPos()
  3. Pick it up with with your mouse. This will cause a nullpointer exception, and usually causes the program to crash as well.

Multiplayer?

Yes

Version

1.20.1-0.7.39r (Latest 1.20.1)

Minecraft, Forge and maybe other related mods versions

Forge 47.2.20 - Minecraft 1.20.1

Screenshots or Videos

No response

Crashlog/log

https://pastebin.com/XJLk38WS

commented

Example program that can be used for testing:

local pd = peripheral.find('playerDetector')
local playerName = 'YOURPLAYERNAMEHERE'

while true do
    pd.getPlayerPos(playerName)
    os.sleep(0.05)
end