Solved Biome Changing Noobishness

Discussion in 'Plugin Development' started by Qwertyness_, Apr 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Qwertyness_

    I'm trying to make it so when a player interacts with a block, it will switch that column of blocks to a biome they specified.

    I am using a PlayerInteractEvent and have made sure that the event is executing on cue.
    I have also made sure the biome variable being used is correct.

    I am using the following code to set the biome:
    Code:java
    1. Block block = event.getClickedBlock();
    2. block.getWorld().setBiome(block.getLocation().getBlockX(), block.getLocation().getBlockZ(), biome);

    Where Biome biome is a pre-specified, not null, variable.
    However, when this code is executed, it doesn't actually change the in-game biome (F3 menu)

    Any insight on this?
     
  2. Offline

    codermason

    im pretty sure World#setBiome is made to be used inside of ChunkGenerators
     
  3. Offline

    Qwertyness_

    codermason
    So how would I change the biome after chunk generation?
    Sorry, not very familiar with this ;)

    Bump.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  4. Offline

    amhokies

    As far as I know, you can't without completely regenerating the chunk.
     
  5. Offline

    RawCode

    you must rejoin to see changes....
     
  6. Offline

    tryy3

    block.getWorld().refreshChunk(int x, int z) I belive? :)
     
  7. Offline

    lecraeman


    You ever been on ravand(Not gonna give the IP because I don't want to get in trouble, but search you should find it)? They have a plugin that changes the biome of a single column and does not require a refresh(Or at least doesn't seem to).
     
  8. Offline

    Qwertyness_

    The refresh method used directly after the biome set method as such:
    Code:java
    1. Block block = event.getClickedBlock();
    2. block.getWorld().setBiome(block.getLocation().getBlockX(), block.getLocation().getBlockZ(), biome);
    3. block.getWorld().refreshChunk(block.getChunk().getX(), block.getChunk().getZ());


    Works PERFECTLY. Thank you very much tryy3 !
     
Thread Status:
Not open for further replies.

Share This Page