Portals

Discussion in 'Plugin Development' started by RainoBoy97, Mar 17, 2013.

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

    RainoBoy97

    Hi..


    I want to make portals, and those with same material structure are linked.
    So if i made 2 portals out of sponge, those will be linked. No matter which world they are in..

    Any help/start out?

    ps: Yes, I know java and the bukkit API xD

    -Raino
     
  2. Offline

    TomTheDeveloper

    Portals are easy to make, just check the loction of the player with the playermove event (and check on which block they stand...)
    Linking is the difficult i think, but maybe you can do it so:

    Get the second portal, get the location of a block in that portal, and teleport them to that block.
    And if you want frequencies for your portals, use signs, and if the 2 line is equal to the second line on that other portal, then they are linked with each other
     
  3. Offline

    CoderCloud

    You would have to store the portals in your plugin, because looking for the portal in all worlds would take way to long. i would do that with a event to check if portals are created or destroyed and then put them (or remove) in an List.
     
  4. Offline

    RainoBoy97

    I know how I would store them, and the teleporting. I need to get WHEN they build a portal, and set the inside with still water :p
     
  5. Offline

    CoderCloud

    I would use the blockplace and blockdestroy event. then i would look if the block is part of a portal and when it is i would use the world setBlock method to fill the space in the portal.
     
  6. Offline

    RainoBoy97

    Yes, but how would I recognise the portal structure?
     
  7. Offline

    CoderCloud

    You have a structure like this:
    ####
    #++#
    #++#
    #++#
    ####

    Then you would check if the block is one of the # blocks and is it is you would destroy the portal.

    To create it i would use the block that creates the portal (maybe fire) and check if the portal around is compleed.
     
  8. Offline

    RainoBoy97

    It should "light" itself when its recognised as a portal, but the checking is the part i need help on..
     
  9. Offline

    RainoBoy97

    Bumpie cars.
    I really need this :p Cant figure it out, havent use block checking that much :)
     
  10. Offline

    ZeusAllMighty11

    Seems like a lot of iteration of blockfaces and relativity to me, I don't know any other ways :(
     
  11. Offline

    RainoBoy97

    I know, thats the part I need help with xD
     
Thread Status:
Not open for further replies.

Share This Page