raionthego

salut haide ma ajuti sa fac ala cu butoane cum ar fi pay rtp tp homes auctionhouse shop pe serverul meu cum are acest om ? dar care sa si functioneze cand apas pe pay trebuie sa selectez pe ci9neva dintr o lista cu oamenii care sunt pe server si dupa ce dau click pe el trebuie sa aleg cat ii dau pay cum ar i sa adaugi niste variante deafult 100 , 1000 , 10000 si custom unde scriu eu cat vreau sa platesc si la homes sa fie ca cand dau click pe homes sa imi apara toate homes urile mele cu numele lor adevarat cu care le am dat sethome si cand dau click pe un buton cu numele acelei home sa ma teleporteze la acel homes

eu am un plugin in aternos numit commandpanels daca vrei iti dau continutul lui

1 image attached
Kodari AI
KodariAug 24 at 9:23 am 2
PlayerCommandPanel
A Minecraft plugin that provides a graphical command panel with multiple functional buttons. The Pay button opens a GUI listing online players, allowing selection and payment with preset amounts (100, 1000, 10000) or custom input. The Homes button displays all player-created homes with their names, and clicking a home teleports the player to that location. Also includes RTP, TP, Auction House, and Shop buttons for quick access to common commands. Designed for Aternos servers, integrating with CommandPanels-style UI.

Plan:

  1. Creez pluginul și configurația Gradle, cu meniul principal inspirat de imagine.

  2. Adaug GUI-urile pentru Homes, Pay și Teleport, cu paginare și butoane Back/Next.

  3. Conectez butoanele la comenzi configurabile (rtp, ah, shop, etc.).

  4. Adaug plata cu sumele 100/1000/10000 și opțiunea Custom prin chat, plus detectarea numelor de home din EssentialsX.

Am creat pluginul ServerPanel, cu meniul GUI inspirat din imagine.

Funcționalități:

  • /panel, /menu și /servermenu

  • Homes cu numele reale din EssentialsX

  • Teleport către jucători online

  • Pay către jucător ales din listă

  • Sume rapide: 100, 1000, 10000

  • Pay Custom prin chat

  • Butoane configurabile pentru RTP, AuctionHouse, Shop, Friends, Stats etc.

  • Paginare pentru liste mari de jucători și homes

  • Toate comenzile pot fi schimbate în config.yml

Pentru homes, pluginul caută EssentialsX cu:

YAML
homes:
  provider-plugin: Essentials

Dacă folosești alt plugin pentru homes, trimite-mi numele lui sau configurația din CommandPanels și adaptez integrarea. Comenzile existente se modifică în secțiunea commands din config.yml.

raionthego

eu vreau un keybind cand apas pe el sa se deschida ca in poza aia

Kodari AI
KodariAug 24 at 9:23 am 1

Da, dar trebuie să știi o limitare importantă: un plugin Bukkit/Paper nu poate detecta orice tastă apăsată de jucător. Serverul primește doar comenzi și anumite evenimente Minecraft.

Ai 3 variante:

  1. Keybind real, de exemplu K
    Necesită un mod client Fabric/Forge instalat la fiecare jucător. Acesta trimite /panel când apeși K.

  2. Tasta F — soluție doar cu plugin
    Putem folosi evenimentul de schimbare a itemului din mâna secundară. Când apeși F, se deschide meniul, dar schimbarea mâinii va fi blocată.

  3. Comandă / item special
    /panel sau click dreapta cu un item configurat deschide meniul. Nu necesită mod client.

Pentru server Aternos, recomand varianta F, deoarece funcționează fără ca jucătorii să instaleze ceva. Dacă vrei o tastă exactă precum K, M sau P, este necesar un mod client sau un launcher/modpack.

Pot să modific pluginul actual ca:

  • apăsarea tastei F să deschidă meniul din imagine;

  • meniul principal să aibă butoanele Pay, RTP, TP, Homes, AuctionHouse și Shop;

  • apăsarea F să nu mai schimbe itemul din mâna secundară.

Spune-mi doar dacă vrei să folosim F sau preferi un mod client cu keybind personalizat.

raionthego

lasa /menu

Kodari AI
KodariAug 24 at 9:24 am 1

Perfect, rămâne comanda /menu pentru deschiderea meniului, fără keybind.

Jucătorii vor folosi:

Plain Text
/menu

Iar meniul va conține butoanele pentru Pay, RTP, TP, Homes, AuctionHouse și Shop.

raionthego

si sa se deschida ca in poza

Kodari AI
KodariAug 24 at 9:25 am 1
  1. Fac meniul principal să arate ca un panel GUI: fundal cu geam negru, butoane aliniate și buton de închidere.

  2. Păstrez comenzile funcționale existente pentru Pay, RTP, Homes, TP, AuctionHouse și Shop.

  3. Adaug lore pe butoane pentru aspectul de meniu din imagine.

Am modificat meniul ca să se deschidă asemănător cu cel din imagine:

  • /menu deschide meniul principal.

  • Fundal complet cu geam negru.

  • Butoane aranjate pe rânduri.

  • Fiecare buton are descriere când treci cu mouse-ul peste el.

  • Buton Close jos, în centru.

  • Pay, Homes, RTP, TP, Auction, Shop și celelalte butoane rămân funcționale.

  • /panel și /servermenu rămân disponibile ca aliasuri.

raionthego

ok acum unde il pun?

Kodari AI
KodariAug 24 at 9:25 am 1

Pluginul trebuie pus ca fișier .jar, nu ca fișierele .java.

Pe Aternos

  1. Descarcă fișierul pluginului, de exemplu:

    Plain Text
    ServerPanel.jar
    
  2. Intră pe Aternos → Files → plugins.

  3. Apasă Upload și încarcă fișierul .jar.

  4. Pornește sau repornește serverul.

  5. Verifică în consolă dacă apare pluginul ServerPanel activ.

  6. În joc folosește:

    Plain Text
    /menu
    

