Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5823

The methods for setting and getting biomes are malfunctioning. (1.15.2 & 1.16.1)

XMLWordPrintable

    • CraftBukkit version git-Spigot-758abbe-3f0c333 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT) & CraftBukkit version git-Spigot-a99063f-be6aaf0 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
    • None, its an issue with the API.
    • Yes

      The Bugs mentioned below aren't really caused by spigot, if they could even be considered bugs. Please read my comment for a more detailed explanation, and a couple of suggestions that could make the api just a little bit nicer 

       

      Problems:

      1: Getting the biome of a coordinate/block sometimes return the wrong biome of naturally generated areas. This behaviour is present for:

      • world.getBiome(x,y,z)
      • world.getBlockAt(x,y,z).getBiome()
      • world.getBiome(x,y) ** **

      2: Setting the biome of a coordinate/block does not change the biome for that block, or (some other times) changes a multiple blocks in the area arround the target block. This behaviour is present for:

      • world.setBiome(x,z,biome)
      • world.setBiome(x,y,z,biome)
      • world.getBlockAt(x, y, z).setBiome(biome)

      3.A: Setting the biome of a coordinate/block via doesn't change the biome. This is true for the following methods and verifiable by going there in game after rejoining the server

      • world.setBiome(x,z,biome)
      • world.setBiome(x,y,z,biome)
      • world.getBlockAt(x, y, z).setBiome(biome)

       -- 

      3.*B: *Printing the the biome after changing it for a coordinate/block  via

      • world.setBiome(x,z,biome)
      • world.setBiome(x,y,z,biome)
      • This doesnt happen with world.getBlockAt(x, y, z).setBiome(biome)

      returns different values depending of the methods used:

      • world.getBiome(x,y,z) --> returns the f3 biome
      • world.getBlockAt(x,y,z).getBiome() --> returns the biome which was set
      • world.getBiome(x,y) --> returns the biome which was set

       -- 

      Steps to reproduce the problem:

      • Compile spigot with build tools  :
        • java -jar BuildTools.jar --rev 1.15.2 or
        • java -jar BuildTools.jar --rev 1.16.1
      • Create a folder for the server, on the server folder:
        • Place the server jar
        • Create a bat file to run it, for example one containing:
          • java -Xmx5G -jar spigot-1.16.1.jar
            PAUSE
        • Create plugins folder, and drop the plugin i've attached
        • Create the file server.properties, add the entry:
          • level-seed=8512089215829046533
      • Run the bat file, accept the eula, run the bat again
      • On enable, the plugin will do the following:
        • output the results of all the get Methods for a series of blocks, but some of it is wrong.
          • For example: The output for block x-401, 388 is RIVER, but if you go in game, and use f3 while standing at those coordinates, you'll see the biome is SAVANNA
            • To easily get there use: /teleport -401.0 70 388.0 (note that the .0 are important)
        • It will change biomes at 1000, 1000, 2000, 2000, 3000, 3000, using different methods and will output the results, as you can see they are inconsistent, and if you go to the locations and use f3 you'll see that they haven't really changed.
          • For example, it changes the biome at 1000, 1000 , but if you go there (//teleport 1000.0 100 1000.0) you'll note that its still wooded mountains, but if you move arround a bit, you'll find that at 1002 80 1002 the biome has actually been changed to river. This is a clear malfunction of the setBlock.

       -- 

      Other info:
      I believe this post might contain valuable information:

      -https://hub.spigotmc.org/jira/browse/SPIGOT-5556-

       -- 

      Both behaviors are present at 1.15.2 and 1.16.1, however the jar I attached to display the behavior is for 1.16.1

       

            Unassigned Unassigned
            OnyxianSoul OnyxianSoul
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: