Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative numbers in ExprLevel causes console error #4804

Closed
TheLimeGlass opened this issue Jun 14, 2022 · 0 comments
Closed

Negative numbers in ExprLevel causes console error #4804

TheLimeGlass opened this issue Jun 14, 2022 · 0 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@TheLimeGlass
Copy link
Contributor

TheLimeGlass commented Jun 14, 2022

Skript/Server Version

2.6.2-mc-1.19 (custom version)

Nothing that would change this error.

Bug Description

Experience level must not be negative (-1)

This is causing runtime execution of the rest of the code to stop, so this is low priority rather than lowest.
I'm surprised this didn't show up before. Spigot must have added a Precondition check to it sometime recently.

Expected Behavior

There should not be a console error, rather just not attempt to set the level of the player to a negative number.

Steps to Reproduce

Set the level of a player to any negative number.

Errors or Screenshots

[17:04:54 ERROR]: #!#! Stack trace:
[17:04:54 ERROR]: #!#! java.lang.IllegalArgumentException: Experience level must not be negative (-1)
[17:04:54 ERROR]: #!#!     at com.google.common.base.Preconditions.checkArgument(Preconditions.java:193)
[17:04:54 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.setLevel(CraftPlayer.java:1524)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.expressions.ExprLevel.change(ExprLevel.java:127)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.effects.EffChange.execute(EffChange.java:282)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[17:04:54 ERROR]: #!#!     at Skript.jar//ch.njol.skript.effects.Delay$1.run(Delay.java:109)
[17:04:54 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101)
[17:04:54 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[17:04:54 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1490)
[17:04:54 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:446)
[17:04:54 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1414)
[17:04:54 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1187)
[17:04:54 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302)
[17:04:54 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:833)
[17:04:54 ERROR]: #!#!
[17:04:54 ERROR]: #!#! Version Information:
[17:04:54 ERROR]: #!#!   Skript: 2.6.2-mc-1.19 (custom version)
[17:04:54 ERROR]: #!#!     Flavor: selfbuilt-unknown
[17:04:54 ERROR]: #!#!     Date: unknown
[17:04:54 ERROR]: #!#!   Bukkit: 1.19-R0.1-SNAPSHOT
[17:04:54 ERROR]: #!#!   Minecraft: 1.19
[17:04:54 ERROR]: #!#!   Java: 17.0.3.1 (Java HotSpot(TM) 64-Bit Server VM 17.0.3.1+2-LTS-6)
[17:04:54 ERROR]: #!#!   OS: Windows 10 amd64 10.0
@TheLimeGlass TheLimeGlass added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Jun 14, 2022
@TheLimeGlass TheLimeGlass self-assigned this Jun 14, 2022
@TheLimeGlass TheLimeGlass added the PR available Issues which have a yet-to-be merged PR resolving it label Jun 14, 2022
@TheLimeGlass TheLimeGlass added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jun 30, 2022
@TheLimeGlass TheLimeGlass removed their assignment Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

2 participants