Plugin Help Whitelist isnt acting as a whitelist

Discussion in 'Plugin Help/Development/Requests' started by Scorpionvssub, Oct 21, 2015.

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

    Scorpionvssub

    Code:
            if ((p.getLocation().getBlock() != null) &&
                    (!this.plugin.blocks.containsValue(p.getLocation().getBlock().toString()))) {
                System.out.println("testing");
                if (this.plugin.checkpoint.containsKey(p)) {
                    ArenaManager.teleportToStart(this.plugin, p, p.getWorld().getName());
                }
            }
    The block map contain block types via config by CAPITAL name like GRASS STONE COBBLESTONE as im not sure how to covert using item id's in these checks specially cause i cant get this to work in the first place..

    What it has to do is, Blocks will store blocks like this in its hashmap:

    {world=[GRASS, STONE, COBBLESTONE]}

    These blocks can be altered in config but these are the "allowed" blocks that you are allowed to step on, any other will cause a teleport. However at the very moment the section tends to teleport you regardless of any block whatsoever meaning wether its stone grass cobblestone or really anything aslong as u move even the slightest bit wether its moving via keyboard with wsad or mouse movement it pulls you back to the teleport section, anyone have a better solution to make the intended whitelist become an accuall whitelist.?
     
    Last edited: Oct 22, 2015
  2. Offline

    pie_flavor

    @Scorpionvssub And have you any idea at all what Block#toString() returns?
     
Thread Status:
Not open for further replies.

Share This Page