PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.73k stars 2.27k forks source link

The server crash when chunk regenrate #10957

Closed thechosecat closed 3 months ago

thechosecat commented 3 months ago

Stack trace

[paste your stack trace or a paste.gg link here!](https://paste.gg/p/anonymous/62ae56763f4d45ad89e13b5bb9120724/revisions)

Plugin and Datapack List

[22:02:37 INFO]: - MarriageMaster, Minepacks [22:02:37 INFO]: Bukkit Plugins: [22:02:37 INFO]: - AntiCrasher, AutoShutdown, BanFromClaim, BetterRTP, BottledExp, Cat_Nurfpemtume, CatArmor_Stand_Tools, catautofly, CatAutoRemoveClaim, catAutoRestart [22:02:37 INFO]: CatChatGUI, CatClaimBuy, Catclaimfly, CatCore-v2.0, catHopperliimt, CatMobMoney, catNick, CatnoobEnchantAddonPlugin, catnoobKit, CatOreReplace [22:02:37 INFO]: CatRaidLimitPlugin, CatShiftFcommand, CatSpyDropper, ChatHelper, ChestCommands, ChestSort, Claimtp, ClearLag, CMILib, CoCoBeenAgreeRulesPlugin [22:02:37 INFO]: CommandTimer, CoreProtect, DecentHolograms, DeluxeMenus, DiscordSRV, Elevators, EpicRename, Essentials, EssentialsMysqlStorage, EssentialsSpawn [22:02:37 INFO]: ExcellentEnchants, ez-broadcast, FastAsyncWorldEdit, FriendsAPIForPartyAndFriends, GriefPrevention, GriefPrevention_patch, GSit, HeadsPlus, InteractiveChat, InteractiveChatDiscordSrvAddon [22:02:37 INFO]: JoinMessagePlus, LockettePro, LuckPerms, MapSync, MarketPlace, MaSuiteCore, MaSuiteHomes, MaSuiteTeleports, MobBosser, MysqlPlayerDataBridge [22:02:37 INFO]: NatureRevive, NexEngine, PlaceholderAPI, PlayerParticles, PlayerWarps, PlugManX, ProtocolLib, PvPManager, QuickShop, QuickShopBank [22:02:37 INFO]: RHSignItem, SafariNet, ShulkerBoxPreview, spark, SuperHarvest, TAB-Bridge, UPS, Vault, VentureChat, ViaVersion [22:02:37 INFO]: Vulcan, WorldBorder, XConomy

[22:02:53 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)] [22:02:53 INFO]: There are no more data packs available

Actions to reproduce (if known)

When the code provided below regenerates certain chunks (mostly villages) the server will freeze and crash. This happens approximately once every one to two days, depending on the number of chunks that need to be regenerated, as recorded

Paper version

version [22:03:15 INFO]: Checking version, please wait... [22:03:15 INFO]: This server is running Paper version git-Paper-196 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 773dd72) You are running the latest version Previous version: git-Paper-84 (MC: 1.20.1)

Other

I have developed a plugin that periodically regenerates the chunks I have recorded. I used the following code to let FAWE handle the regeneration. However, sometimes (it seems to happen mostly in village chunks), the generation process produces the following error. I'm not sure if this is an issue with Paper FAWE or with the vanilla version. Here is some basic information:

regenerate code:

    public static void regenerateFA(Chunk chunk, boolean regenBiomes) {
        long o = System.currentTimeMillis();
        com.sk89q.worldedit.world.World world2 = BukkitAdapter.adapt(chunk.getWorld());
        EditSession session = WorldEdit.getInstance().newEditSession(world2);
        Mask mask = session.getMask();
        BlockVector3 one = BlockVector3.at(chunk.getX()*16,-64,chunk.getZ()*16);
        BlockVector3 tow = BlockVector3.at(chunk.getX()*16+15,256,chunk.getZ()*16+15);
        Region region = new CuboidRegion(world2,one,tow);
        boolean success;
        try {
            session.setMask(null);
            //FAWE start
            session.setSourceMask(null);
            //FAWE end
            RegenOptions options = RegenOptions.builder()
                    .seed(chunk.getWorld().getSeed())
                    .regenBiomes(regenBiomes)
                    .build();
            success = world2.regenerate(region,session,options);
            Operations.complete(session.commit());
        } finally {
            session.setMask(mask);
            //FAWE start
            session.setSourceMask(mask);
            //FAWE end
        }
        if (success) {
            Bukkit.getLogger().info("[NatureRevive] 區快再生成功(FAWE-API)花費" + (System.currentTimeMillis()-o) +"ms " + chunk);
        } else {
            Bukkit.getLogger().warning("[NatureRevive] 區快再生失敗 (FAWE-API) " + chunk);
        }
        session.close();
        Bukkit.getLogger().info("[NatureRevive] session已關閉");
    }

these code will be call in async to regenrate the chunks that the plugin record. about 10 seconds called one time I have asked the dev of FastAsyncWorldEdit but did,t fix it. so maby its paper bug? any way, thanks for anyones help :D

powercasgamer commented 3 months ago

1.20.1 is no longer supported. Please try to reproduce this on 1.20.6 or 1.21.

thechosecat commented 3 months ago

okey , thanks

electronicboy commented 3 months ago

Unsupported version of paper, and generally looks like something caused the POI load to be lost. We generally cannot really comment on what plugins screwing with internals are doing, unless there is a min repro case here which can isolate the issue down in a useful (and even remotely supported behavior), there is generally nothing that we can action here