GlowstoneMC / GlowstoneMC/Glowstone
NullPointerException when setting potion data using .getData().setData(byte) without PotionMeta
- Dominant language
- Java
- Stars
- 2k
- Forks
- 280
- PR merge metrics
- No merged PRs in 30d
Description
Here's the error:
```
20:59:33 [INFO] a [/127.0.0.1:60496] connected, UUID: 52428a0e-1e30-3cb1-976c-e728b2614047
20:59:33 [INFO] a joined the game
20:59:33 [SEVERE] Error while executing GlowTask{id=22, plugin=null, sync=true: net.glowstone.net.handler.login.LoginStartHandler$$Lambda$40/22042775@1f15420}
java.lang.NullPointerException
at net.glowstone.inventory.GlowMetaPotion.dataToString(GlowMetaPotion.java:191)
at net.glowstone.inventory.GlowMetaPotion.writeNbt(GlowMetaPotion.java:87)
at net.glowstone.inventory.GlowItemFactory.writeNbt(GlowItemFactory.java:80)
at net.glowstone.io.nbt.NbtSerialization.writeItem(NbtSerialization.java:74)
at net.glowstone.io.nbt.NbtSerialization.writeInventory(NbtSerialization.java:112)
at net.glowstone.block.entity.TEContainer.saveNbt(TEContainer.java:45)
at net.glowstone.GlowChunk.toMessage(GlowChunk.java:697)
at net.glowstone.GlowChunk.toMessage(GlowChunk.java:616)
at net.glowstone.entity.GlowPlayer.streamBlocks(GlowPlayer.java:716)
at net.glowstone.entity.GlowPlayer.join(GlowPlayer.java:403)
at net.glowstone.net.GlowSession.setPlayer(GlowSession.java:342)
at net.glowstone.net.handler.login.LoginStartHandler.lambda$handle$0(LoginStartHandler.java:56)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at net.glowstone.scheduler.GlowTask.run(GlowTask.java:167)
at net.glowstone.scheduler.GlowScheduler.pulse(GlowScheduler.java:152)
at net.glowstone.scheduler.GlowScheduler.lambda$start$0(GlowScheduler.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
This isn't logging in with a regular client, but with a java program using https://github.com/Steveice10/MCProtocolLib to test.
This may or may not be related to an earlier error, which was caused by the plugin I'm testing. Earlier error:
```
java.lang.NullPointerException
at net.glowstone.inventory.GlowMetaPotion.dataToString(GlowMetaPotion.java:191)
at net.glowstone.inventory.GlowMetaPotion.writeNbt(GlowMetaPotion.java:87)
at net.glowstone.inventory.GlowItemFactory.writeNbt(GlowItemFactory.java:80)
at net.glowstone.io.nbt.NbtSerialization.writeItem(NbtSerialization.java:74)
at net.glowstone.io.nbt.NbtSerialization.writeInventory(NbtSerialization.java:112)
at net.glowstone.block.entity.TEContainer.saveNbt(TEContainer.java:45)
at net.glowstone.GlowChunk.toMessage(GlowChunk.java:697)
at net.glowstone.GlowChunk.toMessage(GlowChunk.java:616)
at net.glowstone.entity.GlowPlayer.streamBlocks(GlowPlayer.java:716)
at net.glowstone.entity.GlowPlayer.spawnAt(GlowPlayer.java:761)
at net.glowstone.entity.GlowPlayer.teleport(GlowPlayer.java:1524)
at net.glowstone.entity.GlowPlayer.teleport(GlowPlayer.java:1506)
at net.daboross.bukkitdev.skywars.world.SkyWorldHandler.onGameStart1(SkyWorldHandler.java:167)
at net.daboross.bukkitdev.skywars.events.GameEventDistributor.distribute(GameEventDistributor.java:72)
at net.daboross.bukkitdev.skywars.game.GameQueue.queuePlayer(GameQueue.java:61)
at net.daboross.bukkitdev.skywars.commands.mainsubcommands.JoinCommand.runCommand$7bc4b72f(JoinCommand.java:50)
at net.daboross.bukkitdev.skywars.libraries.commands.CommandExecutorBase.onCommand(CommandExecutorBase.java:54)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:194)
at net.glowstone.GlowServer.dispatchCommand(GlowServer.java:1244)
at net.glowstone.entity.GlowPlayer.lambda$chat$7(GlowPlayer.java:1794)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at net.glowstone.scheduler.GlowTask.run(GlowTask.java:167)
at net.glowstone.scheduler.GlowScheduler.pulse(GlowScheduler.java:152)
at net.glowstone.scheduler.GlowScheduler.lambda$start$0(GlowScheduler.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
The line, `net.daboross.bukkitdev.skywars.world.SkyWorldHandler.onGameStart1(SkyWorldHandler.java:167)`, shouldn't be sending anything null, but would there be any clue as to what it's sending which is wrong?
To test, and I'm not sure if this is reproducible, the program I'm using which uses MCProtocolLib is http://github.com/daboross/minecraft-commandline-interface - a command line bot tester.
I'm mostly submitting this to get input on what MCProtocolLib/minecraft-command-line-interface is doing wrong / different from the default Minecraft client. I don't know enough about Glowstone to know what isn't being sent, so it'd be awesome if someone with knowledge of Glowstone could give input on this.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35621690-nullpointerexception-when-setting-potion-data-using-getdata-setdata-byte-without-potionmeta?utm_campaign=plugin&utm_content=tracker%2F14691067&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F14691067&utm_medium=issues&utm_source=github).
Contributor guide
Assessment
This issue has not been assessed yet.