Dacă Aternos nu îți afișează butonul Upload pentru pluginuri, nu permite instalarea pluginurilor .jar personalizate pe serverul tău. În acest caz, trebuie folosit un plugin disponibil în lista Aternos sau un server unde ai acces complet la fișiere.

Dacă ai doar codul proiectului și nu ai încă fișierul .jar, acesta trebuie mai întâi compilat.

raionthego

daca sunt pe aternos nu pot adauga plugins noi

Kodari AI
KodariAug 24 at 9:25 am 1

Da, pe Aternos nu poți încărca pluginuri .jar personalizate direct. Poți instala doar pluginurile disponibile în lista lor oficială.

Ai aceste variante:

  1. Folosim CommandPanels pe care îl ai deja
    Îmi trimiți conținutul panelului/configurației, iar eu îl adaptez să arate ca în poză și să aibă butoane pentru:

    • Pay

    • RTP

    • TP

    • Homes

    • AuctionHouse

    • Shop

  2. Folosim pluginuri disponibile în Aternos
    De exemplu, pentru homes și economie trebuie să știm ce pluginuri ai instalate: EssentialsX, Vault, EconomyShopGUI, PlayerWarp etc.

  3. Mutarea serverului pe o gazdă care permite pluginuri custom, dacă vrei neapărat să instalezi pluginul nostru ServerPanel.jar.

Pentru varianta ta, cel mai bine este să-mi trimiți:

  • fișierul sau conținutul configurației CommandPanels;

  • lista pluginurilor instalate pe server.

Poți copia aici configurația panelului, iar eu îți spun exact ce trebuie modificat.

raionthego

|------------------------------------------------------------------------

| CommandPanels Config File

| By RockyHawk v8

| https://www.spigotmc.org/resources/67788/

|

|------------------------------------------------------------------------

When disabled, custom commands to open panels will not be registered

custom-commands: true

Amount of time in ticks players must wait between opening panels

cooldown-ticks: 5

Logs to console whenever a panel is opened

panel-snooper: false

When enabled, panels will automatically refresh if any observed permissions change.

Permissions used in HASPERM conditions are considered observed permissions.

permission-observer: true : config,yml title: '&8&lMy Server' type: dialog command: menu has-exit-button: true escapable: true columns: 2 layout: '0': - btn_homes - btn_auction - btn_quickbuy - btn_orders - btn_sell - btn_teleport - btn_leaderboards '1': - btn_rtp - btn_rtpqueue - btn_friends - btn_shardshop - btn_pay - btn_stats - btn_settings items: btn_homes: type: button width: 200 name: '&fHomes' tooltip: See your homes actions: commands: - '[close]' - '[chat] /homes' btn_rtp: type: button width: 200 name: '&fRTP' tooltip: Random teleport actions: commands: - '[close]' - '[chat] /rtp' btn_auction: type: button width: 200 name: '&fAuction' tooltip: Open the auction house actions: commands: - '[close]' - '[chat] /auctionhouse' btn_rtpqueue: type: button width: 200 name: '&fRTP Queue' tooltip: Join RTP Queue actions: commands: - '[close]' - '[chat] /rtp queue' btn_quickbuy: type: button width: 200 name: '&fQuick Buy' tooltip: Quick Buy Items actions: commands: - '[close]' - '[chat] /shop' btn_friends: type: button width: 200 name: '&fFriends' tooltip: Manage friends actions: commands: - '[close]' - '[chat] /friends' btn_orders: type: button width: 200 name: '&fOrders' tooltip: View orders actions: commands: - '[close]' - '[chat] /orders' btn_shardshop: type: button width: 200 name: '&fShard Shop' tooltip: Shard Shop actions: commands: - '[close]' - '[chat] /shardshop' btn_sell: type: button width: 200 name: '&fSell' tooltip: Sell items actions: commands: - '[close]' - '[chat] /sell' btn_pay: type: button width: 200 name: '&fPay' tooltip: Pay a player actions: commands: - '[close]' - '[open] pay' btn_teleport: type: button width: 200 name: '&fTeleport' tooltip: Teleport to players actions: commands: - '[close]' - '[open] teleport' btn_stats: type: button width: 200 name: '&fStats' tooltip: View your stats actions: commands: - '[close]' - '[chat] /stats' btn_leaderboards: type: button width: 200 name: '&fLeaderboards' tooltip: View leaderboards actions: commands: - '[close]' - '[chat] /leaderboards' btn_settings: type: button width: 200 name: '&fSettings' tooltip: Manage settings actions: commands: - '[close]' - '[chat] /settings' menu.yml # |------------------------------------------------------------------------

| CommandPanels Dialog File

| Official Panel v2

| https://www.spigotmc.org/resources/command-panels-custom-guis.67788/

|------------------------------------------------------------------------

conditions: '%player_name% $HASPERM example.permission' title: '&6Welcome to Our Server!' type: dialog has-exit-button: false escapable: true columns: 1

layout: '0': - welcome_text '1': - info_text '3': - welcome_item '5': - input_nickname '7': - btn_confirm '8': - btn_website

items: welcome_text: type: text name: '&eHello, &6%player_name%&e!' lore: - '&7We are glad to have you here.' - '&7Please enter a nickname to use on the server.'

info_text: type: text name: '&fYour nickname will be shown to others.' lore: - '&7You can change it anytime in this dialog.'

welcome_item: type: item material: NAME_TAG name: '&bNickname Tag' text: Use this tag to set your nickname.

input_nickname: type: input name: '&aEnter your new nickname' initial: '%player_name%' placeholder: Type your nickname here...

btn_confirm: type: button width: 200 name: '&aConfirm Nickname' tooltip: Save your new nickname actions: commands: - '[console] nick %player_name% %commandpanels_session_input_nickname%' - '[msg] &aYour nickname has been set to &6%commandpanels_session_input_nickname%&a.'

