Ellpeck / ActuallyAdditions

A Minecraft Mod about lots of useful gadgets and things!
http://minecraft.curseforge.com/projects/actually-additions
MIT License
215 stars 99 forks source link

Null error spam #1307

Closed runescapejon closed 4 years ago

runescapejon commented 4 years ago

getting this null erorr spam Here a screenshot of the system that it's causing the spam because i am unable to reproduce this error sorry, the location of the block that in the pastebin does come from the Log once the auto-placer does place it https://gyazo.com/78171d920f15d4d892c1cf95cf54ef24 https://gyazo.com/88629012280a070acf9d1cb7022ea97d https://gyazo.com/6255738e706374b36c9107b442c5496d https://pastebin.com/raw/MH6jb9ZX

EDIT: also on version ActuallyAdditions-1.12.2-r151

Ellpeck commented 4 years ago

This is a Sponge issue.

TheFlash787 commented 4 years ago

@Ellpeck This isn't a Sponge issue. The issue is down to how the mod is handling block placing, which Sponge purely tracks, it doesn't interfere.

Are you able to do anything about this? It plagues public server owners, where the majority will run Sponge, regardless of whether Sponge is actually the issue or not.

Thanks.

MorningSage commented 4 years ago

The issue is most definitely with Sponge... You can't come to people and tell them to adjust their code because another mod has a bug. Furthermore, you can't insist they fix it whether it's actually their problem or not.

Because I enjoy Ellpeck's work and this irks me, I took some time to show you that it's not his fault. This is a Sponge issue and here's why. You will need to take it up with them.

Ellpeck's code:

fake.interactionManager.processRightClickBlock(fake, world, fake.getHeldItemMainhand(), EnumHand.MAIN_HAND, offsetPos, side.getOpposite(), 0.5F, 0.5F, 0.5F);

There is nothing null being passed here.

The only reasonable alternative is that the faulty code is somewhere after the call. This is confirmed by the stack trace which states that the error is in SpongeImplHooks.java:

at org.spongepowered.common.SpongeImplHooks.getInteractionCancellationResult(SpongeImplHooks.java:2743) ~[SpongeImplHooks.class:1.12.2-2838-7.1.10-RC4000]
at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:868) ~[or.class:?]
at de.ellpeck.actuallyadditions.mod.util.WorldUtil.useItemAtSide(WorldUtil.java:194) [WorldUtil.class:?]

Sponge is not only overriding Minecraft code but they are also overriding their own code that overwrites Minecraft code. It's kind of a mess...

This is what's happening:

final SpongeToForgeEventData eventData = (SpongeToForgeEventData) forgeEventObject;
return eventData == null ? EnumActionResult.PASS : ((PlayerInteractEvent) eventData.getForgeEvent()).getCancellationResult(); // SpongeForge - return event result

You can see, they do a null check on eventData, but they then call a method on it named getForgeEvent() and cast that to a PlayerInteractEvent object. The call returns null SOMEWHERE and that is what's really causing the issue. A null PlayerInteractEvent object obviously does not have a method named getCancellationResult() and an error is thrown.

To re-iterate:

This is a Sponge issue.

If you want it fixed, you'll need to open a ticket on their side and they can look into why this particular use case is causing a bug in their code. If they want to override Minecraft/Forge code and then override THAT code, it's their responsibility to ensure that they don't introduce issues with mods that happen to use that code. Ellpeck should not need to adjust his code because THEY have a bug and he certainly shouldn't need to deal with random people insisting that it's his fault and telling him to just go ahead and fix it regardless...