Lightman's Currency

Lightman's Currency

331k Downloads

BUG: NullPointerException on treeGrowEvent in BlockGrowFeatureEvent

Largosaki opened this issue ยท 1 comments

commented

Minecraft Version

1.20.1

Forge Version

47.2.18

Lightman's Currency Version

1.20.1-47.2.18

Environment Type

Dedicated Server (Bug/crash happened while connected to a server or while the dedicated server was booting)

Other relevant Mods

NaturesAura

Describe the bug

src/main/java/io/github/lightman314/lightmanscurrency/common/EventHandler.java

at 355 line

@SubscribeEvent
public static void treeGrowEvent(BlockGrowFeatureEvent event)
{
if (holder != null && holder.value() != null && holder.value().feature() instanceof AbstractHugeMushroomFeature feature) { }

}

maybe can fix it

To Reproduce

take a naturesaura:ancient_sapling plant the seed until it grows

Screenshots/Logs/Crash Reports

[01:18:23] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "net.minecraft.core.Holder.get()" because the return value of "net.minecraftforge.event.level.SaplingGrowTreeEvent.getFeature()" is null
Index: 1
Listeners:
0: NORMAL
1: ASM: class io.github.lightman314.lightmanscurrency.common.EventHandler treeGrowEvent(Lnet/minecraftforge/event/level/SaplingGrowTreeEvent;)V
2: ASM: Block{minecraft:air} onTreeGrow(Lnet/minecraftforge/event/level/SaplingGrowTreeEvent;)V
3: ASM: Block{minecraft:air} onTreeGrow(Lnet/minecraftforge/event/level/SaplingGrowTreeEvent;)V
java.lang.NullPointerException: Cannot invoke "net.minecraft.core.Holder.get()" because the return value of "net.minecraftforge.event.level.SaplingGrowTreeEvent.getFeature()" is null
at TRANSFORMER/[email protected]/io.github.lightman314.lightmanscurrency.common.EventHandler.treeGrowEvent(EventHandler.java:411)
at TRANSFORMER/[email protected]/io.github.lightman314.lightmanscurrency.common.EventHandler_treeGrowEvent_SaplingGrowTreeEvent.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.blockGrowFeature(ForgeEventFactory.java:738)
at TRANSFORMER/[email protected]/de.ellpeck.naturesaura.blocks.BlockAncientSapling.m_214148
(BlockAncientSapling.java:77)
at TRANSFORMER/[email protected]/net.minecraft.world.item.BoneMealItem.applyBonemeal(BoneMealItem.java:73)
at TRANSFORMER/[email protected]/net.minecraft.world.item.BoneMealItem.m_6225
(BoneMealItem.java:36)
at TRANSFORMER/[email protected]/net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:585)
at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack.m_41661_(ItemStack.java:245)
at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerPlayerGameMode.m_7179_(ServerPlayerGameMode.java:358)
at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.m_6371_(ServerGamePacketListenerImpl.java:1057)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:34)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:8)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.PacketUtils.m_263899_(PacketUtils.java:22)
at TRANSFORMER/[email protected]/net.minecraft.server.TickTask.run(TickTask.java:18)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:770)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:753)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:747)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:732)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:665)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251)
at java.base/java.lang.Thread.run(Thread.java:842)

commented

Note 1

There is no Lightman's Currency version 1.20.1-47.2.18. Based off the logs provided, this is actually version 1.20.1-2.2.2.1a. Please make sure to provide an accurate version number in the future.

Note 2

Please do not copy/paste the logs into the Logs/Crash Reports field. They should be attached directly as a file (renamed to a *.txt file if necessary to get github to accept them), not pasted directly as it makes it a pain to scroll past them to read future comments & details, etc.

Note 3 (The most important one)

Please ALWAYS update LC and all relevant addons (such as LC Tech) to their latest versions before reporting an issue. In this particular case, this issue is a duplicate of issue #235 which has been fixed since LC v2.2.2.4, which was released over 5 months ago.