Pixelmon + Sponge = Client-side lagspikes with client errors

Hello!
I have recently tried to set up a Pixelmon (4.x) server and came to the conclusion that Sponge would be the best option if I want to add some server-side functionality to a server intended for friends & friends of friends.

However, every 4.x version of Pixelmon and any version of Sponge mixed together cause the client console to spam errors and the client to lock up for a bit. Of course, there are no issues when running Pixelmon or Sponge separately.
What’s more interesting is that the client will continue to spam errors and lock up even after removing Sponge or Pixelmon.

The client error
[23:19:54] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.NullPointerException java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_45] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_45] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:715) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1019) [bsu.class:?] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345) [bsu.class:?] at net.minecraft.client.main.Main.main(SourceFile:120) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] Caused by: java.lang.NullPointerException at net.minecraft.client.network.NetHandlerPlayClient.func_147273_a(NetHandlerPlayClient.java:1150) ~[cee.class:?] at net.minecraft.network.play.server.S35PacketUpdateTileEntity.func_180725_a(SourceFile:49) ~[iu.class:?] at net.minecraft.network.play.server.S35PacketUpdateTileEntity.func_148833_a(SourceFile:11) ~[iu.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[ih.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_45] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_45] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714) ~[FMLCommonHandler.class:?] ... 9 more

Example (.webm)
http://a.pomf.cat/dxbdvx.webm

For more specific information
http://www.pixelmonmod.com/tracker.php?p=4&t=7468

Edit
I forgot to actually ask a question, which is kind of important when posting in a support forum. Oops.
So here goes: Is this caused by Sponge or by Pixelmon? And is there any way to avoid this issue for now, or am I doomed to not use Sponge for the time being?

Does this happen on a newly generated world?

Also, looking at your bug report on the pixelmon bug tracker, you say the client has forge 11.14.3.1542, update forge on the client and see if that fixes anything.

Hello @simon816! Thank you for replying :smile:

First of all: this happens on new worlds as well as pre-generated worlds. As soon as Pixelmon and Sponge are mixed together and the player moves around for a while, these messages start getting spammed in the console.

As for your second tip, I manually installed Pixelmon over a Forge 1577 installation, but sadly enough:

That didn’t help anything :frowning:

i’m 90% sure it has to do with Pixelmon spawning, which is not done in the main thread (hence the future task NPE), the error is also not constant in any way, it just starts to spam client console at random intervals

That’s true, although it does seem slightly location-bound. I might be wrong, but I seem to get the error more often near forest biomes. I guess that’s just because more Pixelmon spawn in those biomes?

I just tested a sponge+pixelmon server and yes, I’m getting these errors too.
I know they both used to work together, so it’s something quite recent.
I’ll investigate more and try to get the problem fixed.

2 Likes

Any progress with this?

@Django You need to link your ENTIRE client/server log, not just snippets.

OK so I tested again. I was able to reproduce this without SpongeForge, so I believe it to be a purely Pixelmon issue.
FYI the issue seems to be the server is sending a tile entity update packet to the client but a tile entity doesn’t exist at the position specified.
So until it can be proved sponge is causing this I’m saying it’s Pixelmon’s bug to fix.
As a general note, always make sure you update mods in case it’s been fixed in a later version.

1 Like

When you tested it without sponge did you ensure you used a fresh world?

In my testing, the issue appeared once Sponge was introduced. Afterwards, with the same save, it stayed.

Ah yes, I didn’t delete the world when testing. It seems to be fine on a fresh world without SpongeForge but as you said, once introduced it will spam errors.

The investigation continues…

As per your request: the client log, server log and fml-server log :slight_smile:
I tried to upload them as attachments, but this forum doesn’t seem to allow .log filetypes as attachments, so Drive links will have to do :stuck_out_tongue:

Edit: I forgot to mention that I am using the latest versions of Pixelmon, Sponge and Forge on both the client-side and the server-side (except for, you know, Sponge, since it’s a server-side only mod)

Edit2: Fixed the links. Thanks for giving me the links in random order Google.

OK I have fixed the issue!
https://github.com/SpongePowered/SpongeForge/commit/9f74b7194c4a4f93ee247140875617884b02c394

Build 924+ contains the fix.

This was a difficult one to track down where the issue came from.
In fact, I even made my own test mod using snippets of pixelmon code to track down exactly what was going wrong.
The issue was related to Apricorns, which appear naturally in the world which would explain why flying around caused the issue.
For existing worlds, you will still get the client spam until you break all existing Apricorns in the world. New worlds will not have any issues.

3 Likes

Awesome! Thanks for taking your time to look into this issue as well as communicating everything back to us here on the forum :slight_smile:

1 Like