Vampirism - Become a vampire!

Vampirism - Become a vampire!

16M Downloads

[Bug]: Log spam and lag in onPlayerLeftLickedBlock

Dunkmania101 opened this issue · 1 comments

commented

Minecraft Version

1.16.x

Forge Version

36.2.29

Vampirism Version

1.8.6

Modpack

No response

Singleplayer/Multiplayer

Singleplayer

What happened?

My world starts to lag after a few minutes of being and the log file has the message below printed every few seconds. It looks to me like the nonnull assertion here is to blame. I don't know why that value is null, though.
One fix might be to replace that line like this:

< assert event.getFace() != null;
---
> if (event.getFace() == null) {return;}

It's not ideal but the current solution doesn't get any farther into the method and this one would at least avoid the lag and log spam.

While I'm here I might as well also point out that the method name has a typo in it: Lick instead of Click

Relevant log output

[22:57:57] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 6246ms or 124 ticks behind
[22:58:00] [Server thread/ERROR]: Exception caught during firing event: Cannot invoke "net.minecraft.util.Direction.func_82601_c()" because "☃" is null
	Index: 41
	Listeners:
		0: HIGHEST
		1: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@6b80173a
		2: ASM: class ovh.corail.tombstone.event.EventHandler onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		3: ASM: class com.ma.events.InputDisabler onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		4: ASM: class me.desht.pneumaticcraft.common.tileentity.TileEntitySecurityStation$Listener onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		5: HIGH
		6: ASM: class me.shedaniel.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		7: NORMAL
		8: ASM: class com.endertech.minecraft.forge.items.GlassMeter onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		9: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@5077c623
		10: ASM: class io.github.wouink.furnish.event.KnockOnDoor onDoorHit(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		11: ASM: class com.dannyandson.tinyredstone.CommonBinding onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		12: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@15c071dd
		13: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@4432b49
		14: ASM: class sonar.fluxnetworks.register.CommonEventHandler onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		15: ASM: class gg.moonflower.pollen.core.forge.PollenCommonForgeEvents onEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		16: ASM: class me.desht.modularrouters.event.ClientEventHandler onPlayerLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		17: ASM: com.bobmowzie.mowziesmobs.server.ServerEventHandler@2321a666 onPlayerLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		18: ASM: com.bobmowzie.mowziesmobs.server.ability.AbilityCommonEventHandler@4ea3dda7 onPlayerLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		19: ASM: se.mickelus.tetra.effect.ItemEffectHandler@8cec3d4 onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		20: ASM: class xfacthd.framedblocks.common.util.EventHandler onBlockLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		21: ASM: class me.desht.pneumaticcraft.common.item.ItemGPSAreaTool$EventHandler onBlockLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		22: ASM: class me.desht.pneumaticcraft.common.item.ItemMemoryStick$Listener onLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		23: ASM: class me.desht.pneumaticcraft.common.item.ItemJackHammer$Listener onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		24: ASM: class com.github.alexthe666.rats.server.events.CommonEvents onPlayerLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		25: ASM: com.feywild.feywild.EventListener@6071fdec blockInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		26: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@6f91d53c
		27: ASM: class com.hollingsworth.arsnouveau.common.event.ReactiveEvents leftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		28: ASM: class com.hollingsworth.arsnouveau.common.block.TimerSpellTurret leftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		29: ASM: class com.minecraftabnormals.savageandravage.core.other.SREvents onLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		30: ASM: stepsword.mahoutsukai.handlers.ServerHandler@1188c327 leftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		31: ASM: stepsword.mahoutsukai.client.ClientHandler@3fc09d0b leftClickEventBlockP(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		32: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@1395033
		33: ASM: class com.lilypuree.decorative_blocks.setup.ModSetup onLeftClickEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		34: ASM: class mod.chiselsandbits.events.LeftClickEventHandler onPlayerInteractLeftClickBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		35: ASM: class com.simibubi.create.content.logistics.block.mechanicalArm.ArmInteractionPointHandler leftClickingBlocksDeselectsThem(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		36: ASM: class com.simibubi.create.content.logistics.block.depot.EjectorTargetHandler leftClickingBlocksDeselectsThem(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		37: ASM: class com.simibubi.create.content.curiosities.zapper.ZapperInteractionHandler leftClickingBlocksWithTheZapperSelectsTheBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		38: ASM: class com.ma.events.CommonEventHandler onBlockLeftClicked(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		39: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@17618750
		40: ASM: de.maxhenkel.camera.ServerEvents@5afc051 onLeftClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		41: ASM: de.teamlapen.vampirism.player.ModPlayerEventHandler@355b77f2 onPlayerLeftLickedBlock(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		42: ASM: com.lothrazar.cyclic.event.ItemEvents@493db992 onHit(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		43: ASM: mcjty.lib.setup.ModSetup$EventHandler@77f14963 onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		44: ASM: class team.chisel.common.item.ChiselController onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent$LeftClickBlock;)V
		45: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@a65ff96
		46: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@6b3cf3d3
		47: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@204f8e4f
		48: ASM: me.desht.pneumaticcraft.common.event.UniversalSensorHandler@1073a4e3 onInteraction(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		49: ASM: com.mrcrayfish.vehicle.common.CommonEvents@e407739 onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		50: ASM: com.integral.enigmaticlegacy.handlers.EnigmaticEventHandler@7cf1d4b7 onPlayerClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		51: ASM: class cofh.ensorcellation.event.CommonEvents handlePlayerRightClickEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		52: ASM: appeng.parts.PartPlacement@2b89ccd1 playerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		53: ASM: vazkii.quark.content.tweaks.module.ImprovedSleepingModule@491b72dc onPlayerClick(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		54: ASM: class team.creative.itemphysic.server.ItemPhysicServer onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		55: ASM: romelo333.notenoughwands.ForgeEventHandlers@71a02d5a onPlayerInteractEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		56: ASM: mcjty.rftoolsutility.setup.ForgeEventHandlers@f6412e0 onPlayerInteractEvent(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		57: ASM: class team.creative.itemphysic.client.ItemPhysicClient onPlayerInteract(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		58: ASM: com.minecolonies.coremod.permissions.ColonyPermissionEventHandler@2da26e27 on(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
		59: ASM: mob_grinding_utils.events.ChickenFuseEvent@19701225 startChickenFuse(Lnet/minecraftforge/event/entity/living/LivingEvent;)V
		60: LOW
		61: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@3b0fc611
		62: LOWEST
		63: net.minecraftforge.eventbus.EventBus$$Lambda$3117/0x00000008019e5a80@1eb307a9
		64: ASM: class com.simibubi.create.content.curiosities.tools.ExtendoGripItem consumeDurabilityOnPlace(Lnet/minecraftforge/event/entity/player/PlayerInteractEvent;)V
java.lang.NullPointerException: Cannot invoke "net.minecraft.util.Direction.func_82601_c()" because "☃" is null
	at net.minecraft.util.math.BlockPos.func_177972_a(SourceFile:214)
	at de.teamlapen.vampirism.player.ModPlayerEventHandler.onPlayerLeftLickedBlock(ModPlayerEventHandler.java:415)
	at net.minecraftforge.eventbus.ASMEventHandler_7922_ModPlayerEventHandler_onPlayerLeftLickedBlock_LeftClickBlock.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at net.minecraftforge.common.ForgeHooks.onLeftClickBlock(ForgeHooks.java:823)
	at net.minecraft.server.management.PlayerInteractionManager.func_225416_a(PlayerInteractionManager.java:130)
	at com.lothrazar.cyclic.base.TileEntityBase.leftClickBlock(TileEntityBase.java:148)
	at com.lothrazar.cyclic.block.user.TileUser.func_73660_a(TileUser.java:109)
	at net.minecraft.world.World.redirect$clg000$redirectTick(MixinWorldRedstone.java:4211)
	at net.minecraft.world.World.func_217391_K(MixinWorldRedstone.java:491)
	at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:371)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:851)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:78)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642)
	at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232)
	at java.base/java.lang.Thread.run(Thread.java:833)

Reproduce steps

All I know is that I have a lot of mods installed and the mentioned line detects and logs an unacceptable null value error when the left-click event handler is called. I don't have enough information to state why the value is null, only that it is and how it might be fixed, at least temporarily.

Other relevant mods

No response

commented

Thank you for reporting. Will be fixed with the next release.
However, I doubt this is the cause of the lag you are experiencing. The exception and the log line, shouldn't cause the sever to hang for 6s