BentoBoxWorld / AOneBlock

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

Magic block can not respawn #48

Closed minhthanh920 closed 4 years ago

minhthanh920 commented 4 years ago

After magic block disappear and replace it then break it. the error spamming below

Describe the bug

[15:10:26 ERROR]: Could not pass event BlockBreakEvent to BentoBox v1.13.1 java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Unknown Source) ~[?:1.8.0_221] at world.bentobox.aoneblock.oneblocks.OneBlockPhase.getRandomBlock(OneBlockPhase.java:135) ~[?:?] at world.bentobox.aoneblock.oneblocks.OneBlockPhase.getNextBlock(OneBlockPhase.java:121) ~[?:?] at world.bentobox.aoneblock.listeners.BlockListener.process(BlockListener.java:259) ~[?:?] at world.bentobox.aoneblock.listeners.BlockListener.lambda$onBlockBreak$1(BlockListener.java:189) ~[?:?] at java.util.Optional.ifPresent(Unknown Source) ~[?:1.8.0_221] at world.bentobox.aoneblock.listeners.BlockListener.onBlockBreak(BlockListener.java:189) ~[?:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1050.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.15.2.jar:git-Paper-260] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.15.2.jar:git-Paper-260] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-260] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PlayerInteractManager.breakBlock(PlayerInteractManager.java:315) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PlayerInteractManager.a(PlayerInteractManager.java:274) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PlayerInteractManager.a(PlayerInteractManager.java:157) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1351) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PacketPlayInBlockDig.a(SourceFile:40) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PacketPlayInBlockDig.a(SourceFile:10) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1093) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1086) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1047) ~[patched_1.15.2.jar:git-Paper-260] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:962) ~[patched_1.15.2.jar:git-Paper-260] at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]

maxlehot1234 commented 4 years ago

Please use pastebin for a stacktrace.

Also, I think the bentobox devs need to implement a better stacktrace system first to help us work on the error instead of opening a ticket... It will save a lot of time for the dev

tastybento commented 4 years ago

I suspect you edited the oneblocks.yml and one of the phase block sections are now missing or have too many spaces so it is not recognized anymore. I'll add code to identify the erroneous phase. Try it and check the console log for errors when you break a block.

maxlehot1234 commented 4 years ago

@tastybento Let me know when I can download the next version :) So I can test it. Thanks again

tastybento commented 4 years ago

Snapshot builds are on our Jenkins Server: https://ci.codemc.io/job/BentoBoxWorld/

Beware though, they are not releases, so please test, but be careful.

maxlehot1234 commented 4 years ago

@tastybento Its a test server for now ;) I will start focussing on new feature soon with my dev.

I will test everything on a separate local server

maxlehot1234 commented 4 years ago

@tastybento I try latest version from the jenkins server and still having stacktrace like this: https://gist.github.com/maxlehot1234/f89af375f1056881f072d24d9a60cdda

>.... [19:28:17 INFO]: AOneBlock 1.2.0-SNAPSHOT-b86 ([state])
>.... [19:28:22 INFO]: Running PAPER 1.15.2.
>.... [19:28:22 INFO]: BentoBox version: 1.14.0-SNAPSHOT-b1780
>.... [19:28:22 INFO]: Database: JSON
>.... [19:28:22 INFO]: Loaded Game Worlds:
>.... [19:28:22 INFO]: oneblock_world (OneBlock): Overworld, Nether*
>.... [19:28:22 INFO]: Loaded Addons:
>.... [19:28:22 INFO]: AOneBlock 1.2.0-SNAPSHOT-b86 (ENABLED)
>.... [19:28:22 INFO]: Biomes 1.7.0 (ENABLED)
>.... [19:28:22 INFO]: Border 1.0.7 (ENABLED)
>.... [19:28:22 INFO]: Level 1.9.3 (ENABLED)
>.... [19:28:22 INFO]: Limits 1.9.4 (ENABLED)

Thanks again

tastybento commented 4 years ago

@maxlehot1234 It's a different issue. Open a new one, don't write on the bottom of a closed one. Anyway, your issue is caused by badly formatted YAML. As the whole file is loaded in by Bukkit, there's no way to tell where the bug is. You'll need to delete sections of the file until there is no error and then find where you made a mistake.

maxlehot1234 commented 4 years ago

@tastybento A ticket was already open 13 days ago related to this.

https://github.com/BentoBoxWorld/AOneBlock/issues/29#issuecomment-5

And why you are not able to put the line that have the error???