btn_website: type: button width: 200 name: '&bVisit Website' url: https://commandpanels.net/ tooltip: Click to visit our website dialog.yml si ti am trimis o poza cu ce fisiere m ai am

1 image attached
Kodari AI
KodariAug 24 at 9:28 am 1

Da, poza arată că ai deja aceste fișiere în plugins/CommandPanels/panels:

  • dialog.yml

  • floodgate_custom.yml

  • floodgate_simple.yml

  • homes.yml

  • inventory.yml

  • menu.yml

  • pay.yml

  • teleport.yml

În menu.yml, butonul Homes folosește momentan:

YAML
- '[chat] /homes'

Asta execută doar comanda /homes. Ca să deschidă panelul tău homes.yml, schimbă-l în:

YAML
btn_homes:
  type: button
  width: 200
  name: '&fHomes'
  tooltip: See your homes
  actions:
    commands:
    - '[close]'
    - '[open] homes'

Butonul Pay este deja configurat să deschidă panelul pay.yml:

YAML
- '[open] pay'

Și butonul Teleport este configurat pentru teleport.yml:

YAML
- '[open] teleport'

După modificare:

  1. Salvează menu.yml.

  2. Intră pe server și folosește:

    Plain Text
    /cp reload
    

    Dacă această comandă nu funcționează, repornește serverul.

  3. Deschide meniul cu:

    Plain Text
    /menu
    

Totuși, pentru a face funcționale exact Pay cu jucători online, sumele 100/1000/10000/Custom și Homes cu numele reale, trebuie să văd conținutul complet al acestor trei fișiere:

Plain Text
homes.yml
pay.yml
teleport.yml

Copiază aici conținutul lor, iar eu îți dau variantele corectate gata de înlocuit.

raionthego

da mi fisierele de trebuie sa le modific tu full modificate

Kodari AI
KodariAug 24 at 9:30 am 1
  1. Verific fișierele CommandPanels existente și sintaxa folosită.

  2. Înlocuiesc complet menu.yml, homes.yml, pay.yml și teleport.yml cu variante funcționale pentru panelurile tale.

  3. Îți spun exact unde să le copiezi și ce pluginuri/comenzi trebuie să existe pentru Homes și Pay.

Ca să le modific corect și complet, trimite conținutul integral al acestor 3 fișiere:

Plain Text
plugins/CommandPanels/panels/homes.yml
plugins/CommandPanels/panels/pay.yml
plugins/CommandPanels/panels/teleport.yml

Fișierul menu.yml îl pot modifica astfel:

YAML
title: '&8&lMy Server'
type: dialog
command: menu
has-exit-button: true
escapable: true
columns: 2

layout:
  '0':
  - btn_homes
  - btn_auction
  - btn_quickbuy
  - btn_orders
  - btn_sell
  - btn_teleport
  - btn_leaderboards
  '1':
  - btn_rtp
  - btn_rtpqueue
  - btn_friends
  - btn_shardshop
  - btn_pay
  - btn_stats
  - btn_settings

items:
  btn_homes:
    type: button
    width: 200
    name: '&fHomes'
    tooltip: '&7Vezi casele tale'
    actions:
      commands:
      - '[close]'
      - '[open] homes'

  btn_rtp:
    type: button
    width: 200
    name: '&fRTP'
    tooltip: '&7Teleportare aleatorie'
    actions:
      commands:
      - '[close]'
      - '[chat] /rtp'

  btn_auction:
    type: button
    width: 200
    name: '&fAuction House'
    tooltip: '&7Deschide casa de licitații'
    actions:
      commands:
      - '[close]'
      - '[chat] /auctionhouse'

  btn_rtpqueue:
    type: button
    width: 200
    name: '&fRTP Queue'
    tooltip: '&7Intră în coada RTP'
    actions:
      commands:
      - '[close]'
      - '[chat] /rtp queue'

  btn_quickbuy:
    type: button
    width: 200
    name: '&fShop'
    tooltip: '&7Deschide magazinul'
    actions:
      commands:
      - '[close]'
      - '[chat] /shop'

  btn_friends:
    type: button
    width: 200
    name: '&fFriends'
    tooltip: '&7Gestionează prietenii'
    actions:
      commands:
      - '[close]'
      - '[chat] /friends'

  btn_orders:
    type: button
    width: 200
    name: '&fOrders'
    tooltip: '&7Vezi comenzile'
    actions:
      commands:
      - '[close]'
      - '[chat] /orders'

  btn_shardshop:
    type: button
    width: 200
    name: '&fShard Shop'
    tooltip: '&7Deschide Shard Shop'
    actions:
      commands:
      - '[close]'
      - '[chat] /shardshop'

  btn_sell:
    type: button
    width: 200
    name: '&fSell'
    tooltip: '&7Vinde obiecte'
    actions:
      commands:
      - '[close]'
      - '[chat] /sell'

  btn_pay:
    type: button
    width: 200
    name: '&fPay'
    tooltip: '&7Trimite bani unui jucător'
    actions:
      commands:
      - '[close]'
      - '[open] pay'

  btn_teleport:
    type: button
    width: 200
    name: '&fTeleport'
    tooltip: '&7Teleportează-te la un jucător'
    actions:
      commands:
      - '[close]'
      - '[open] teleport'

  btn_stats:
    type: button
    width: 200
    name: '&fStats'
    tooltip: '&7Vezi statisticile'
    actions:
      commands:
      - '[close]'
      - '[chat] /stats'

  btn_leaderboards:
    type: button
    width: 200
    name: '&fLeaderboards'
    tooltip: '&7Vezi clasamentele'
    actions:
      commands:
      - '[close]'
      - '[chat] /leaderboards'

  btn_settings:
    type: button
    width: 200
    name: '&fSettings'
    tooltip: '&7Gestionează setările'
    actions:
      commands:
      - '[close]'
      - '[chat] /settings'

