Yet-Another-World-Protector icon indicating copy to clipboard operation
Yet-Another-World-Protector copied to clipboard

feat: Local Region border visualization

Open Z0rdak opened this issue 3 years ago • 5 comments

Description

To easier visualize regions, it would be a huge quality of life feature to render the outlines of regions. Block Display Entities are a solid solution to realize this.

Local Region borders will bee visualized using BlockDisplay Entities (images below).

Considerations

  • The display entities should be visible in darkness (light level set to 15 and glowing enabled by default)
  • Changing the region area should update the visualization (using the UpdateArea event)
  • option to show visualization only to certain players (by permission/per player/all)
  • option to display the full hull or only a minimal frame
  • ...

Todos

  • [ ] #129 (should be done first)
  • [ ] Extend area interface to provide the following methods to be implemented by area types
    • [ ] Method to get area hull
    • [ ] Method to get area frame
    • [ ] Method to get marked blocks
    • [ ] Method to get center
    • [ ] Method to get teleport positions

Planned commands

  • [ ] /yawp local <dim> <local> show frame [hierarchy] - shows a somewhat minimal frame of the region and optionally its child regions
  • [ ] /yawp local <dim> <local> show hull [hierarchy] - shows the full hull of the region and optionally its child regions (careful with big regions)
  • [ ] /yawp local <dim> <local> hide [hierarchy] - hides the visualization (basically kills the BlockDisplay entities)
  • [ ] /yawp local <dim> <local> display - shows display setting page
  • [ ] /yawp local <dim> <local> display block <block> - sets the block used for the visualization
  • [ ] /yawp local <dim> <local> display glow <true|false> - enables/disables the glowing effect
  • [ ] /yawp local <dim> <local> display reset - resets the display settings to default

Shorthands (only for players)

  • [ ] /yawp show hull <region> - shorthand for yawp local <dim> <local> show hull using the dimension of the player
  • [ ] /yawp show frame <region> - shorthand for yawp local <dim> <local> show frame using the dimension of the player
  • [ ] /yawp hide <region> - shorthand for yawp local <dim> <local> hide using the dimension of the player
  • [ ] /yawp show-near <list | hull | frame> [<at>] - show or lists all regions around the player (considering the player permissions)
  • [ ] `/yawp hide-near []
  • [ ] `/yawp hide-all []- hides all regions in the current dimension

Parameters

  • block being a ResourceLocation with a default value of cyan_stained_glass
  • glow being a boolean with a default value of true
  • at being a blockpos or entity (executing player by default)

Interactive CLI

  • [ ] Display settings link in region info
  • [ ] Display settings page

Example:

=== Display settings for [<region-name>] ===
Block: minecraft:cyan_stained_glass | [set] [<-] 
Glow: enabled | [on] [off]
Display: [Hull] [Frame] [Hide] 

Management of summoned block entities

  • Add feature to display regions around the player
  • Add feature to list regions around the player
  • Add feature to list regions around a given position

Related Issues

  • #47
  • #6

Images

Image

Image

Z0rdak avatar Aug 13 '22 07:08 Z0rdak

Considering WE integration for Region Visualization, see https://github.com/Z0rdak/Yet-Another-World-Protector/pull/82

Z0rdak avatar Jun 11 '23 12:06 Z0rdak

I proposed this mainly to reuse the WE visualization in worldeditcui, though the sui in WE also worked. It also allowed all the WE manipulators to work.

Some other options I can think of are holograms or particles.

petersv5 avatar Jun 11 '23 12:06 petersv5

I would prefer not introducing yet another client side mod unless absolutely needed. WE-cui is almost mandatory for operating a server, so that is already accepted but I would prefer not adding more client side, at least not for just visualization.

For doing server side only display we could look into using the virtual blocks or virtual entities via Polymer. I am konsidering making a mock up with a couple of options:

  • some kind of grid of blocks as the surface of the active region
  • text showing the name of the region written repeatedly on the surface of the region. Potentially showing all regions as well

petersv5 avatar Jul 04 '23 05:07 petersv5

Agreed. I would love to solve this server-sided.

Polymer looks great, but I'd really like to find a solution for both Fabric and Forge.

I am tending more and more towards considering adding this feature only for 1.19.4 and onwards, and use the vanilla server-sided display entities/blocks for this.

Z0rdak avatar Jul 04 '23 06:07 Z0rdak