Solved Biome and config problem

Discussion in 'Plugin Development' started by bryansolis13, Jun 18, 2016.

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

    bryansolis13

    Okay so i'm trying to compare the biome the player is in with the biome in the config:

    Event to get players location and compare it to whats in the config
    Code:
    removed
    Command to put the players biome in config
    Code:
    removed
    Config
    Code:
    Players:
      PlayersUuid:
        Biome: !!org.bukkit.block.Biome 'PLAINS'
    The config for some reason its putting !!org.bukkit.block.Biome 'PLAINS' instead of just plains and even when i change the config to just plains by itself, it still doesn't compare, says its doesn't match
     
    Last edited: Jun 18, 2016
  2. Offline

    I Al Istannen

    @bryansolis13
    This is because Biome is an enum. Write biome.name() and restore it with Biome.valueOf(<read name>).
     
  3. Offline

    bryansolis13

    @I Al Istannen
    Correct me if i'm wrong but your saying for example to do: Biome.PLAINS() and all that. If so, i already have done that but it adds a lot more lines to the code. I got a working version of that but i would need to do that to every biome in minecraft.

    Original Code:
    Code:
    removed
        }
    The thing with that is i have to do that for every single biome
     
    Last edited: Jun 18, 2016
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    bryansolis13

    Code:
    Removed
     
    Last edited: Jun 18, 2016
  6. Offline

    I Al Istannen

    @bryansolis13
    Apart from the fact that that will allow them to build in EVERY biome of the type, you just need to replace all config#set(path, biome) with config#set(path, biome.name()).
    Then, when you check it, you do
    "p.getLocation().getBlock().getBiome().name().equals" (e.g. line 46, first class).
     
  7. Offline

    bryansolis13

  8. Offline

    I Al Istannen

Thread Status:
Not open for further replies.

Share This Page