Nu pot inventa corect homes.yml și pay.yml fără să văd configurația lor actuală, deoarece lista automată cu homes reale și jucători online depinde de versiunea CommandPanels și de pluginurile instalate — de exemplu EssentialsX, CMI, EconomyShopGUI sau Vault.

Trimite cele 3 fișiere, iar îți returnez fiecare fișier complet, gata de copiat.

raionthego

title: '&8&lHomes' type: dialog command: homes aliases: ['homesmenu'] has-exit-button: true escapable: true columns: 6 refresh: 20 update-delay: 20 layout: '0': - home_1_set - home_1_new - home_7_set - home_7_new '1': - home_2_set - home_2_new - home_8_set - home_8_new '2': - home_3_set - home_3_new - home_9_set - home_9_new '3': - home_4_set - home_4_new - home_10_set - home_10_new '4': - home_5_set - home_5_new '5': - home_6_set - home_6_new items: # ========== HOME 1 ========== home_1_set: type: button width: 40 name: '&a%essentials_home_1%' tooltip: 'Teleport la %essentials_home_1%' conditions: '%essentials_homes_set% $ATLEAST 1' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_1%' home_1_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 1' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 2 ========== home_2_set: type: button width: 40 name: '&a%essentials_home_2%' tooltip: 'Teleport la %essentials_home_2%' conditions: '%essentials_homes_set% $ATLEAST 2' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_2%' home_2_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 2' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 3 ========== home_3_set: type: button width: 40 name: '&a%essentials_home_3%' tooltip: 'Teleport la %essentials_home_3%' conditions: '%essentials_homes_set% $ATLEAST 3' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_3%' home_3_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 3' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 4 ========== home_4_set: type: button width: 40 name: '&a%essentials_home_4%' tooltip: 'Teleport la %essentials_home_4%' conditions: '%essentials_homes_set% $ATLEAST 4' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_4%' home_4_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 4' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 5 ========== home_5_set: type: button width: 40 name: '&a%essentials_home_5%' tooltip: 'Teleport la %essentials_home_5%' conditions: '%essentials_homes_set% $ATLEAST 5' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_5%' home_5_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 5' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 6 ========== home_6_set: type: button width: 40 name: '&a%essentials_home_6%' tooltip: 'Teleport la %essentials_home_6%' conditions: '%essentials_homes_set% $ATLEAST 6' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_6%' home_6_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 6' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 7 ========== home_7_set: type: button width: 40 name: '&a%essentials_home_7%' tooltip: 'Teleport la %essentials_home_7%' conditions: '%essentials_homes_set% $ATLEAST 7' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_7%' home_7_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 7' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 8 ========== home_8_set: type: button width: 40 name: '&a%essentials_home_8%' tooltip: 'Teleport la %essentials_home_8%' conditions: '%essentials_homes_set% $ATLEAST 8' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_8%' home_8_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 8' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 9 ========== home_9_set: type: button width: 40 name: '&a%essentials_home_9%' tooltip: 'Teleport la %essentials_home_9%' conditions: '%essentials_homes_set% $ATLEAST 9' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_9%' home_9_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 9' color: gray actions: commands: - '[close]' - '[suggest] /sethome '

# ========== HOME 10 ========== home_10_set: type: button width: 40 name: '&a%essentials_home_10%' tooltip: 'Teleport la %essentials_home_10%' conditions: '%essentials_homes_set% $ATLEAST 10' color: gray actions: commands: - '[close]' - '[chat] /home %essentials_home_10%' home_10_new: type: button width: 40 name: '&7New Home' tooltip: 'Click to set new home' conditions: '%essentials_homes_set% $LESSTHAN 10' color: gray actions: commands: - '[close]' - '[suggest] /sethome ' homes.yml si pay,yml title: '&8&lPay a player' type: dialog has-exit-button: true escapable: true columns: 1 layout: '0': - info_text - input_target - input_amount '1': - btn_100 - btn_1000 - btn_10000 - btn_custom - btn_back

items: info_text: type: text name: '&eScrie numele jucatorului mai jos, apoi alege o suma.' lore: - '&7Poti apasa un buton cu suma fixa, sau scrii tu suma' - '&7in campul de jos si apesi Trimite suma custom.'

input_target: type: input name: '&aNumele jucatorului' initial: '' placeholder: 'ex: Godeanu'

input_amount: type: input name: '&aSuma custom (doar daca apesi butonul Custom)' initial: '' placeholder: 'ex: 2500'

btn_100: type: button width: 200 name: '&f100' tooltip: Trimite 100 actions: commands: - '[close]' - '[chat] /pay %commandpanels_session_input_target% 100'

btn_1000: type: button width: 200 name: '&f1,000' tooltip: Trimite 1000 actions: commands: - '[close]' - '[chat] /pay %commandpanels_session_input_target% 1000'

btn_10000: type: button width: 200 name: '&f10,000' tooltip: Trimite 10000 actions: commands: - '[close]' - '[chat] /pay %commandpanels_session_input_target% 10000'

btn_custom: type: button width: 200 name: '&eTrimite suma custom' tooltip: Trimite suma scrisa mai sus actions: commands: - '[close]' - '[chat] /pay %commandpanels_session_input_target% %commandpanels_session_input_amount%'

btn_back: type: button width: 200 name: '&7« Inapoi la meniu' tooltip: Inapoi actions: commands: - '[open] menu'

Kodari AI
KodariAug 24 at 9:33 am 1

Înlocuiește complet fișierele din:

Plain Text
plugins/CommandPanels/panels/homes.yml
plugins/CommandPanels/panels/pay.yml

homes.yml

YAML
title: '&8&lHomes'
type: dialog
command: homes
aliases:
- homesmenu
has-exit-button: true
escapable: true
columns: 5
refresh: 20
update-delay: 20

