PolyGuard
Advanced polygonal region protection. Define complex borders beyond simple cubes to protect custom builds.
Overview
PolyGuard solves the age-old problem of protecting circular or irregularly shaped builds. Instead of using a giant, invisible cubic box that accidentally protects terrain you don't want protected, PolyGuard allows you to draw multi-point polygonal borders for pinpoint accuracy.
By utilizing highly optimized 2D ray-casting mathematics, PolyGuard can calculate if a player is within a complex 100-point polygon in fractions of a millisecond, ensuring zero TPS lag even on heavily populated servers with thousands of regions. It is designed to be the ultimate solution for server owners who need precision claiming.
Key Features
- Multi-Point Selection: Select up to 100 different points to trace the exact outline of your castle walls, rivers, or diagonal roads.
- Visual Borders: Players walking near the border will see a temporary particle wall, visualizing exactly where the protection begins. No more guessing where the claim ends!
- Sub-Regions (Parenting): Create smaller polygonal regions inside larger ones, assigning different flags (e.g., PvP allowed in the courtyard, but disabled in the throne room).
- High Performance: Uses advanced ray-casting mathematics to determine if a player is inside the polygon with zero TPS lag.
- Comprehensive Flag System: Control mob spawning, TNT explosions, chest access, use of specific items, and much more.
Commands
Below is a list of all PolyGuard commands.
| Command | Description |
|---|---|
| /polyguard | Main PolyGuard command (Aliases: /pg, /rg) |
Advanced Integration & Developer API
Welcome to the advanced guide for PolyGuard. This section is designed for power-users, developers, and server network administrators who want to push the plugin to its absolute limits.
1. Deep Dive into the Codebase
PolyGuard is built using a highly optimized, asynchronous event-driven architecture. Unlike legacy plugins that block the main server thread during database lookups or complex calculations, this plugin utilizes Java's CompletableFuture API to handle all heavy lifting on separate worker threads.
For example, when a player triggers an action, the initial validation happens instantly on the main thread. If successful, the heavy data processing (like NBT serialization, database queries, or cross-server synchronization) is offloaded.
2. Cross-Server Synchronization (Redis & MySQL)
If you run a BungeeCord or Velocity network, you can synchronize PolyGuard across all your backend servers!
To enable this, simply navigate to your config.yml and configure the following:
# ---------------------------------------------------- #
# ADVANCED SYNCHRONIZATION #
# ---------------------------------------------------- #
sync:
enabled: true
provider: "REDIS"
redis:
host: "127.0.0.1"
port: 6379
password: "your_secure_password"
channel: "polyguard_sync"
database:
type: "MYSQL"
host: "localhost"
port: 3306
username: "admin"
password: "password123"
database_name: "network_db"Once enabled, any changes made on Server A will instantly reflect on Server B via Redis Pub/Sub messaging!
3. Developer API (Java)
Are you writing your own custom plugins and want to hook into PolyGuard? You can easily add us as a dependency in your pom.xml or build.gradle.
Maven Dependency
<repository>
<id>vexorcore-repo</id>
<url>https://repo.vexorcore.com/releases</url>
</repository>
<dependency>
<groupId>com.vexorcore</groupId>
<artifactId>PolyGuardAPI</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>Example API Usage
Here is a quick example of how to listen to our custom events:
import com.vexorcore.polyguard.api.events.PolyGuardTriggerEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class MyCustomAddon implements Listener {
@EventHandler
public void onTrigger(PolyGuardTriggerEvent event) {
if (event.getPlayer().hasPermission("my.custom.bypass")) {
event.setCancelled(true);
event.getPlayer().sendMessage("You bypassed the action!");
}
}
}4. Extensive FAQ
- Q: Does this plugin cause lag?
A: Absolutely not! We rigorously test PolyGuard on 200+ player production servers using Spark profiling. Everything heavy is processed async. - Q: Can I change the chat messages?
A: Yes. Every single message is fully configurable in themessages.ymlfile. We support full MiniMessage formatting! - Q: Is this compatible with Geyser/Bedrock players?
A: Yes, we natively support Floodgate APIs to ensure Bedrock players experience the exact same mechanics as Java players, including custom GUI mappings.



