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

[1.18.2] NPE in PowerEventHandler.onBoneMeal() if bonemeal is used by dispenser #26

Open
linuskr opened this issue Dec 18, 2022 · 0 comments

Comments

@linuskr
Copy link

linuskr commented Dec 18, 2022

When bonemeal is used by anything not a player, event.getPlayer() returns null, and calling .getRandom() on that then crashes the server.

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.m_21187_()" because the return value of "net.minecraftforge.event.entity.player.BonemealEvent.getPlayer()" is null
   8   │     at limonblaze.originsclasses.common.event.PowerEventHandler.onBoneMeal(PowerEventHandler.java:106) ~[origins-classes-forge-1.1.6.jar%23219!/:1.1.6] {re:classloading}
   9   │     at net.minecraftforge.eventbus.ASMEventHandler_677_PowerEventHandler_onBoneMeal_BonemealEvent.invoke(.dynamic) ~[?:?] {}
  10   │     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%232!/:?] {}
  11   │     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!/:?] {}
  12   │     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!/:?] {}
  13   │     at net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(ForgeEventFactory.java:393) ~[forge-1.18.2-40.1.84-universal.jar%23313!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:runtimedistcleaner:A}
  14   │     at net.minecraft.world.item.BoneMealItem.applyBonemeal(BoneMealItem.java:66) ~[server-1.18.2-20220404.173914-srg.jar%23308!/:?] {re:mixin,re:classloading,pl:mixin:APP:byg.mixins.json:common.item.MixinBoneMealItem,pl:mixin:A}

forge 1.18.2-40.1.84
origins-classes-forge 1.1.6 and 1.1.5.1, probably earlier versions too.

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

No branches or pull requests

1 participant