Sponge
Sponge copied to clipboard
BlockVolume's highestYAt throws an error if the height is negative value.
Affected Product(s)
SpongeForge, SpongeVanilla
Version
1.19.4-10.0.0-RC1407
Operating System
Windows 10
Java Version
Java 17
Plugins/Mods
A plugin that is tries to get highest block of given coordinates
Describe the bug
When using BlockVolume's highestYAt in a world with heights lower than 0, the following error occurs
java.lang.IllegalArgumentException: The value -16 is not in the specified inclusive range of 0 to 255
at org.apache.commons.lang3.Validate.inclusiveBetween(Validate.java:1032) ~[?:?]
at net.minecraft.util.SimpleBitStorage.get(SimpleBitStorage.java:184) ~[?:?]
at net.minecraft.world.level.levelgen.Heightmap.getFirstAvailable(Heightmap.java:166) ~[?:?]
at net.minecraft.world.level.levelgen.Heightmap.getHighestTaken(Heightmap.java:162) ~[?:?]
at net.minecraft.world.level.chunk.LevelChunk.highestYAt(LevelChunk.java:1548) ~[?:?]
Link to logs
No response
Hello, I tested with SpongeVanilla and I didn't have the error.
Here is my test code:
@Listener
private void onLogin(final ServerSideConnectionEvent.Join event) {
Task build = Task.builder().plugin(this.container).delay(Ticks.of(20))
.execute(() -> event.player().sendMessage(Component.text(event.player().world().highestYAt(-100, -100)))
).build();
Sponge.game().asyncScheduler().submit(build);
}
and the result:
Try to update to the latest version of Sponge Vanilla, or give the plugin which throw the error please.