`//regen` fails in Forge environment
gabizou opened this issue ยท 2 comments
WorldEdit Version
7.2.9-SNAPSHOT (ab61a84) and 7.2.8
Platform Version
Forge 1.18.1-39.0.63
Confirmations
- I am using the most recent Minecraft release.
- I am using a version of WorldEdit compatible with my Minecraft version.
- I am using the latest or recommended version of my platform software.
- I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
- I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)
Bug Description
Using //regen on a region that ends up generating a BlockEntity (presumably in the regenerated terrain) causes an error. Terrain that doesn't generate a BE doesn't throw the error
Expected Behavior
Regen to work fine
Reproduction Steps
- Select region with a BE involved (go to a village, there's bounds to be BE's there)
- //regen
Anything Else?
Output looks like so:
[01:33:48] [Render thread/INFO]: [CHAT] Second position set to (-1427, -2, -4115) (622104).
[01:33:53] [Server thread/ERROR]: An unexpected error while handling a WorldEdit command
java.lang.NoSuchMethodError: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.BlockEntity.save(net.minecraft.nbt.CompoundTag)'
at com.sk89q.worldedit.forge.ForgeWorld.regenForWorld(ForgeWorld.java:431) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.forge.ForgeWorld.doRegen(ForgeWorld.java:343) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.forge.ForgeWorld.regenerate(ForgeWorld.java:303) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.command.RegionCommands.regenerate(RegionCommands.java:431) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.command.RegionCommandsRegistration.cmd$_regen(RegionCommandsRegistration.java:576) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at org.enginehub.piston.CommandManager.execute(CommandManager.java:157) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.handleCommand(PlatformCommandManager.java:497) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.util.eventbus.MethodHandleEventHandler.dispatch(MethodHandleEventHandler.java:51) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.util.eventbus.EventBus.dispatch(EventBus.java:193) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.util.eventbus.EventBus.post(EventBus.java:181) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at com.sk89q.worldedit.forge.ForgeWorldEdit.onCommandEvent(ForgeWorldEdit.java:337) ~[worldedit-mod-7.2.9-SNAPSHOT-dist.jar%2353!/:?]
at net.minecraftforge.eventbus.ASMEventHandler_5_ForgeWorldEdit_onCommandEvent_CommandEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%2337!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%2337!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%2337!/:?]
at net.minecraft.commands.Commands.m_82117_(Commands.java:224) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_9957_(ServerGamePacketListenerImpl.java:1134) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_143628_(ServerGamePacketListenerImpl.java:1113) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7388_(ServerGamePacketListenerImpl.java:1099) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.m_5797_(ServerboundChatPacket.java:30) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.m_5797_(ServerboundChatPacket.java:7) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:21) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:151) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:765) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:125) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:748) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:742) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:110) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:727) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:672) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
[01:33:53] [Render thread/INFO]: [CHAT] Please report this error: [See console]
[01:33:53] [Render thread/INFO]: [CHAT] java.lang.NoSuchMethodError: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.BlockEntity.save(net.minecraft.nbt.CompoundTag)'
Looks like Forge has removed the save method from the BlockEntity class for some reason - I put up a PR to use a different one, #2021
Fixed by #2021.