Vai al contenuto
Il server del mese è
Visita la nostra nuova lista server!

Archiviato

Questa discussione è archiviata e chiusa a future risposte.

EnryX72

CERCO PLUGINNER / AIUTO PLUGIN

Recommended Posts

Ciao, sul mio server uso il plugin FixIt che mi permette di riparare gli oggetti come spada e armatura, ma essendo che il plugin è vecchio e non funziona con la netherite, qualcuno può essere così gentile da ricrearlo che funzioni anche per la netherite? Grazie mille e grazie infinite a tutti

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Scrivo qui sotto i comandi di uno dei file (penso il princiapale del plugin)

 

 

 

 

 

 

package jellybeanprince;

import org.bukkit.plugin.java.*;
import java.util.logging.*;
import org.bukkit.entity.*;
import java.io.*;
import org.bukkit.command.*;
import org.bukkit.plugin.*;
import java.util.*;
import org.bukkit.*;
import org.bukkit.inventory.*;
import org.bukkit.block.*;

public class Repair extends JavaPlugin
{
    public static final Logger log;
    ArrayList<Player> cooldown;
    
    static {
        log = Logger.getLogger("Minecraft");
    }
    
    public Repair() {
        this.cooldown = new ArrayList<Player>();
    }
    
    public void onEnable() {
        Repair.log.info("[FixIt] FixIt has been enabled!");
        if (!new File(this.getDataFolder(), "config.yml").exists()) {
            this.saveDefaultConfig();
        }
    }
    
    public void onDisable() {
        Repair.log.info("[FixIt] FixIt has been disabled.");
        this.saveConfig();
    }
    
