BentoBoxWorld / AOneBlock

A OneBlock Minecraft Game for BentoBox
https://docs.bentobox.world
Eclipse Public License 2.0
77 stars 29 forks source link

Admin setchest command fails #112

Closed tastybento closed 8 months ago

tastybento commented 4 years ago

Description

Describe the bug

Admin set chest command fails.

Steps to reproduce the behavior

Look at a chest and run /oba setchest

[20:09:23 INFO]: BoxManager issued server command: /oba setchest Desert COMMON
[20:09:24 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'oba setchest Desert COMMON' in world.bentobox.aoneblock.commands.AdminCommand(obadmin)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.16.1.jar:git-Paper-113]
    at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServer.java:794) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.PlayerConnection.handleCommand(PlayerConnection.java:1912) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1723) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1136) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1129) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1090) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1004) ~[patched_1.16.1.jar:git-Paper-113]
    at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-113]
    at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
    at world.bentobox.aoneblock.oneblocks.OneBlocksManager.getPhaseFileName(OneBlocksManager.java:354) ~[?:?]
    at world.bentobox.aoneblock.oneblocks.OneBlocksManager.lambda$saveOneBlockConfig$7(OneBlocksManager.java:326) ~[?:?]
    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
    at world.bentobox.aoneblock.oneblocks.OneBlocksManager.saveOneBlockConfig(OneBlocksManager.java:307) ~[?:?]
    at world.bentobox.aoneblock.commands.AdminSetChestCommand.execute(AdminSetChestCommand.java:104) ~[?:?]
    at world.bentobox.bentobox.api.commands.CompositeCommand.call(CompositeCommand.java:266) ~[?:?]
    at world.bentobox.bentobox.api.commands.CompositeCommand.execute(CompositeCommand.java:239) ~[?:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.1.jar:git-Paper-113]
    ... 17 more

Expected behavior

Work.

Screenshots and videos (Optional)

Environment

Output of /bbox version (Mandatory)
> bbox version
[20:11:28 INFO]: Running PAPER 1.16.1.
[20:11:28 INFO]: BentoBox version: 1.15.0-SNAPSHOT-LOCAL
[20:11:28 INFO]: Database: JSON
[20:11:28 INFO]: Loaded Game Worlds:
[20:11:28 INFO]: acidisland_world (AcidIsland): Overworld, Nether, The End
[20:11:29 INFO]: bskyblock_world (BSkyBlock): Overworld, Nether, The End
[20:11:29 INFO]: caveblock-world (CaveBlock): Overworld, Nether, The End
[20:11:29 INFO]: oneblock_world (OneBlock): Overworld, Nether*
[20:11:29 INFO]: Loaded Addons:
[20:11:29 INFO]: AcidIsland 1.14.0-SNAPSHOT-b821 (ENABLED)
[20:11:29 INFO]: AOneBlock 1.4.0-SNAPSHOT-LOCAL (ENABLED)
[20:11:29 INFO]: BentoBox-InvSwitcher 1.6.1 (ENABLED)
[20:11:29 INFO]: Biomes 1.13.0-SNAPSHOT-b173 (ENABLED)
[20:11:29 INFO]: Border 1.0.9-SNAPSHOT-b35 (DISABLED)
[20:11:29 INFO]: BSkyBlock 1.14.0-SNAPSHOT-b661 (ENABLED)
[20:11:29 INFO]: CauldronWitchery 1.5.0.0-SNAPSHOT-#12 (ENABLED)
[20:11:29 INFO]: CaveBlock 1.14.0-SNAPSHOT-b350 (ENABLED)
[20:11:29 INFO]: Challenges 0.8.4-SNAPSHOT-b428 (ENABLED)
[20:11:29 INFO]: Chat 1.1.0-SNAPSHOT-b28 (ENABLED)
[20:11:29 INFO]: CheckMeOut 1.0.2 (ENABLED)
[20:11:29 INFO]: ControlPanel 1.13.0-SNAPSHOT-b30 (ENABLED)
[20:11:29 INFO]: DimensionalTrees 1.6.1-SNAPSHOT-b81 (ENABLED)
[20:11:29 INFO]: ExtraMobs 1.11.0.3-SNAPSHOT-b5 (ENABLED)
[20:11:29 INFO]: Greenhouses 1.2.0-SNAPSHOT-LOCAL (ENABLED)
[20:11:29 INFO]: IslandFly 1.8.0-SNAPSHOT-b111 (ENABLED)
[20:11:29 INFO]: Level 2.4.0-SNAPSHOT-LOCAL (ENABLED)
[20:11:29 INFO]: Likes 2.0.0-SNAPSHOT-b24 (ENABLED)
[20:11:29 INFO]: Limits 1.14.0-SNAPSHOT-b222 (ENABLED)
[20:11:29 INFO]: MagicCobblestoneGenerator 2.1.0-SNAPSHOT-LOCAL (ENABLED)
[20:11:29 INFO]: TwerkingForTrees 1.4.1-SNAPSHOT-b41 (ENABLED)
[20:11:29 INFO]: Upgrades 0.2.0-SNAPSHOT-b48 (ENABLED)
[20:11:29 INFO]: VoidPortals 1.5.0.1-SNAPSHOT-b80 (ENABLED)
[20:11:29 INFO]: Warps 1.10.0-SNAPSHOT-b257 (ENABLED)

Plugins (Optional)

> plugins
[20:11:40 INFO]: Plugins (2): BentoBox, PlaceholderAPI
> 

Additional context (Optional)

tastybento commented 4 years ago

Caused by a malformed goto phase. Check your goto phase file, probably 11000_goto_0.yml It should be:

'11000':
  gotoBlock: 0
Fredthedoggy commented 4 years ago

Attached is my phases folder zipped, as requested on discord. (I would prefer if others do not use them commerically)

tastybento commented 4 years ago

I don’t see the zip so you can send it to tastybento @ BentoBox.world

Fredthedoggy commented 4 years ago

I realised I forgot to say, I emailed my phases folder to you @tastybento

tastybento commented 4 years ago

Got it, I'm checking it now.

tastybento commented 4 years ago

Okay, the issue is that you have two phases that have the same number: 11000 pillage and also 11000 village & pillage. You should choose one and delete the other (the chest files too).

I'll see if I can add some checking to alert on this kind of thing.

Fredthedoggy commented 4 years ago

Oh oops, you're right, can the file name be whatever I want? Or does it need to be number_phasename.yml?

tastybento commented 4 years ago

It has to be number_phasename.yml

Fredthedoggy commented 4 years ago

Well thats unfortunate, because bentobox never loads phases with an & in the name, from my testing.