-lightlevel{} condition still broken on builds post dev-build 3549
Closed
-lightlevel{} condition still broken on builds post dev-build 3549
Summary
- As in title. Post dev-build 3549 where a fix was attempted for the light-level condition, the condition still doesn't work as intended.
Steps to reproduce
-
Download the most recent dev build (3557 at time of writing).
-
Copy the mob and skills in the respective folders.
-
Spawn the mob.
-
Try various ways of introducing light.
-
Skills: https://pastebin.com/G8PCbPW6
Current behavior
-
The mob condition doesn't correctly identify when the mob is in the dark/light.
-
The level argument for the condition straight up doesn't work (E.g. "- lightlevel{l=0} true", "- lightlevel{l=15} false", Etc.)
-
Example 1: https://gyazo.com/6b849ca42989e0bcca771754a258634f
-
Example 2: https://gyazo.com/e71fa44d8509932cdc70dee2013683c6
Intended correct behavior
- With the files provided above, the mob should message the player saying "LIGHT" when in any level of light, or "DARK" when light is absent.
- The "l=xx" argument should work.
Server log file
Debug log snippet
Proposed fixes
- Not too sure.
added Invalid / Not a Bug label
As you can see in the images below, I've changed my mob to be the same as what you've done. I'm on the latest dev build available (3557) and the latest build of Paper.
- MM and Paper Version: https://gyazo.com/e5513d45b33757c47aa1eeef44449a0c
- Mob: https://gyazo.com/e01e50a5ba4e806d8d866823dfb17787
It still doesn't work, infact, it works less as the "l=0" breaks the check for darkness.
Please consider re-opening the ticket.
Edited by Woodyo_added Needs Documentation label and removed Invalid / Not a Bug label
added Verified Issue label
Have done some additional testing to see just what is causing this bug given the massive inconsistency on whether people get the bug or not.
I have tested on:
-
1.16.5, Paper-467, No plugins other than MM, Java 8, hosted on Linux : Mechanic didn't work.
-
1.16.5, Paper-467, No plugins other than MM, Java 8, hosted on Windows : Mechanic didn't work.
-
1.16.5, Paper-467, No plugins other than MM, Java 11, hosted on Linux : Mechanic didn't work.
-
1.16.5, Paper-467, No plugins other than MM, Java 11, hosted on Windows : Mechanic didn't work.
-
1.16.4, Paper-416, No plugins other than MM, Java 11, hosted on Linux : Mechanic didn't work (this prompted the ticket.)
-
Ran all tests using MM dev build 3557, as done previously.
I have no idea why it works for some and not for others, but there is obviously an issue here as both Eutherin and Akim managed to replicate the bug.
For those with whom it works, could you please post full environment details here like above please?
-
I updated MM and was wondering why random spawns weren't working anymore, debugged it down to the lightlevel condition and here we are, there is a super-easy way to reproduce this and before the said dev build it used to work. Install MythicMobs and let it gen its default files then go into the ExampleRandomSpawns.yml and change the example to use this condition only
- lightlevel{level=0to7} true
and chance: 1
turn the time to night.You'll see it never spawns outside nor inside caves even where the skylight level is 0, removing the condition lets them spawn perfectly. Enabling debug you can see it is getting the light level but when checking the condition it always returns false
**Checking LightLevel: 3 vs RangedDouble{0.0 to 7.0}Checking LightLevel: 0 vs RangedDouble{0.0 to 7.0}**
These should return true and they do in the previous dev builds and let the mob spawn yet they aren't.Edited by HexedHeroThe problem is that
RangedDouble#equals
does
if (!(o instanceof Integer) && !(o instanceof Double) && !(o instanceof Float)) { return false;
Yet AbstractWorld#getLightLevel returns Byte which isn't checked above so it will always fail no matter what. The old condition used to return an int so it worked. Could be wrong if my decompiler isn't showing the correct code or not showing any casting going on.
Edited by HexedHero