-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
Environment:
-
This server is running CraftBukkit version 3323-Spigot-7514aa3-c86a3f7 (MC: 1.18 Release Candidate 3) (Implementing API version 1.18-rc3-R0.1-SNAPSHOT)
-
Yes
When using ChunkSnapshot#getBiome for y>=16, it spits out an exception as follows:
>cstest [21:18:07] [Server thread/INFO]: [#getBlock#getBiome] Biome at (0, 15, 0): LUSH_CAVES [21:18:07] [Server thread/INFO]: [#getBlock#getBiome] Biome at (0, 16, 0): OLD_GROWTH_PINE_TAIGA [21:18:07] [Server thread/INFO]: [Snapshot#getBiome] Biome at (0, 15, 0): LUSH_CAVES [21:18:07] [Server thread/WARN]: Unexpected exception while parsing console command "cstest" org.bukkit.command.CommandException: Unhandled exception executing command 'cstest' in plugin ChunkSnapshotTest v0.0.1-SNAPSHOT at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.18-rc3-R0.1-SNAPSHOT.jar:?] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.18-rc3-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:800) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchServerCommand(CraftServer.java:785) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:453) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:429) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1205) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1033) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at java.lang.Thread.run(Thread.java:833) [?:?] Caused by: java.lang.IllegalArgumentException: The value 64 is not in the specified inclusive range of 0 to 63 at org.apache.commons.lang3.Validate.inclusiveBetween(Validate.java:1019) ~[commons-lang3-3.12.0.jar:3.12.0] at net.minecraft.util.SimpleBitStorage.a(SourceFile:184) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.world.level.chunk.DataPaletteBlock.a(SourceFile:147) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at net.minecraft.world.level.chunk.DataPaletteBlock.a(SourceFile:141) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at org.bukkit.craftbukkit.v1_18_R1.CraftChunkSnapshot.getBiome(CraftChunkSnapshot.java:136) ~[spigot-1.18-rc3-R0.1-SNAPSHOT.jar:3323-Spigot-7514aa3-c86a3f7] at dev.ratas.cstest.ChunkSnapshotTest.onCommand(ChunkSnapshotTest.java:21) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.18-rc3-R0.1-SNAPSHOT.jar:?] ... 9 more
According to the javadocs on ChukSnapshot#getBiome, it should accept y up to 255.
Made a test plugin with the following code that produced the exception above:
package dev.ratas.cstest; import org.bukkit.Chunk; import org.bukkit.ChunkSnapshot; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; public class ChunkSnapshotTest extends JavaPlugin { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { World world = getServer().getWorld("world"); // default world Chunk chunk = world.getChunkAt(0, 0); ChunkSnapshot snapshot = chunk.getChunkSnapshot(false, true, false); sender.sendMessage("[#getBlock#getBiome] Biome at (0, 15, 0): " + chunk.getBlock(0, 15, 0).getBiome()); sender.sendMessage("[#getBlock#getBiome] Biome at (0, 16, 0): " + chunk.getBlock(0, 16, 0).getBiome()); sender.sendMessage("[Snapshot#getBiome] Biome at (0, 15, 0): " + snapshot.getBiome(0, 15, 0)); sender.sendMessage("[Snapshot#getBiome] Biome at (0, 16, 0): " + snapshot.getBiome(0, 16, 0)); // Exception on this line! return true; } }
The plugin is also available as an attachment.