layout:
  '0':
  - home_1_set
  - home_1_new
  - home_6_set
  - home_6_new
  '1':
  - home_2_set
  - home_2_new
  - home_7_set
  - home_7_new
  '2':
  - home_3_set
  - home_3_new
  - home_8_set
  - home_8_new
  '3':
  - home_4_set
  - home_4_new
  - home_9_set
  - home_9_new
  '4':
  - home_5_set
  - home_5_new
  - home_10_set
  - home_10_new

items:
  home_1_set:
    type: button
    width: 120
    name: '&a%essentials_home_1%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 1'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_1%'

  home_1_new:
    type: button
    width: 120
    name: '&7Home 1'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 1'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_2_set:
    type: button
    width: 120
    name: '&a%essentials_home_2%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 2'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_2%'

  home_2_new:
    type: button
    width: 120
    name: '&7Home 2'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 2'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_3_set:
    type: button
    width: 120
    name: '&a%essentials_home_3%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 3'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_3%'

  home_3_new:
    type: button
    width: 120
    name: '&7Home 3'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 3'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_4_set:
    type: button
    width: 120
    name: '&a%essentials_home_4%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 4'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_4%'

  home_4_new:
    type: button
    width: 120
    name: '&7Home 4'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 4'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_5_set:
    type: button
    width: 120
    name: '&a%essentials_home_5%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 5'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_5%'

  home_5_new:
    type: button
    width: 120
    name: '&7Home 5'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 5'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_6_set:
    type: button
    width: 120
    name: '&a%essentials_home_6%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 6'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_6%'

  home_6_new:
    type: button
    width: 120
    name: '&7Home 6'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 6'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_7_set:
    type: button
    width: 120
    name: '&a%essentials_home_7%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 7'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_7%'

  home_7_new:
    type: button
    width: 120
    name: '&7Home 7'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 7'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_8_set:
    type: button
    width: 120
    name: '&a%essentials_home_8%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 8'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_8%'

  home_8_new:
    type: button
    width: 120
    name: '&7Home 8'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 8'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_9_set:
    type: button
    width: 120
    name: '&a%essentials_home_9%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 9'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_9%'

  home_9_new:
    type: button
    width: 120
    name: '&7Home 9'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 9'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

  home_10_set:
    type: button
    width: 120
    name: '&a%essentials_home_10%'
    tooltip: '&7Teleportează-te la acest home'
    conditions: '%essentials_homes_set% $ATLEAST 10'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[chat] /home %essentials_home_10%'

  home_10_new:
    type: button
    width: 120
    name: '&7Home 10'
    tooltip: '&7Apasă pentru a seta un home nou'
    conditions: '%essentials_homes_set% $LESSTHAN 10'
    color: gray
    actions:
      commands:
      - '[close]'
      - '[suggest] /sethome '

pay.yml

YAML
title: '&8&lPay a Player'
type: dialog
command: paymenu
aliases:
- sendmoney
has-exit-button: true
escapable: true
columns: 1

layout:
  '0':
  - info_text
  - input_target
  - input_amount
  '1':
  - btn_100
  - btn_1000
  - btn_10000
  - btn_custom
  - btn_back

items:
  info_text:
    type: text
    name: '&eTrimite bani unui jucător'
    lore:
    - '&7Scrie numele jucătorului și suma dorită.'
    - '&7Poți folosi o sumă fixă sau una personalizată.'

  input_target:
    type: input
    name: '&aNumele jucătorului'
    initial: ''
    placeholder: 'Exemplu: Godeanu'

  input_amount:
    type: input
    name: '&aSumă personalizată'
    initial: ''
    placeholder: 'Exemplu: 2500'

  btn_100:
    type: button
    width: 200
    name: '&aTrimite 100$'
    tooltip: '&7Trimite 100 către jucător'
    actions:
      commands:
      - '[close]'
      - '[chat] /pay %commandpanels_session_input_target% 100'

  btn_1000:
    type: button
    width: 200
    name: '&aTrimite 1.000$'
    tooltip: '&7Trimite 1.000 către jucător'
    actions:
      commands:
      - '[close]'
      - '[chat] /pay %commandpanels_session_input_target% 1000'

  btn_10000:
    type: button
    width: 200
    name: '&aTrimite 10.000$'
    tooltip: '&7Trimite 10.000 către jucător'
    actions:
      commands:
      - '[close]'
      - '[chat] /pay %commandpanels_session_input_target% 10000'

  btn_custom:
    type: button
    width: 200
    name: '&eTrimite suma custom'
    tooltip: '&7Trimite suma scrisă în câmpul de mai sus'
    actions:
      commands:
      - '[close]'
      - '[chat] /pay %commandpanels_session_input_target% %commandpanels_session_input_amount%'

  btn_back:
    type: button
    width: 200
    name: '&7« Înapoi la meniu'
    tooltip: '&7Revino la meniul principal'
    actions:
      commands:
      - '[open] menu'

În menu.yml, verifică să ai la butonul Homes:

YAML
btn_homes:
  type: button
  width: 200
  name: '&fHomes'
  tooltip: '&7Vezi casele tale'
  actions:
    commands:
    - '[close]'
    - '[open] homes'

După ce salvezi fișierele, folosește:

Plain Text
/cp reload

Dacă nu funcționează, repornește serverul. Ai nevoie ca EssentialsX să ofere comenzile /home, /sethome și /pay.

raionthego

am dat restart la server dupa ce am us acele fisiere pe care mi le ai dat si tot ca inainte imi apare cand dau /menu

1 image attached
Kodari AI
KodariAug 24 at 9:37 am 1

Imaginea confirmă că serverul nu folosește versiunea pluginului din fișierele actuale:

  • codul actual deschide un GUI de inventar cu 54 de sloturi;

  • imaginea arată un Dialog Minecraft, cu blur și doar butoanele „Homes” și „RTP”;

  • configurația actuală ar trebui să afișeze mult mai multe butoane: Auction, Friends, Shop, Pay etc.

Cel mai probabil rulează un JAR vechi sau comanda /menu este preluată de alt plugin.

Verifică pe server:

Plain Text
/plugins
/version
/help menu

