Bug Verified

-lightlevel{} condition still broken on builds post dev-build 3549

#1686 opened by Unknown 5 years ago

Unknownreported this bug

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

Current behavior

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.
Unknowncommented

[Legacy attachment omitted][Legacy attachment omitted]

the light level condition is working fine for me here is my mm version and paper versions and image showing "zombie:LIGHT" as I set condition - lightlevel{l=15} true you probably need to update to latest dev build

Unknowncommented

I too have the same bug using the skill and mob provided - Could it please be reopened?

Sachin seems to be 16 version behind on paper so it could be a weird usecase for his.

Unknowncommented

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?

Unknowncommented

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.

Unknowncommented

The 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.

Sign in to join the discussion.