Skip to content

ExprGameRule issues #7939

Open
Open
@ShaneBeee

Description

@ShaneBeee

Skript/Server Version

> sk info
[14:20:01 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[14:20:01 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[14:20:01 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[14:20:01 INFO]: [Skript] Server Version: 1.21.6-pre4-DEV-569c323 (MC: 1.21.6 Pre-Release 4)
[14:20:01 INFO]: [Skript] Skript Version: 2.11.2 (skriptlang-github)
[14:20:01 INFO]: [Skript] Installed Skript Addons: 
[14:20:01 INFO]: [Skript]  - SkNMS v1.2.1-1.21.6 (https://github.com/ShaneBeee/SkNMS)
[14:20:01 INFO]: [Skript]  - SkBee v3.11.3 (https://github.com/ShaneBeee/SkBee)
[14:20:01 INFO]: [Skript]  - skript-reflect v2.6 (https://github.com/SkriptLang/skript-reflect)
[14:20:01 INFO]: [Skript] Installed dependencies: None

Bug Description

The GameRule Value expression has a few issues:

  1. isSingle returns false = It should return whether the input worlds are single, since getting the game rule of a single world should return single.

  2. The change effect blindly sets the value to whatever you pass thru.
    Example:
    If I set the spawnChunkRadius game rule to 1.5, I get a warning in console Failed to parse integer integer
    if I set that same game rule to true, I get a warning in console Failed to parse integer true
    These should be checked before attempting to set the game rule.
    Also, if passing in a number, Number#intValue should be used.

Expected Behavior

  1. isSingle should return properly based on world[s] input

  2. When setting a game rule, the value used should be properly handled.

Steps to Reproduce

  1. Code: set {_var} to gamerule doWeatherCycle of world of player
    error:
[14:26:52 ERROR]: Error in: set {_var} to gamerule doWeatherCycle of world of player
[14:26:52 INFO]:     {_var} can only be set to one object, not more
  1. Code: set gamerule spawnChunkRadius of world "world" to 1.5
    Error/Warning:
    [14:28:03 WARN]: Failed to parse integer 1.5

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

Labels

PR availableIssues which have a yet-to-be merged PR resolving itbugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.priority: mediumIssues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions