repositories {
maven("https://jitpack.io")
}
dependencies {
compileOnly("com.github.mukulx:RtpZoneX:1.0.0")
}repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.mukulx:RtpZoneX:1.0.0'
}<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.mukulx</groupId>
<artifactId>RtpZoneX</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>import github.mukulx.rtpzonex.RtpZoneX;
RtpZoneX plugin = RtpZoneX.getInstance();import github.mukulx.rtpzonex.zone.RtpZone;
RtpZone zone = plugin.getZoneManager().getZone("zoneName");import org.bukkit.Location;
Location location = player.getLocation();
RtpZone zone = plugin.getZoneManager().getZoneAt(location);import java.util.Collection;
Collection<RtpZone> zones = plugin.getZoneManager().getAllZones();import org.bukkit.Location;
Location pos1 = new Location(world, x1, y1, z1);
Location pos2 = new Location(world, x2, y2, z2);
boolean success = plugin.getZoneManager().createZone("myZone", pos1, pos2);boolean success = plugin.getZoneManager().deleteZone("zoneName");import java.util.UUID;
UUID playerId = player.getUniqueId();
boolean inZone = zone.hasPlayer(playerId);import java.util.Set;
import java.util.UUID;
Set<UUID> players = zone.getPlayersInZone();boolean teleporting = zone.isTeleportInProgress();
boolean waiting = zone.isWaitingForPlayers();
int waitTime = zone.getWaitTimeRemaining();import github.mukulx.rtpzonex.zone.ZoneConfig;
ZoneConfig config = zone.getConfig();config.setTargetWorld("world_nether");
config.setMinDistance(1000);
config.setMaxDistance(10000);
config.setTeleportCountdown(10);
config.setCooldown(120);
// Save changes
plugin.getZoneManager().saveZones();plugin.getTeleportManager().startGroupTeleport(zone);boolean isTeleporting = plugin.getTeleportManager().isPlayerTeleporting(player.getUniqueId());String zoneName = plugin.getTeleportManager().getPlayerTeleportZone(player.getUniqueId());boolean onCooldown = plugin.getCooldownManager().isOnCooldown(player.getUniqueId());int remaining = plugin.getCooldownManager().getRemainingCooldown(player.getUniqueId());plugin.getCooldownManager().setCooldown(player.getUniqueId());plugin.getCooldownManager().removeCooldown(player.getUniqueId());import github.mukulx.rtpzonex.teleport.SafeLocationFinder;
import org.bukkit.World;
import java.util.concurrent.CompletableFuture;
SafeLocationFinder finder = plugin.getTeleportManager().getLocationFinder();
World world = Bukkit.getWorld("world");
ZoneConfig config = zone.getConfig();
CompletableFuture<Location> future = finder.findSafeLocation(world, config);
future.thenAccept(location -> {
if (location != null) {
// Safe location found
player.teleport(location);
} else {
// No safe location found
player.sendMessage("No safe location found!");
}
});boolean safe = finder.isSafeLocation(location, config);plugin.getHologramManager().createHologram(zone);plugin.getHologramManager().updateHologram(zone);plugin.getHologramManager().removeHologram(zone.getName());String prefix = plugin.getConfigManager().getPrefix();
String message = plugin.getConfigManager().getMessage("zone-entered");
int countdown = plugin.getConfigManager().getTeleportCountdown();
int cooldown = plugin.getConfigManager().getCooldown();plugin.reload();RtpZoneX doesn't provide custom events, but you can listen to standard Bukkit events:
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
RtpZone zone = plugin.getZoneManager().getZoneAt(event.getTo());
if (zone != null) {
// Player is in a zone
}
}RtpZoneX is designed to be thread-safe and Folia-compatible:
- Task scheduling uses
SchedulerUtilfor region handling - Entity operations run on the correct region thread
- Chunk loading is asynchronous
- Collections are synchronized where needed
When using the API:
- Use
SchedulerUtilfor scheduled tasks - Execute entity/location operations on the correct thread
- Use async operations for heavy computations
- Always check for null when getting zones or locations
- Use CompletableFuture for async operations
- Save zones after modifying configurations
- Handle exceptions when working with locations
- Test on both Paper and Folia if your plugin supports both
For API support:
- Open an issue on GitHub
- Check existing documentation
- Review the source code