    public boolean onCommand(final CommandSender player, final Command cmd, final String Label, final String[] args) {
        if (Label.equalsIgnoreCase("fix")) {
            if (!(player instanceof Player)) {
                player.sendMessage(ChatColor.RED + "This command can only be run by a player.");
            }
            else if (player instanceof Player) {
                final Player p = (Player)player;
                if (player.hasPermission("fixit.fix")) {
                    if (this.cooldown.contains(p)) {
                        player.sendMessage(ChatColor.RED + "This command is on cooldown.");
                    }
                    else {
                        final Player sender = (Player)player;
                        final ItemStack berepaired = sender.getItemInHand();
                        if (this.itemCheck(berepaired)) {
                            berepaired.setDurability((short)(berepaired.getType().getMaxDurability() - berepaired.getType().getMaxDurability()));
                            sender.sendMessage(ChatColor.GOLD + "You have repaired an item!");
                            if (this.getConfig().getBoolean("cd")) {
                                this.cooldown.add(p);
                                Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin)this, (Runnable)new Runnable() {
                                    @Override
                                    public void run() {
                                        Repair.this.cooldown.remove(p);
                                    }
                                }, this.getConfig().getLong("cooldown") * 20L);
                            }
                        }
                        else {
                            sender.sendMessage(ChatColor.RED + "This item cannot be repaired.");
                        }
                    }
                }
                else {
                    player.sendMessage(ChatColor.RED + "You do not have permission.");
                }
            }
        }
        else if (Label.equalsIgnoreCase("fixall")) {
            if (player instanceof Player) {
                if (player.hasPermission("fixit.fixall")) {
                    if (this.cooldown.contains(player)) {
                        player.sendMessage(ChatColor.RED + "This command is on cooldown.");
                    }
                    else {
                        final Player p = (Player)player;
                        this.repair(p);
                        ItemStack[] arrayOfItemStack;
                        for (int localItemStack1 = (arrayOfItemStack = p.getInventory().getArmorContents()).length, ix = 0; ix < localItemStack1; ++ix) {
                            final ItemStack i = arrayOfItemStack[ix];
                            this.repair(i);
                        }
                        if (this.getConfig().getBoolean("cd")) {
                            this.cooldown.add(p);
                            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin)this, (Runnable)new Runnable() {
                                @Override
                                public void run() {
                                    Repair.this.cooldown.remove(p);
                                }
                            }, this.getConfig().getLong("cooldown") * 20L);
                        }
                    }
                }
                else {
                    player.sendMessage(ChatColor.RED + "You do not have permission.");
                }
            }
            else {
                player.sendMessage("You cannot do that.");
            }
        }
        else if (Label.equalsIgnoreCase("fixplayer")) {
            if (player instanceof Player) {
                final Player p = (Player)player;
                if (player.hasPermission("fixit.fixplayer")) {
                    if (this.cooldown.contains(p)) {
                        player.sendMessage(ChatColor.RED + "This command is on cooldown.");
                    }
                    else if (args.length == 0) {
                        p.sendMessage(ChatColor.RED + "Who's inventory would you like to fix?");
                    }
                    else if (args.length == 1 && p.getServer().getPlayer(args[0]) != null) {
                        final Player t = p.getServer().getPlayer(args[0]);
                        this.repair(t);
                        t.sendMessage(ChatColor.GOLD + "Your inventory has been fixed by " + p.getName() + ".");
                        p.sendMessage(ChatColor.GOLD + "You have fixed " + t.getName() + "'s inventory.");
                        if (this.getConfig().getBoolean("cd")) {
                            this.cooldown.add(p);
                            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin)this, (Runnable)new Runnable() {
                                @Override
                                public void run() {
                                    Repair.this.cooldown.remove(p);
                                }
                            }, this.getConfig().getLong("cooldown") * 20L);
                        }
                    }
                }
                else {
                    player.sendMessage(ChatColor.RED + "You don't have permission!");
                }
            }
        }
        else if (Label.equalsIgnoreCase("fixchest")) {
            final Player p = (Player)player;
            if (this.cooldown.contains(p)) {
                p.sendMessage(ChatColor.RED + "This command is on cooldown.");
            }
            else if (p.hasPermission("fixit.fixchest")) {
                final Block b = p.getTargetBlock((HashSet)null, 5);
                if (b.getType() == Material.CHEST || b.getType() == Material.TRAPPED_CHEST) {
                    final Chest c = (Chest)b.getState();
                    if (this.getConfig().getBoolean("cd")) {
                        this.cooldown.add(p);
                        Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin)this, (Runnable)new Runnable() {
                            @Override
                            public void run() {
                                Repair.this.cooldown.remove(player);
                            }
                        }, this.getConfig().getLong("cooldown") * 20L);
                    }
                    if (c.getInventory().getSize() == 54) {
                        for (int j = 0; j <= 54; ++j) {
                            try {
                                final ItemStack w = c.getInventory().getItem(j);
                                if (this.itemCheck(w)) {
                                    c.getInventory().getItem(j).setDurability((short)(w.getType().getMaxDurability() - w.getType().getMaxDurability()));
                                }
                            }
                            catch (Exception ex) {}
                        }
                    }
                    else {
                        for (int j = 0; j <= 27; ++j) {
                            try {
                                p.sendMessage(ChatColor.GOLD + "You have fixed all the items in this chest!");
                                final ItemStack w = c.getInventory().getItem(j);
                                if (this.itemCheck(w)) {
                                    c.getInventory().getItem(j).setDurability((short)(w.getType().getMaxDurability() - w.getType().getMaxDurability()));
                                }
                            }
                            catch (Exception ex2) {}
                        }
                    }
                }
                else {
                    p.sendMessage(ChatColor.RED + "This block isn't a chest.");
                }
            }
            else {
                player.sendMessage(ChatColor.RED + "You don't have permission!");
            }
        }
        else if (Label.equalsIgnoreCase("fixconfig")) {
            if (player instanceof Player && player.hasPermission("fixit.config") && args.length == 0) {
                Bukkit.broadcastMessage(ChatColor.GREEN + "Attempting to save and reload...");
                try {
                    this.saveConfig();
                    Bukkit.reload();
                    player.sendMessage(ChatColor.GREEN + "Complete!");
                }
                catch (Exception exc) {
                    player.sendMessage(ChatColor.RED + "Failure! Stack trace has been printed to console.");
                    Repair.log.warning("Stack trace from FixIt:" + exc.getStackTrace());
                }
            }
        }
        else if (Label.equalsIgnoreCase("fixcd") && player instanceof Player && player.hasPermission("fixit.config") && args.length == 1) {
            final Integer k = Integer.valueOf(args[0]);
            this.getConfig().set("cooldown", (Object)k);
            player.sendMessage(ChatColor.GREEN + "Cooldown has been set to " + String.valueOf(k));
        }
        return false;
    }
    
    private void repair(final ItemStack i) {
        try {
            if (this.itemCheck(i)) {
                i.setDurability((short)0);
            }
        }
        catch (Exception ex) {}
    }
    
    public void repair(final Player p) {
        for (int i = 0; i <= 36; ++i) {
            try {
                final ItemStack w = p.getInventory().getItem(i);
                if (this.itemCheck(w)) {
                    p.getInventory().getItem(i).setDurability((short)0);
                }
            }
            catch (Exception ex) {}
        }
    }
    
    private boolean itemCheck(final ItemStack w) {
        return w.getType().getId() == 256 || w.getType().getId() == 257 || w.getType().getId() == 258 || w.getType().getId() == 259 || w.getType().getId() == 261 || w.getType().getId() == 267 || w.getType().getId() == 268 || w.getType().getId() == 269 || w.getType().getId() == 270 || w.getType().getId() == 271 || w.getType().getId() == 272 || w.getType().getId() == 273 || w.getType().getId() == 274 || w.getType().getId() == 275 || w.getType().getId() == 276 || w.getType().getId() == 277 || w.getType().getId() == 278 || w.getType().getId() == 279 || w.getType().getId() == 283 || w.getType().getId() == 284 || w.getType().getId() == 285 || w.getType().getId() == 286 || w.getType().getId() == 290 || w.getType().getId() == 291 || w.getType().getId() == 292 || w.getType().getId() == 293 || w.getType().getId() == 294 || w.getType().getId() == 298 || w.getType().getId() == 299 || w.getType().getId() == 300 || w.getType().getId() == 301 || w.getType().getId() == 302 || w.getType().getId() == 303 || w.getType().getId() == 304 || w.getType().getId() == 305 || w.getType().getId() == 306 || w.getType().getId() == 307 || w.getType().getId() == 308 || w.getType().getId() == 309 || w.getType().getId() == 310 || w.getType().getId() == 311 || w.getType().getId() == 312 || w.getType().getId() == 313 || w.getType().getId() == 314 || w.getType().getId() == 315 || w.getType().getId() == 316 || w.getType().getId() == 317 || w.getType().getId() == 346 || w.getType().getId() == 359;
    }
}

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Ciao, contattami su telegram @ImReaches posso ricreare il plugin in una versione più recente

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

  • Chi sta navigando   0 utenti

    Nessun utente registrato visualizza questa pagina.


  • Contenuti simili

    • Da Gamgee
      Salve, fa nostalgia scrivere qui.
      Siamo in 4 amici, abbiamo aperto, come da titolo un server privato 1.19.3 survival vanilla. 
      Il nostro obbiettivo è divertirci, siamo ragazzi di 20/30 anni, cerchiamo qualche compagno di avventura digitale.
      Scrivetemi qui sotto o in privato.
      Farm automatiche, belle builds, ecc...
      Tutto condiviso!
       
    • Da ninjadellanotte
      Salve, cerco una mod per vedere le basi sotterranee dei player qualcuno ne sa qualcosa ??
    • Da DeltaForce07
      ho bisogno a solutamente un plugin per vendere gli oggetti della pixelmon e ottenere i pokedollari qualcuno sa il nome?
       
    • Da NickITAiz
      ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇
                     Ciao a tutti!
      ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇
      Cerco staff per il mio nuovo server in costuzione:
      Il server è una modalità real life
      Dove i player potranno acquistare case appartamenti e auto.
      □ oltre 500 items senza mod
      □100 tipi di auto moto bici elicotteri, aerei ecc!
      □Sistema crates innovativo e personalizzato, oltre 15 crate in costruzione.
      《》《》《》《》《》《》《》
      Cerco player con una buona creatività e immaginazione.
      Bravi nel buildare o anche pluginner!
      Serietà e un po di tempo libero al giorno.
       
      Scrivetemi su telegram : NickITAiz
      Non è detto che esca {telegram}
      O discord: NickITAiz:2865
       
       dove vi manderò l ip e vi mosterò la mia idea. Se vi piacerà verrete messi in prova
       
      》15+《 minecraft 1.19.2 java
    • Da Faddy
      Ciao, qualche giorno fa ho creato un server aternos survival e vorrei sapere se c'è qualcuno interessato a giocare.(si può entrare anche da bedrock edition)(per ip e porta del server scrivetemi in privato e mamdatemi il vostro nome di Minecraft)
×
×
  • Crea Nuovo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.