chance bound must be positive
Closed this issue · 3 comments
Spark link
No response
Plugin Version
CrazyCrates v1.21-74
Server Version
1.21
Server Platform
Purpur
Describe the bug
- set percentage to 0.5
'3':
DisplayName: '&bDiamond x32'
DisplayItem: DIAMOND
DisplayAmount: 32
DisplayLore: []
MaxRange: 100
Chance: 0.5
Firework: false
Glowing: false
Player: ''
Unbreakable: false
Items: []
Editor-Items:- ==: org.bukkit.inventory.ItemStack
v: 3953
type: DIAMOND
amount: 32
- ==: org.bukkit.inventory.ItemStack
Crate Type
None
Steps to reproduce
- open crate or /crates reload
Additional context
[CrazyCrates] Failed to find prize from the CrateExample crate for player test_account.
java.lang.IllegalArgumentException: bound must be positive
at java.base/java.util.Random.nextInt(Random.java:557) ~[?:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.api.objects.Crate.pickPrize(Crate.java:323) ~[CrazyCrates-1.21-74.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.api.objects.Crate.canWinPrizes(Crate.java:281) ~[CrazyCrates-1.21-74.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.listeners.crates.CrateOpenListener.onCrateOpen(CrateOpenListener.java:39) ~[CrazyCrates-1.21-74.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor685.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:1.21-2256-de2e7a7]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at org.bukkit.event.Event.callEvent(Event.java:45) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.api.builders.CrateBuilder.isCrateEventValid(CrateBuilder.java:341) ~[CrazyCrates-1.21-74.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.tasks.crates.types.CsgoCrate.open(CsgoCrate.java:36) ~[CrazyCrates-1.21-74.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.tasks.crates.CrateManager.openCrate(CrateManager.java:654) ~[CrazyCrates-1.21-74.jar:?]
at CrazyCrates-1.21-74.jar/com.badbones69.crazycrates.listeners.CrateControlListener.onRightClick(CrateControlListener.java:217) ~[CrazyCrates-1.21-74.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor673.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:1.21-2256-de2e7a7]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:594) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:538) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1949) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:44) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:11) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:36) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1576) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1553) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1546) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1505) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1512) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1357) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:332) ~[purpur-1.21.jar:1.21-2256-de2e7a7]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
[12:03:28 WARN]: [CrazyCrates] Cliversonxdd could not open CrateExample due to no valid prizes being found which led to the event being cancelled.
Agreements
- I have searched for and ensured there isn't already an open issue regarding this.
- I ticked all the boxes without actually reading them
- My version of Minecraft is supported by CrazyCrew.
Not a bug, We don't support doubles as we check for integers internally
0.5 is not an integer. 1 is an integer.
Then how can I set 0.5%?