În consolă verifică și:

Plain Text
plugins

Apoi:

  1. Oprește serverul complet.

  2. Șterge JAR-ul vechi al pluginului din plugins/.

  3. Copiază noul JAR compilat în plugins/.

  4. Verifică să existe un singur JAR pentru acest plugin.

  5. Dacă există folderul plugins/ServerPanel/, redenumește temporar config.yml în config-old.yml.

  6. Pornește serverul complet, nu folosi /reload.

  7. Rulează /panel, nu /menu.

Dacă /panel deschide meniul corect, atunci /menu este conflict cu alt plugin. În cazul acesta, trebuie eliminat aliasul /menu din acel plugin sau folosită comanda /panel.

Important: saveDefaultConfig() nu suprascrie configurația existentă, deci modificările din src/main/resources/config.yml nu ajung automat în plugins/ServerPanel/config.yml.

raionthego
3 images attached
Kodari AI
KodariAug 24 at 9:40 am 1

Imaginile confirmă problema:

  • Pluginul tău nu apare deloc în /plugins, deci nu este încărcat.

  • Comanda /menu este preluată de DeluxeMenus:

    Plain Text
    /menu: DeluxeMenus main command
    
  • Paper este pornit corect pe versiunea 1.21.6, deci nu versiunea serverului este problema.

Fă următoarele:

  1. Oprește serverul complet.

  2. Copiază fișierul .jar compilat al pluginului în:

    Plain Text
    server/plugins/
    

    Nu copia folderul cu fișierele Java și nu copia un .zip.

  3. Verifică să existe un singur JAR al pluginului.

  4. Pornește serverul și verifică:

    Plain Text
    /plugins
    

    Pluginul trebuie să apară cu verde.

  5. Folosește:

    Plain Text
    /panel
    

    nu /menu, deoarece /menu aparține DeluxeMenus.

Dacă pluginul este deja în folderul plugins, dar nu apare în listă, verifică consola imediat după pornire. Trebuie să existe o eroare de forma:

Plain Text
Could not load 'plugins/nume-plugin.jar'

sau:

Plain Text
Error occurred while enabling ...

Trimite partea din consolă de la pornire care conține ServerPanel, numele JAR-ului sau Could not load, pentru a identifica exact de ce nu se încarcă.

raionthego

daca sterg deluxe menus e bine?

Kodari AI
KodariAug 24 at 9:42 am 1

Da, poți șterge DeluxeMenus, dar asta rezolvă doar conflictul cu /menu. Pluginul tău trebuie totuși să fie instalat corect și să apară cu verde în /plugins.

Recomandarea mea:

  1. Oprește serverul complet.

  2. Fă backup folderului plugins/DeluxeMenus/.

  3. Șterge:

    Plain Text
    plugins/DeluxeMenus.jar
    plugins/DeluxeMenus/
    
  4. Pornește serverul din nou.

  5. Verifică:

    Plain Text
    /plugins
    
  6. Rulează:

    Plain Text
    /panel
    

Dacă pluginul tău apare în /plugins, poți folosi apoi /menu numai dacă în plugin.yml este definit ca alias. Dacă nu apare, ștergerea DeluxeMenus nu este suficientă — trebuie copiat JAR-ul pluginului tău în folderul plugins/.

raionthego

AUZI UNDE POT CREA UN SERVER UNDE POT PUNE PLUGINS URI DE ALE MELE DAR SA FIE GRATIS

Kodari AI
KodariAug 24 at 9:44 am 1

Da. Pentru pluginurile tale, ai nevoie de un host care permite încărcarea manuală a fișierelor .jar.

Variante gratuite

  1. FalixNodes – cea mai simplă variantă

    • permite încărcarea pluginurilor proprii;

    • poți folosi Paper/Spigot;

    • are limitări și serverul poate fi oprit când nu este folosit;

    • intri în File Manager → plugins → Upload și pui pluginul .jar.

  2. Oracle Cloud Free Tier – control complet

    • primești un VPS gratuit în limita resurselor disponibile;

    • poți instala Paper și orice plugin vrei;

    • necesită cunoștințe de Linux și configurare firewall;

    • uneori cere card pentru verificare.

  3. Serverul pe calculatorul tău – complet gratuit pentru testare

    • instalezi Paper local;

    • pui pluginurile în folderul plugins;

    • este ideal pentru dezvoltare;

    • ca să intre și alții, ai nevoie de port forwarding sau de un tunel precum playit.gg.

Recomandarea mea

Pentru tine: FalixNodes, dacă vrei ceva ușor, sau server local Paper, dacă doar testezi pluginul.

Nu recomand Aternos pentru pluginuri dezvoltate de tine, deoarece de obicei permite doar pluginuri din lista lor și nu poți încărca orice JAR personal.

Indiferent de host:

Plain Text
plugins/
└── ServerPanel.jar

Apoi dai restart complet și verifici:

Plain Text
/plugins

Pluginul trebuie să apară cu verde. Pentru cazul tău, trebuie folosită comanda /panel, deoarece /menu era deja ocupată de DeluxeMenus.

raionthego

FelixNodes am acum da mi ce plugins trebuie sa iau si plugin ul ala al tau care ai zis ca il faci ca aceste butoane sa mearga

Kodari AI
KodariAug 24 at 9:49 am 1

Plan:

  1. Identific ce pluginuri externe sunt necesare pentru butoanele existente și cum se instalează pe FalixNodes.

  2. Verific și repar pluginul de meniu, astfel încât butoanele să execute comenzile corecte.

  3. Îți spun exact ce .jar trebuie încărcat și cum îl testezi.

  1. Pentru configurația actuală, butoanele nu sunt toate funcții proprii pluginului; ele trimit comenzi către pluginuri externe:

    • EssentialsX — homes, /home, /pay, /tp

    • Vault — economie pentru plăți (și un plugin de economie compatibil, de exemplu EssentialsX Economy)

    • un plugin RTP — /rtp

    • un plugin de auction house — /ah

    • Pentru Friends, Shop, Stats, Leaderboards etc. îți trebuie pluginuri care chiar oferă comenzile respective.

