Get Cuboid between Certain Blocks

Discussion in 'Plugin Development' started by ccrama, Jan 3, 2014.

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

    ccrama

    Hello Bukkit,
    I want to make my plugin as easy as possible for me to config, and I had the idea of outlining the spawns in my game with that team's color, and when you type a command like /registerworld current, it will register the two spawns by finding the wool blocks of the spawn.
    Is it possible to find a block with a certain color, save that to a config somewhere, and use that as a cuboid area? I can develop the methods to check the cuboid pretty easily, but don't know how I would go about checking for the wool color.
    The reason i'm doing the wool instead of just two points is some of my spawns aren't regularly shaped, and some of the spawns may be made of many different cuboids put together.

    Any suggestions/help are welcome.

    Thanks,
    ccrama
     
  2. Offline

    Davesan

    All the way you want to do this finding stuff? I do plugins, and when I must set a spawn or a location I always ask the player to click on it - and by this way I use playerInteract event. So if I write a plugin like this it will be like this as for its structure:
    Code:
    player: /registerworld current
    plugin sends to player: "Please select the first spawn."
    plugin: registers that the player wanna register the world spawn
    player: <clicks on the wool block>
    plugin sends to player: "Spawn 1 selected. Please select the second spawn."
    player: <click on the other wool>
    plugin sends to player: "Spawns successfully selected."
    But, if you want to find the wools by the plugin, you must select the cuboid. When you have it, you roll over its blocks. If the material of the block is [Material.WOOL] then you check the color. How to check the color? Usually when we have a problem another guy already had it before us. Just select the keyword of our problem: "bukkit get wool color" and search on it. I found and article about it for you: check it. I hope helped you :)
     
  3. Offline

    tommycake50

  4. Offline

    ccrama

    Davesan, I think I will go with your method of clicking the corners of it which would be much easier to do.

    tommycake50, Yeah I noticed it's deprecated, hopefully it will be easier in the future!
     
Thread Status:
Not open for further replies.

Share This Page