How to display structure block bounding box

Discussion in 'Plugin Development' started by i3ick, Aug 1, 2016.

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

    i3ick

    Hey, is there a way to display a bounding box such as the one that appears when using the structure block?
    [​IMG]
     
  2. Offline

    Oxyorum

    @i3ick I don't believe so. As far as I know, you can only pull that off with a mod.
     
  3. I think it's not impossible. I'm trying 'tile entity data' packets with ProtocolLib at the moment.
    NBT Tags (open)

    Structure

    • Block entity data
      • name: Name of the structure.
      • author: Author of the structure; only set to "?" for normal structures.
      • metadata: Custom data for the structure; appears to be unused.
      • posX: X-position of the structure?
      • posY: Y-position of the structure?
      • posZ: Z-position of the structure?
      • sizeX: X-size of the structure, probably its length
      • sizeY: Y-size of the structure, probably its height
      • sizeZ: Z-size of the structure, probably its depth
      • rotation: Rotation of the structure, one of "NONE", "CLOCKWISE_90", "CLOCKWISE_180", or "COUNTERCLOCKWISE_90"
      • mirror: How the structure is mirrored, one of "NONE", "LEFT_RIGHT", or "FRONT_BACK"
      • mode: The current mode of this structure block, one of "SAVE", "LOAD", "CORNER", or "DATA"
      • ignoreEntities: 1 or 0 (true/false): Whether entities should be ignored in the structure
      • showboundingbox: 1 or 0 (true/false) Wheter the bounding box should be displayed
     
  4. Offline

    Oxyorum

    @FisheyLP Have you had any success? I'd love to see this work. :)
     
  5. I'm still trying but I must get familiar with ProtocolLib first ._.

    I already found the packet being sent by the server and try to make a custom one now.
     
  6. Offline

    Oxyorum

  7. Offline

    i3ick

    @FisheyLP If you figure it out please let me know. I'm working on a plugin that deals with different areas with custom properties so it would be nice to be able to visualize them in this way while modifying them :D
     
  8. Offline

    Oxyorum

    If you want that, I suggest having a look at GriefPrevention. It had abilities akin to what you are seeking, and its open source, so you can have a look at the code and see how it pulled off visualization.
     
  9. I don't know where you saw that it was making the bounding box @i3ick was asking for, but it looks like this:
    Image (open)
    [​IMG]


    I also found nothing about structure blocks or packets in the source code..
     
  10. Offline

    Oxyorum

    @FisheyLP I didn't mean it was exactly what he wanted, but it does highlight areas that are being worked on, like in your image. :)

    Have you been able to get a bounding box to work with ProtocolLib yet?
     
  11. Not yet, but I'm still trying.

    bad news is that the player can toggle the bounding box of the structure block without packets being sent from the server (it's client-side)
     
  12. Offline

    ArsenArsen

    Data has to somehow get to the player. Send him a fake packet saying the bounding box was placed, or place a structure block at Y256. Also can you link me the sources?
     
  13. Just decompile craftbukkit 1.10+ and look in the net.minecraft.server package for:
    • BlockStructure
    • TileEntityStructure (most important)
    • PacketPlayOutTileEntityData
    Other informations:
     
Thread Status:
Not open for further replies.

Share This Page