Pe FalixNodes nu trebuie să instalezi toate acestea ca să testezi meniul. Minim: ServerPanel.jar + EssentialsX + Vault + EssentialsX Economy. Butoanele fără pluginul corespunzător vor afișa eroarea „unknown command”. Acum verific acțiunile din plugin ca să-ți dau JAR-ul corect și să nu rămână butoane care nu funcționează.

  1. Codul pluginului este deja făcut: meniul principal, Homes, alegerea jucătorului pentru Pay/Teleport și plățile sunt implementate. Problema este că serverul nu îl poate folosi până nu pui JAR-ul compilat în plugins/; fișierele .java nu se încarcă de Paper. Verific acum dacă proiectul are deja wrapper/artefact pentru a-ți spune exact ce fișier trebuie urcat.

Pentru ca butoanele „Homes” și „RTP” să funcționeze pe FalixNodes, ai nevoie de:

Pluginuri obligatorii

  1. ServerPanel.jar — pluginul meniului meu

  2. EssentialsX — pentru:

    • Homes

    • /home

    • /pay

    • /tp

  3. BetterRTP — pentru butonul RTP și comanda /rtp

Recomandat

  1. Vault — necesar dacă folosești și alte pluginuri de economie/shop. EssentialsX are deja economia proprie, deci pentru testul de bază nu este obligatoriu.

Nu mai ai nevoie de DeluxeMenus. Șterge-l sau dezactivează-l, deoarece ocupă comanda /menu.

Ce trebuie să încarci în FalixNodes

În folderul:

Plain Text
plugins/

trebuie să ai:

Plain Text
ServerPanel-1.0.0.jar
EssentialsX.jar
BetterRTP.jar
Vault.jar

Vault.jar este opțional pentru început.

Important: în FalixNodes trebuie încărcat fișierul:

Plain Text
ServerPanel-1.0.0.jar

Nu încărca fișierele .java, folderul proiectului sau arhiva ZIP.

JAR-ul pluginului se obține după compilare în:

Plain Text
build/libs/ServerPanel-1.0.0.jar

Dacă folosești IntelliJ IDEA, rulează din panoul Gradle:

Plain Text
Tasks → build → build

După upload:

  1. Oprește serverul complet.

  2. Șterge DeluxeMenus.jar.

  3. Încarcă ServerPanel-1.0.0.jar în plugins.

  4. Pornește serverul.

  5. Verifică:

    Plain Text
    /plugins
    
  6. Deschide meniul cu:

    Plain Text
    /panel
    

    sau, după ștergerea DeluxeMenus:

    Plain Text
    /menu
    

Celelalte butoane din configurație — Auction, Friends, Shop, Stats, Orders etc. — sunt doar legături către comenzi externe. Pentru ele trebuie instalat câte un plugin care oferă exact comenzile /ah, /friends, /shop, /stats și celelalte. Pentru primul test instalează doar ServerPanel + EssentialsX + BetterRTP.

raionthego

care este ?

1 image attached
Kodari AI
KodariAug 24 at 9:50 am 1

În imagine nu este pluginul principal EssentialsX. Nu instala niciunul dintre cele afișate — sunt addon-uri:

  • EssentialsX KitsGUI = doar pentru kituri

  • EssentialsX /afk = doar pentru /afk

  • GreatEssentialsGui = interfață suplimentară

Caută exact:

Plain Text
EssentialsX

și mergi pe pagina 2, dacă este necesar. Pluginul corect trebuie să se numească simplu:

Plain Text
EssentialsX

Pentru început îți trebuie:

  1. EssentialsX — pentru /sethome, /home, /pay

  2. Vault — recomandat pentru economie

  3. EssentialsX Spawn — opțional, pentru /spawn și /setspawn

  4. BetterRTP — pentru butonul RTP

Dacă Falix nu afișează pluginul principal, descarcă EssentialsX de pe site-ul oficial:

Plain Text
https://essentialsx.net/downloads.html

Descarcă fișierul:

Plain Text
EssentialsX-*.jar

Apoi în Falix:

Plain Text
File Manager → plugins → Upload

În imaginea ta, serverul apare OFFLINE, deci oprește-l complet înainte să încarci fișierele. După upload, pornește serverul și verifică:

Plain Text
/plugins

Trebuie să vezi Essentials cu verde. Nu uita că pluginul meniului tău trebuie încărcat separat ca fișier .jar; fără el, butoanele meniului nu vor funcționa.

raionthego

poti adauga sa apara aici un buton cu Godeanu sv care deschide menu ?

1 image attached
Kodari AI
KodariAug 28 at 12:18 pm 1

Nu prin pluginul de server. Ecranul din imagine este meniul Pause al clientului Minecraft, iar pluginurile Paper/Spigot pot modifica doar ce se întâmplă pe server — nu pot adăuga butoane în interfața clientului vanilla.

Pentru un buton „Godeanu SV” care să execute /menu, ai două variante:

  1. Mod Fabric instalat la fiecare jucător
    Modul adaugă butonul în meniul Pause și, la apăsare, trimite comanda /menu. Trebuie să fie compatibil cu versiunea ta de Minecraft.

  2. Rămâi la plugin
    Jucătorii folosesc:

    Plain Text
    /menu
    

    sau un item/NPC/GUI din joc care deschide meniul.

Un resource pack nu este suficient pentru a modifica meniul Pause. Dacă vrei neapărat butonul în locul din imagine, trebuie creat un mod client-side Fabric, iar pluginul ServerPanel trebuie să fie instalat pe server pentru a procesa /menu.

raionthego

esti conectat la repo

Kodari AI
KodariAug 28 at 12:22 pm 1

Da — am acces la proiectul/repository-ul disponibil în această conversație și pot modifica fișierele lui.

