Skip to content

createInventory doesn't work with IvnentoryType.HOPPER #179

@ewof

Description

@ewof

Expected behavior

hopper inventory created and opened

Observed/Actual behavior

[20:04:08 WARN]: [MvndiMMO] Entity task for MvndiMMO v1.0 generated an exception
java.lang.IllegalStateException: Scheduling chunk load off-main
        at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:72) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at net.minecraft.server.level.ServerChunkCache.getChunkFutureMainThread(ServerChunkCache.java:310) ~[?:?]
        at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:238) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:919) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:858) ~[?:?]
        at net.minecraft.world.level.Level.getChunkAt(Level.java:844) ~[?:?]
        at net.minecraft.world.level.Level.getBlockEntity(Level.java:1474) ~[?:?]
        at net.minecraft.world.level.Level.getBlockEntity(Level.java:1457) ~[?:?]
        at net.minecraft.world.level.block.entity.BaseContainerBlockEntity.canUnlock(BaseContainerBlockEntity.java:81) ~[?:?]
        at net.minecraft.world.level.block.entity.BaseContainerBlockEntity.canOpen(BaseContainerBlockEntity.java:72) ~[?:?]
        at net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity.canOpen(RandomizableContainerBlockEntity.java:158) ~[?:?]
        at net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity.createMenu(RandomizableContainerBlockEntity.java:164) ~[?:?]
        at net.minecraft.server.level.ServerPlayer.openMenu(ServerPlayer.java:2000) ~[?:?]
        at org.bukkit.craftbukkit.v1_20_R2.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:351) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at net.mvndicraft.mvndimmo.gui.AnvilGUI.lambda$2(AnvilGUI.java:350) ~[MvndiMMO-1.0-SNAPSHOT.jar:?]
        at io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler$EntityScheduledTask.accept(FoliaEntityScheduler.java:168) ~[folia-1.20.2.jar:?]
        at io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler$EntityScheduledTask.accept(FoliaEntityScheduler.java:115) ~[folia-1.20.2.jar:?]
        at io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:173) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1516) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:402) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[folia-1.20.2.jar:git-Folia-"1e5e215"]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]

this stack trace

Steps/models to reproduce

Inventory inv = Bukkit.getServer().createInventory(null, InventoryType.HOPPER);

Plugin and Datapack List

[11:45:51 INFO]: Server Plugins (42):
[11:45:51 INFO]: Paper Plugins:
[11:45:51 INFO]:  - MvndiMMO, MvndiTowny, PaperMessages, TownyWaypoints
[11:45:51 INFO]: Bukkit Plugins:
[11:45:51 INFO]:  - BetterRTP, Brewery, BukkitGreentext, ChatControlRed, ChestShop, Chunky, ChunkyBorder, CoreProtect, FarmControl, FreedomChat
[11:45:51 INFO]:  GrimAC, HeadDrop, HexNicks, iConomy, InventoryRollbackPlus, InvSeePlusPlus, LiteBans, LuckPerms, MapTowny, MvndiCombat
[11:45:51 INFO]:  MvndiCore, MvndiCrafting, MvndiEquipment, MvndiGUI, MvndiGUIShop, MvndiHunters, MvndiPlayer, MvndiSiege, MvndiSounds, PlaceholderAPI
[11:45:51 INFO]:  ProtocolLib, SiegeWar, spark, squaremap, TAB, Towny, TownyMenus, Vault

Folia version

This server is running Folia version git-Folia-"1e5e215" (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 1e5e215)

Other

https://cdn.discordapp.com/attachments/1090729705222721637/1191555552485068810/2024-01-01_20-34-38.mp4?ex=65a5dd95&is=65936895&hm=c7bd0c9e33e1f3fdbadc4ebc989d70ba45f2ca369d84e9cc4ffd227fccc8a9aa&

video where stack trace happens (stack trace in video is slightly diff than what i sent earlier because its using universal scheduler, but if i just use the folia api instead of universalscheduler it gives the stacktrace earlier in the issue)

https://images-ext-1.discordapp.net/external/AU5lGheaEj16CYwqJyoQfE5ZtzHfFsO7Lr34vh9wBfo/https/feen.us/loqnpb.png?format=webp&quality=lossless

what happens on normal paper ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething doesn't work as it was intended to.version: 1.20.2Game version 1.20.2

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions