Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compability with MineColonies' farmer #201

Open
wants to merge 1 commit into
base: 1.19
Choose a base branch
from

Conversation

milkyskies
Copy link

@milkyskies milkyskies commented Aug 18, 2024

Fixes the following issue caused by MineColonies' farmer attempting to interact with block.

[198月2024 01:47:43.648] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "net.minecraft.world.entity.player.Player.m_21023_(net.minecraft.world.effect.MobEffect)" because "owner" is null
	Index: 2
	Listeners:
		0: NORMAL
		1: ASM: class com.legacy.blue_skies.events.SkiesPlayerEvents onToolUse(Lnet/minecraftforge/event/level/BlockEvent$BlockToolModificationEvent;)V
		2: ASM: class com.infamous.dungeons_mobs.entities.EntityEvents preventBlockInteraction(Lnet/minecraftforge/event/level/BlockEvent$BlockToolModificationEvent;)V
		3: ASM: class net.mehvahdjukaar.supplementaries.common.events.forge.ServerEventsForge toolModification(Lnet/minecraftforge/event/level/BlockEvent$BlockToolModificationEvent;)V
		4: ASM: class vazkii.quark.base.handler.ToolInteractionHandler toolActionEvent(Lnet/minecraftforge/event/level/BlockEvent$BlockToolModificationEvent;)V
java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.m_21023_(net.minecraft.world.effect.MobEffect)" because "owner" is null
	at TRANSFORMER/[email protected]/com.infamous.dungeons_mobs.entities.EntityEvents.preventBlockInteraction(EntityEvents.java:88)
	at TRANSFORMER/[email protected]/com.infamous.dungeons_mobs.entities.__EntityEvents_preventBlockInteraction_BlockToolModificationEvent.invoke(.dynamic)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
	at TRANSFORMER/[email protected]/net.minecraftforge.event.ForgeEventFactory.onToolUse(ForgeEventFactory.java:328)
	at TRANSFORMER/[email protected]/net.minecraftforge.common.extensions.IForgeBlockState.getToolModifiedState(IForgeBlockState.java:660)
	at TRANSFORMER/[email protected]/steve_gall.minecolonies_compatibility.core.common.block.BlockUtils.getToolModifiedState(BlockUtils.java:30)
	at TRANSFORMER/[email protected]/steve_gall.minecolonies_compatibility.core.common.block.BlockUtils.getHoeTilledState(BlockUtils.java:22)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.farmer.EntityAIWorkFarmer.handler$bei000$findHoeableSurface_TAIL(EntityAIWorkFarmer.java:2137)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.farmer.EntityAIWorkFarmer.findHoeableSurface(EntityAIWorkFarmer.java:363)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.farmer.EntityAIWorkFarmer.lambda$prepareForFarming$1(EntityAIWorkFarmer.java:264)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.farmer.EntityAIWorkFarmer.checkIfShouldExecute(EntityAIWorkFarmer.java:308)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.farmer.EntityAIWorkFarmer.prepareForFarming(EntityAIWorkFarmer.java:264)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition.getNextState(BasicTransition.java:79)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicStateMachine.transitionToNext(BasicStateMachine.java:163)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicStateMachine.checkTransition(BasicStateMachine.java:149)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.checkTransition(TickRateStateMachine.java:133)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.tick(TickRateStateMachine.java:109)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.basic.AbstractAISkeleton.tick(AbstractAISkeleton.java:61)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.ai.citizen.CitizenAI.lambda$registerWorkAI$4(CitizenAI.java:96)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition.getNextState(BasicTransition.java:79)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicStateMachine.transitionToNext(BasicStateMachine.java:163)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicStateMachine.checkTransition(BasicStateMachine.java:149)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.checkTransition(TickRateStateMachine.java:133)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.tick(TickRateStateMachine.java:109)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.citizen.EntityCitizen.lambda$new$11(EntityCitizen.java:295)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicTransition.checkCondition(BasicTransition.java:87)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.basestatemachine.BasicStateMachine.checkTransition(BasicStateMachine.java:138)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.checkTransition(TickRateStateMachine.java:133)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine.tick(TickRateStateMachine.java:109)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.citizen.AbstractEntityCitizen.m_8107_(AbstractEntityCitizen.java:434)
	at TRANSFORMER/[email protected]/com.minecolonies.core.entity.citizen.EntityCitizen.m_8107_(EntityCitizen.java:734)
	at TRANSFORMER/[email protected]/net.minecraft.world.entity.LivingEntity.m_8119_(LivingEntity.java:2291)
	at TRANSFORMER/[email protected]/net.minecraft.world.entity.Mob.m_8119_(Mob.java:318)
	at TRANSFORMER/[email protected]/com.minecolonies.api.entity.citizen.AbstractCivilianEntity.m_8119_(AbstractCivilianEntity.java:88)
	at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.m_8647_(ServerLevel.java:658)
	at TRANSFORMER/[email protected]/net.minecraft.world.level.Level.m_46653_(Level.java:457)
	at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.m_184063_(ServerLevel.java:323)
	at TRANSFORMER/[email protected]/net.minecraft.world.level.entity.EntityTickList.m_156910_(EntityTickList.java:54)
	at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:303)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:866)
	at TRANSFORMER/[email protected]/net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:292)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244)
	at java.base/java.lang.Thread.run(Thread.java:833)

@milkyskies milkyskies changed the title 1.19 Fix compability with MineColonies' farmer Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant