Getting the Frame of a Portal

Discussion in 'Plugin Development' started by chaseoes, Dec 27, 2012.

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

    chaseoes

    Can anyone point me in the right direction of getting the 14 blocks surrounding a portal (possibly in some form of a list) from knowing the location of only one portal block?

    [​IMG]

    I've tried some things with BlockFaces and BlockIterators but nothing seemed to do what I need.

    Hmm, anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  2. Offline

    RealDope

    Options as I see it:

    1. Loop through all nearby blocks checking for obsidian. Check to make sure they match portal shape and it's not just random nearby obsidian.
    2. Store the blocks using the PortalCreateEvent or the EntityPortalCreateEvent
     
  3. Offline

    chaseoes

    Ideas on how to check if they match the shape of the portal? That's the part I'm really stuck on. :p
     
  4. Offline

    RealDope

    Some sort of process of elimination or something? Start with a list of all the nearby obsidian blocks, then for each one, check if they have an obsidian adjacent to them, if not, remove. Then for all remaining ones, check which face of them faces the actual nether portal blocks. If it's a side face, check that they have a block either above or below them, if not remove. If it's a top or bottom face, check that they have a block to the left or right of them, if not remove. Etc... I think it will be pretty difficult. I can't imagine that there isn't someone out there who has a solution for this..
    chaseoes
    P.S. Aren't you that guy that made TF2? :p

    I really don't think my idea will work at all lol but I'm just throwing random garbage out now XD
     
Thread Status:
Not open for further replies.

Share This Page