Closed runescapejon closed 4 years ago
This is a Sponge issue.
@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.
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.
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.
fake
, world
, and fake.getHeldItemMainhand()
cannot be null considering the checks that are in place. The first two because they are used before ever getting to this point in the code and getHeldItemMainhand()
will return an empty ItemStack if there's nothing being held, not null.EnumHand.MAIN_HAND
is an enum and obviously isn't null.offsetPos
is not null because it was used before and would have cause issues within the first few lines of the method.side.getOpposite()
Enum.0.5F
, 0.5F
, 0.5F
numbers are obviously not null.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:
processRightClickBlock
is being overridden herereturn SpongeImplHooks.getInteractionCancellationResult(forgeEventObject);
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...
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