BreweryTeam / BreweryX

An actively maintained, support given, and addon supported fork of Brewery with tons of extra features.
https://discord.gg/3FkNaNDnta
GNU General Public License v3.0
58 stars 21 forks source link

Crash on Folia after a restart #50

Closed Trard closed 1 week ago

Trard commented 1 week ago

It probably happens after players use barrels and the server restarts.

Here is the log

[12:29:42 ERROR]: Error occurred while enabling BreweryX v3.3.4 (Is it up to date?)
java.lang.NullPointerException: Cannot read field "captureTreeGeneration" because the return value of "net.minecraft.world.level.Level.getCurrentWorldData()" is null
        at net.minecraft.world.level.Level.getBlockState(Level.java:1311) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at org.bukkit.craftbukkit.block.CraftBlock.getType(CraftBlock.java:244) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at BreweryX-3.3.4.jar/com.dre.brewery.BarrelBody.getBrokenBlock(BarrelBody.java:255) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.BarrelBody.regenerateBounds(BarrelBody.java:238) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.BarrelBody.<init>(BarrelBody.java:44) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.Barrel.<init>(Barrel.java:106) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.storage.impls.FlatFileStorage.getBarrel(FlatFileStorage.java:70) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.storage.impls.FlatFileStorage.getAllBarrels(FlatFileStorage.java:83) ~[BreweryX-3.3.4.jar:?]
        at BreweryX-3.3.4.jar/com.dre.brewery.BreweryPlugin.onEnable(BreweryPlugin.java:162) ~[BreweryX-3.3.4.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:647) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:596) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:779) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:526) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:329) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1280) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:356) ~[folia-1.21.1.jar:1.21.1-DEV-5833269]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Trard commented 1 week ago

duplicate https://github.com/Jsinco/BreweryX/issues/41