B1n-ry / Youre-in-grave-danger

A minecraft mod which adds one single block. The grave, which will generate when you die, and store your items
https://www.curseforge.com/minecraft/mc-mods/youre-in-grave-danger
MIT License
59 stars 16 forks source link

Still not compatible with Traveler's Backpack #142

Closed WhitePaper233 closed 6 months ago

WhitePaper233 commented 6 months ago

I downloaded the latest version of the just action autobuild, and in this version right clicking on the grave after dying with a backpack on doesn't cause the server to crash, but it also doesn't return the backpack to the player (the backpack disappears)I would appreciate it if you could resolve this issue!

B1n-ry commented 6 months ago

Thank you for reporting this. I will need to do some extensive testing as I've done some changes in the last few commits to how items are stored (their drop rules are now also stored/cached at the same time), and some stuff might break. So at the moment it's possibly quite unstable, specifically with mod compats. Should have fixed this one issue in the latest commit though. Haven't noticed any other issue yet, but I still know some cases I need to test Basically what I'm saying is it could work fine, but tread with caution, since things could also go wrong

jwidess commented 6 months ago

Just experienced this issue myself, however upon reteving my grave it DID cause the server to crash with the following message in the console. Full log is attached as well.

crash-2024-01-21_13.53.47-server.txt

EDIT: Upon restarting the server and joining, I have all my stuff and my backpack has been equipped properly, but my gravestone is still on the ground. So it seems the retrieval works, but it crashes the server.

[13:53:47 ERROR] [Server thread]: [MinecraftServer] Encountered an unexpected exception
java.lang.NoSuchMethodError: 'void com.tiviacz.travelersbackpack.component.ITravelersBackpackComponent.syncToTracking(net.minecraft.class_3222)'
        at com.b1n_ry.yigd.compat.TravelersBackpackCompat$TBCompatComponent.storeToPlayer(TravelersBackpackCompat.java:81) ~[youre-in-grave-danger-2.0.0-beta.6.jar:?]
        at com.b1n_ry.yigd.components.InventoryComponent.applyToPlayer(InventoryComponent.java:443) ~[youre-in-grave-danger-2.0.0-beta.6.jar:?]
        at com.b1n_ry.yigd.components.GraveComponent.applyToPlayer(GraveComponent.java:480) ~[youre-in-grave-danger-2.0.0-beta.6.jar:?]
        at com.b1n_ry.yigd.components.GraveComponent.claim(GraveComponent.java:335) ~[youre-in-grave-danger-2.0.0-beta.6.jar:?]
        at com.b1n_ry.yigd.block.GraveBlock.use(GraveBlock.java:152) ~[youre-in-grave-danger-2.0.0-beta.6.jar:?]
        at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.use(BlockBehaviour.java:1133) ~[?:?]
        at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:343) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1140) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:34) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:8) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:22) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:156) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:782) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:164) ~[server-intermediary.jar:?]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:130) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:764) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:758) ~[server-intermediary.jar:?]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:139) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:743) ~[server-intermediary.jar:?]        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:675) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:265) ~[server-intermediary.jar:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Tiviacz1337 commented 6 months ago

Hello, I'll try to release fix for this, I'll add back the deleted method, so it'll prevent the crash. It will be empty method, but will prevent the issue. I'll try to do this tomorrow

B1n-ry commented 6 months ago

There's no need. I've uploaded a new version just now that fixes this. I've just been waiting for the last 2 hours for the version to get approved so I could respond and close the issue at the same time (as I like to only close issues once they've been released publicly)

Tiviacz1337 commented 6 months ago

do you release update for older versions too?

B1n-ry commented 6 months ago

Oh, um... no I don't

Tiviacz1337 commented 6 months ago

Yeah, so I'll release update for older versions too

Tiviacz1337 commented 6 months ago

Okay, actually I've checked your code and in older versions you use equipBackpack method, which do not cause any errors. the issue was only present in 1.20.1 because you switched to manual syncing. I'm not going to release any updates and issue is resolved