Nu sunt conectat direct la:

  • contul tău de GitHub/GitLab;

  • panoul FalixNodes;

  • serverul Minecraft pornit;

  • calculatorul tău.

Pot însă să modific pluginul din proiect și să pregătesc codul. Pentru butonul „Godeanu SV” din meniul Pause ar trebui adăugat un mod client Fabric, separat de pluginul Paper al serverului.

raionthego

da

Kodari AI
KodariAug 28 at 12:31 pm 4

Plan:

  1. Verific dacă repository-ul conține deja un mod client Fabric și ce versiune Minecraft folosește.

  2. Adaug butonul „Godeanu SV” în meniul Pause, cu trimiterea comenzii /menu.

  3. Îți spun ce fișiere/JAR trebuie instalate pe server și pe client.

Am adăugat mod-ul Fabric client-side pentru butonul „Godeanu SV” în meniul Pause.

Fișierele sunt în:

Plain Text
client-mod/

Butonul trimite comanda:

Plain Text
/panel

Astfel nu mai există conflict cu DeluxeMenus. Poți păstra DeluxeMenus instalat, dar dacă nu îl folosești îl poți șterge.

Pentru serverul FalixNodes

În plugins/ trebuie să ai:

Plain Text
ServerPanel-1.0.0.jar

Pentru Minecraft-ul tău

Pe calculatorul fiecărui jucător trebuie instalate:

  • Fabric Loader pentru Minecraft 1.21.6

  • Fabric API pentru Minecraft 1.21.6

  • JAR-ul modului:

    Plain Text
    client-mod/build/libs/godeanu-button-1.0.0.jar
    

JAR-ul modului se pune în:

Plain Text
.minecraft/mods/

Apoi pornești Minecraft folosind profilul Fabric 1.21.6. În meniul Pause va apărea butonul Godeanu SV, sus în dreapta.

raionthego

eu vreau sa apara la toata lumea cand da esc sa apara acel buton fara sa instaleze toti ceva pe calculator

Kodari AI
KodariAug 28 at 12:32 pm 1

Nu se poate face direct doar cu un plugin Paper/Spigot. Butonul din imagine aparține clientului Minecraft, iar serverul nu poate modifica meniul care apare când jucătorul apasă ESC.

Ca să apară acolo, fiecare jucător trebuie să aibă instalat un mod client-side. Nu trebuie însă să-l instaleze manual dacă folosești:

  • un modpack distribuit tuturor;

  • un launcher custom care descarcă automat mod-ul;

  • un launcher precum CurseForge/Prism/MultiMC configurat cu modpack-ul.

Fără mod instalat, alternativele server-side sunt:

  • un item permanent, de exemplu o busolă, care deschide meniul;

  • un NPC;

  • un mesaj clicabil la intrarea pe server;

  • comanda /menu sau /panel;

  • un plugin care deschide meniul automat la apăsarea unei taste doar dacă jucătorul folosește un mod/client compatibil.

Deci răspunsul exact este: buton în meniul ESC fără instalare pe client — imposibil cu pluginuri de server. Mod-ul poate fi distribuit automat printr-un modpack, dar tot trebuie să ajungă pe calculatorul fiecărui jucător.

Kodari can make mistakes. Review important code before using.
Files
client-mod
src
build.gradle
settings.gradle
Code
14 922
src/main/java/com/kodari/serverpanel/ServerPanelPlugin.java
package com.kodari.serverpanel;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.math.BigDecimal;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class ServerPanelPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private final Map<UUID, UUID> customPaymentTargets = new ConcurrentHashMap<>();
    private PanelManager panelManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        panelManager = new PanelManager(this);
        Bukkit.getPluginManager().registerEvents(this, this);
        if (getCommand("panel") != null) {
            getCommand("panel").setExecutor(this);
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Această comandă poate fi folosită doar de un jucător.");
            return true;
        }
        Player player = (Player) sender;
        if (!player.hasPermission("serverpanel.use")) {
            player.sendMessage(message("no-permission"));
            return true;
        }
        panelManager.openMain(player);
        return true;
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (!(event.getWhoClicked() instanceof Player)) {
            return;
        }
        if (!(event.getInventory().getHolder() instanceof PanelHolder)) {
            return;
        }
        if (event.getRawSlot() >= event.getView().getTopInventory().getSize()) {
            return;
        }
        event.setCancelled(true);
        panelManager.handleClick((Player) event.getWhoClicked(), event);
    }

    @EventHandler
    public void onCustomPaymentChat(AsyncPlayerChatEvent event) {
        UUID targetId = customPaymentTargets.remove(event.getPlayer().getUniqueId());
        if (targetId == null) {
            return;
        }
        event.setCancelled(true);
        String input = event.getMessage().trim();
        if (input.equalsIgnoreCase("cancel")) {
            event.getPlayer().sendMessage(message("payment-cancelled"));
            return;
        }
        BigDecimal amount;
        try {
            amount = new BigDecimal(input);
        } catch (NumberFormatException exception) {
            event.getPlayer().sendMessage(message("invalid-amount"));
            return;
        }
        if (amount.signum() <= 0) {
            event.getPlayer().sendMessage(message("invalid-amount"));
            return;
        }
        String formattedAmount = amount.stripTrailingZeros().toPlainString();
        Bukkit.getScheduler().runTask(this, () -> {
            Player target = Bukkit.getPlayer(targetId);
            if (target == null) {
                event.getPlayer().sendMessage(message("payment-target-offline"));
                return;
            }
            panelManager.executePay(event.getPlayer(), target.getName(), formattedAmount);
        });
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        customPaymentTargets.remove(event.getPlayer().getUniqueId());
    }

    public void beginCustomPayment(Player player, UUID target) {
        customPaymentTargets.put(player.getUniqueId(), target);
    }

    public String message(String path) {
        String message = getConfig().getString("messages." + path, "");
        return ChatColor.translateAlternateColorCodes('&', message);
    }
}