SilkSpawners

SilkSpawners

3M Downloads

SilkSpawners API returning null item?

pablo67340 opened this issue ยท 4 comments

commented

What steps will reproduce the problem?

I am the developer of GUIShop, I have been running into some issues in the latest version.
When ever I try to set the mobspawner object to the correct ItemID, it appears to be returning an
empty item.

Expected output

The buyer should receive a purchased mob spawner.

What do you see instead?

Massive console error.

Log file of the issue/error

My plugin error: https://pastebin.com/j35BR2f1

My plugin code snippet: https://pastebin.com/XnPugkrb

Line 347 is the line where returnItems is being assigned.

/version output?

git-spigot-a3f6ea5-a2af8f0 (MC 1.11.2) Implementing API 1.11.2-R0.1-SNAPSHOT

SilkSpawners version

3.7.4

Please provide any additional information below.

I have tried everything on my end. I am not 100% sure if its my plugin or yours, however I've tried everything I possibly could on my end, and nothing worked leading me to believe something may be wrong within SilkSpawners.

commented

Could you log/tell me what spawner and (short)item.getData() is?
The relevant line that checks the spawner is here: https://github.com/timbru31/SilkSpawners/blob/master/modules/v1_11_R1/src/main/java/de/dustplanet/silkspawners/compat/v1_11_R1/NMSHandler.java#L196

commented

Spawner is a newly created itemStack with the material MOB_SPAWNER.

item.getData() contains the data value of the item (entity ID).

commented

REQUEST CLOSED. ISSUE RESOLVED.

Just dont even ask facedesk.

Brain fart. I guess that's what happens when you program until 5 AM.

commented

Alright, glad you solved your problem. I'll plan to update the JavaDocs in the near future and will add notes where possible null values might be returned.