P_Randomtp
Plugin de Random Teleport RTP otimizado Optimized Random Teleport RTP plugin
P_Randomtp
🌍 P_Randomtp
Plugin de Paper/Spigot 1.21+ otimizado para servidores Paper/Spigot 1.21+. Permite que jogadores se teleportem para locais aleatórios seguros em um mundo, evitando lag e falhas típicas de plugins de RTP.
✨ Recursos
- 🔄 Multi-idioma (pt_br, en_us) – evita líquidos, blocos perigosos e tetos do Nether. - 🧭 Multi-idioma (pt_br, en_us) – expande automaticamente a área de busca se não encontrar local válido. - ⚡ Multi-idioma (pt_br, en_us) – executa tentativas de forma distribuída, sem travar o servidor. - 📦 Multi-idioma (pt_br, en_us) – garante RTP rápido mesmo em distâncias grandes. - 🛡️ Multi-idioma (pt_br, en_us) (opcional) – respeita regiões protegidas. - 💰 Multi-idioma (pt_br, en_us) (opcional) – cobra valores customizados por mundo. - ⏳ Multi-idioma (pt_br, en_us) – configurações flexíveis para balancear o uso. - 🌐 Multi-idioma (pt_br, en_us) – mensagens personalizadas por idioma ou forçadas no `config.yml`.
---
📥 Instalação
1. Baixe o arquivo `.jar` compilado do plugin. 2. Coloque em `plugins/` no seu servidor WorldGuard. 3. Reinicie o servidor para gerar os arquivos de configuração. 4. Edite `config.yml` conforme necessário. 5. (Opcional) Instale WorldGuard para cobrar por RTP e WorldGuard para respeitar proteções.
---
⚙️ Configuração
O arquivo `config.yml` possui várias opções. Exemplo de configuração otimizada (trecho):
``` settings: cooldown-seconds: 60 warmup-seconds: 3 per-tick-attempts: 6 loaded-chunks-only: false allow-chunk-load: true async-chunk-loads-parallel: 8 max-attempts: 120 adaptive-radius: enabled: true step-percent: 25 max-multiplier: 3.0 ``` | Permissão | Descrição | Default | | ----------------------- | ---------------------------------------------- | --------------- | | `prandomtp.use` | Permite usar `/rtp` | ✅ todos | | `prandomtp.bypass` | Ignora cooldown | ❌ apenas OP | | `prandomtp.free` | Usa RTP sem custo (Vault) | ❌ apenas OP | | `prandomtp.world.*` | Permite selecionar qualquer mundo com `/rtp` | ❌ apenas OP | | `prandomtp.admin` | Acesso ao `/rtp reload` | ❌ apenas OP | | `prandomtp.tier.vip` | Tier customizado (cooldown menor, +raio) | ❌ apenas VIP | | `prandomtp.tier.legend` | Tier customizado (cooldown muito menor, +raio) | ❌ apenas Legend |
| Comando | Uso | Descrição | | -------------- | ------------------- | ------------------------------------------------ | | `/rtp` | `/rtp` | Teleporta para um local aleatório no mundo atual | | `/rtp <mundo>` | `/rtp world_nether` | Teleporta para outro mundo (se permitido) | | `/rtp reload` | `/rtp reload` | Recarrega a configuração e mensagens |
🧩 Integrações
- Vault – cobra valor configurado por mundo (economy.cost.per-world).
- WorldGuard – impede teleporte em áreas protegidas.
- bStats – envia métricas anônimas (opcional).
🔌 API Pública (para outros plugins)
- Interface disponível via ServicesManager:
- RtpService service = Bukkit.getServicesManager().load(RtpService.class);
- // Encontrar um local seguro Location safe = service.findSafeLocation(player, world);
- // Solicitar RTP completo (como se fosse /rtp) service.requestRtp(player, world);
- Eventos disponíveis (RtpEvents):
- WarmupStartEvent
- WarmupCancelEvent
- SuccessEvent
- FailEvent
🚀 Otimização
- Use allow-chunk-load: true e async-chunk-loads-parallel ajustado conforme o hardware.
- Ajuste per-tick-attempts (4–8 é ideal).
- Use adaptive-radius para reduzir falhas em seeds com muitos oceanos.
- Se for servidor com muito player simultâneo, limite RTPs concorrentes (semáforo global).
❓ FAQ
❓ - O RTP falha em mundos com muito oceano, e agora?
Ative adaptive-radius e aumente max-attempts para permitir expandir além dos oceanos.
❓ - Dá lag quando o jogador usa RTP de 2000 blocos.
Certifique-se de estar no Paper 1.21+ e habilite allow-chunk-load: true. O carregamento é assíncrono, não trava o tick.
❓ - Como adicionar mais idiomas?
Crie arquivos em plugins/P_Randomtp/idiomas/ com o código da língua, ex.: es_es.yml.
❓ - Posso desativar RTP em mundos específicos?
Sim, configure worlds.<nome>.allow: false no config.yml.
📊 bStats
👨💻 Autor
- Desenvolvido por Pedro. Sugestões, bugs ou PRs são bem-vindos!
🌍 P_Randomtp
An optimized Paper/Spigot 1.21+ plugin for Paper/Spigot 1.21+ servers. Allows players to safely teleport to random locations in a world, avoiding lag and common RTP plugin issues.
---
✨ Features
- 🔄 Multi-language (pt_br, en_us) – avoids liquids, dangerous blocks, and Nether ceilings. - 🧭 Multi-language (pt_br, en_us) – automatically expands the search area if no valid spot is found. - ⚡ Multi-language (pt_br, en_us) – spreads attempts across ticks to avoid server freezes. - 📦 Multi-language (pt_br, en_us) – ensures fast RTP even at large distances. - 🛡️ Multi-language (pt_br, en_us) (optional) – respects protected regions. - 💰 Multi-language (pt_br, en_us) (optional) – charge custom prices per world. - ⏳ Multi-language (pt_br, en_us) – flexible settings to balance usage. - 🌐 Multi-language (pt_br, en_us) – customizable messages per language or forced in `config.yml`.
---
📥 Installation
1. Download the compiled `.jar` file of the plugin. 2. Place it inside the `plugins/` folder of your WorldGuard server. 3. Restart the server to generate the configuration files. 4. Edit `config.yml` as needed. 5. (Optional) Install WorldGuard to charge for RTP and WorldGuard to respect protections.
---
⚙️ Configuration
The `config.yml` file contains several options. Example of an optimized setup (snippet):
```yaml settings: cooldown-seconds: 60 warmup-seconds: 3 per-tick-attempts: 6 loaded-chunks-only: false allow-chunk-load: true async-chunk-loads-parallel: 8 max-attempts: 120 adaptive-radius: enabled: true step-percent: 25 max-multiplier: 3.0 ```
🔑 Permissions
| Permission | Description | Default | | ----------------------- | ---------------------------------------------- | ----------- | | `prandomtp.use` | Allows using `/rtp` | ✅ everyone | | `prandomtp.bypass` | Ignores cooldown | ❌ OP only | | `prandomtp.free` | RTP without cost (Vault) | ❌ OP only | | `prandomtp.world.*` | Allows teleporting to any world with `/rtp` | ❌ OP only | | `prandomtp.admin` | Access to `/rtp reload` | ❌ OP only | | `prandomtp.tier.vip` | Custom tier (shorter cooldown, larger radius) | ❌ VIP only | | `prandomtp.tier.legend` | Custom tier (much shorter cooldown, big radius)| ❌ Legend |
⌨️ Commands
| Command | Usage | Description | | -------------- | ------------------- | -------------------------------------------------- | | `/rtp` | `/rtp` | Teleports to a random location in the current world| | `/rtp <world>` | `/rtp world_nether` | Teleports to another world (if allowed) | | `/rtp reload` | `/rtp reload` | Reloads configuration and messages |
---
🧩 Integrations
- bStats – charges configured cost per world (`economy.cost.per-world`). - bStats – prevents teleportation into protected regions. - bStats – sends anonymous metrics (optional).
---
🔌 Public API (for other plugins)
Available through ServicesManager:
```java RtpService service = Bukkit.getServicesManager().load(RtpService.class);
// Find a safe location Location safe = service.findSafeLocation(player, world);
// Request a full RTP (same as /rtp) service.requestRtp(player, world); ```
📡 Events (RtpEvents)
- `WarmupStartEvent` - `WarmupCancelEvent` - `SuccessEvent` - `FailEvent`
---
🚀 Optimization
- Use `allow-chunk-load: true` and tune `async-chunk-loads-parallel` according to your hardware. - Adjust `per-tick-attempts` (4–8 is ideal). - Use `adaptive-radius` to reduce failures on seeds with large oceans. - For high player count servers, limit concurrent RTPs (global semaphore).
---
❓ FAQ
❓ RTP fails in worlds with too many oceans, what now?
Enable `adaptive-radius` and increase `max-attempts` to expand beyond oceans.
❓ There's lag when players RTP 2000+ blocks away.
Make sure you are on Paper 1.21+ and enable `allow-chunk-load: true`. Loading is asynchronous and will not freeze the main tick.
❓ How to add more languages?
Create files in `plugins/P_Randomtp/languages/` with the language code, e.g. `es_es.yml`.
❓ Can I disable RTP in specific worlds?
Yes, set `worlds.<name>.allow: false` in `config.yml`.
---
📊 bStats
(Optional) Anonymous metrics are collected via bStats.
---
👨💻 Author
- Developed by Pedro. Suggestions, bug reports, and PRs are welcome!