Advanced Peripherals

Advanced Peripherals

29M Downloads

AR-Controller: calling "getPlayerRotationY/Z" throws a Null-Exception for the owner

RedCookieLP opened this issue ยท 4 comments

commented

Descripe

I just tried out the AR Goggles and the AR Controller for the first time. I "bound" the AR-Controller in the Lua-Shell in a computer and in the listing for all the possible functions I've found these two (they're in the title). I know that AR is bugged, according to the wiki, but still, I tried it.

It spit a NullPointer-exception back:

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player
.m_146908_() because the return value of 
"de.srendi.advancedperipherals.common.addons.computercraft.owner.BlockEntityPeripheralOwner.getOwner()"
is null

Also, I don't if it's intended, but calling getConfiguration returns an empty... "Table"? "Entry"?... Whatever the data-structure is: It's empty

PS: I'm using Version 0.7.15b, included in "All the Mods 7 v0.4.10", I couldn't select the newer version further down...

Steps to reproduce

  1. Place down an AR-Controller and a computer of your choice (I used the advanced computer from CC:Tweaked).

  2. If you haven't placed them directly next to each other: Connect them via modems and cables and activate the modems by clicking on them.

  3. Get yourself a pair of AR-Goggles and link them with the AR-Controller by putting them in your hand and clicking on the AR-Controller. A message saying Successfully linked AR-Goggles should appear and the Goggles themselfes should have the bound controller stored in them (hover over the goggles with your cursor).

  4. Put your glasses on (or don't, either way it doesn't work)

  5. Open the Lua-Shell in the computer connected with the controller and bind it using something like
    ar = peripheral.find("arController")

  6. Finally: Call ar.getPlayerRotationY() or ar.getPlayerRotationZ().

A NullPointer exception is thrown (in my case at least).

Multiplayer?

No

Version

1.18.2-0.7.14b (Latest 1.18)

Minecraft, Forge and maybe other related mods versions

Forge - 40.1.31 and Minecraft - 1.18.1 in "All The Mods 7" - 0.4.10

Screenshots or Videos

No response

Crashlog/log

No response

commented

This is a weird issue. Do the other functions work?

commented

I didn't try out much, but clear, drawString, fill and all those functions worked fine, but like I said, I didn't try out much. Of all the functions I tested, the three mentioned in the first post don't work or return empty.

I can do some more testing later and report what happened.

commented

Ok, I think I've tested every function now. All but these functions work:

  • getPlayerRotationY -- NullPointer-Exception
  • getPlayerRotationZ -- NullPointer-Exception
  • getConfiguration -- just returns an emtpy config ({}), might be intended...
  • fillCircle -- No circle visible/rendered
  • fillCircleWithId -- No circle visible/rendered

The other functions work flawlessly, as far as I can tell...

commented

Update
Every rotation related function does not work and will not until the AR rework for 0.8r. This has some bigger reasons related to how the ar system currently works.

getConfiguration returns an empty table because it's not implemented in the ar controller. So yes, it's intended.

I'll see what I can do about the circle functions