Skocz do zawartości

4RNI

Użytkownik
  • Ilość zawartości

    59
  • Rejestracja

  • Ostatnia wizyta

3 obserwujących

Informacje

  • Płeć
    Mężczyzna
  • Nick w MC
    4RNI1337

Ostatnie wizyty

1 760 wyświetleń profilu

Osiągnięcia 4RNI

  1. 4RNI

    Crashery mc

    jakie metody platnosci?
  2. Gdy gracz wpisuje komendę /spawn i po chwili jeszcze raz tą samą komendę, wyskakuje wiadomość o treści tej co jest przy ruszeniu się oraz nie teleportuje na spawn (tak jakby anuluje komendę). Mógłby mi ktoś to poprawić? Kod komendy /spawn: TimerManager: TimerUtil: TimeUtil: TimerCallback:
  3. 4RNI

    Poprawa kodu

    Witam moglby mi ktos poprawic ten kod, poniewaz dzieje sie cos takiego: Błąd 1: Multiple markers at this line - The type new TimerCallback(){} must implement the inherited abstract method TimerCallback.success(Object) - The type new TimerCallback(){} must implement the inherited abstract method TimerCallback.error(Object) - Type safety: The expression of type new TimerCallback(){} needs unchecked conversion to conform to TimerCallback<Player> Błąd 2: The method teleport(Location) in the type Entity is not applicable for the arguments (TimerUtil) TimerManager: https://pastebin.com/tKgUw6Bq TimerCallback: https://pastebin.com/aQLdgDsn
  4. 4RNI

    Problem z pluginem

    Witam po wpisaniu komendy wyskakuje mi blad "An internal error occured while attempting to perform this command", zamiast wiadomosci z klasy Lang. Co zrobic? Kod pluginu: package pl.unixhc.tools.commands; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import pl.unixhc.tools.config.Lang; import pl.unixhc.tools.managers.CommandManager; import pl.unixhc.tools.utils.Util; public class InvseeCommand extends CommandManager{ public InvseeCommand(){ super("invsee", true, "unixhc.invsee", "Otwiera ekwipunek gracza", "/invsee [nick]", new String[0]); } public boolean exe(CommandSender sender, String command, String[] args){ if (args.length < 1){ Util.sendUsage(sender, getUsage()); return false; } Player playerInv = Bukkit.getPlayer(args[0]); if (playerInv == null){ sender.sendMessage(Lang.getInst().PLAYER_NOT_EXISTS); return false; } Player player = (Player)sender; player.openInventory(playerInv.getInventory()); return true; } } Main: package pl.unixhc.tools; import org.bukkit.Bukkit; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import pl.unixhc.tools.commands.*; import pl.unixhc.tools.listeners.*; public class Main extends JavaPlugin{ private static Main inst; public void onEnable(){ registerCommands(); registerListeners(); saveDefaultConfig(); } public static Main getInst(){ return inst; } public void registerCommands(){ new InvseeCommand().register(); } public void registerListeners(){ PluginManager pm = Bukkit.getPluginManager(); pm.registerEvents(new ProtectPluginsListener(), this); pm.registerEvents(new AsyncPlayerChatListener(), this);; pm.registerEvents(new BlockPlaceListener(), this); pm.registerEvents(new SignColorListener(), this); } } Lang: package pl.unixhc.tools.config; public class Lang{ private static Lang inst; public String USAGE; public String PERMISSION; public String PLAYER_NOT_EXISTS; public String INVENTORY_OPENED; public String COMMAND_PLAYER; public static Lang getInst(){ if(inst == null){ new Lang(); } return inst; } public Lang(){ this.PERMISSION = "&4Nie masz uprawnien."; this.PLAYER_NOT_EXISTS = "&4Ten gracz jest offline."; this.INVENTORY_OPENED = "&aOtworzono ekwipunek gracza {PLAYER}"; this.USAGE = "&cPoprawne uzycie: {USAGE}."; this.COMMAND_PLAYER = "&4Ta komenda jest dostepna tylko dla gracza."; } } Util: package pl.unixhc.tools.utils; import org.bukkit.command.CommandSender; import pl.unixhc.tools.config.Lang; public class Util { public static boolean sendMessage(CommandSender sender, String message) { sender.sendMessage(message); return true; } public static boolean sendPermission(CommandSender sender, String permission) { sender.sendMessage(Lang.getInst().PERMISSION.replace("{PERM}", permission)); return true; } public static boolean sendUsage(CommandSender sender, String usage) { sender.sendMessage(Lang.getInst().USAGE.replace("{USAGE}", usage)); return true; } } CommandManager: package pl.unixhc.tools.managers; import java.lang.reflect.Field; import java.util.Arrays; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.command.CommandMap; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import pl.unixhc.tools.config.Lang; import pl.unixhc.tools.utils.Util; public abstract class CommandManager extends org.bukkit.command.Command { private String name; private String description; private String usage; private String permission; private List<String> aliases; private boolean player; public CommandManager(String name, boolean player, String permission, String description, String usage, String... aliases) { super(name, description, usage, Arrays.asList(aliases)); this.name = name; this.description = description; this.usage = usage; this.permission = permission; this.aliases = Arrays.asList(aliases); this.player = player; } public boolean execute(CommandSender sender, String command, String[] args) { if ((isPlayer()) && (!(sender instanceof Player))) { return Util.sendMessage(sender, Lang.getInst().COMMAND_PLAYER); } if ((getPermission() != null) && (!sender.hasPermission(getPermission()))) { return Util.sendPermission(sender, getPermission()); } return exe(sender, command, args); } public abstract boolean exe(CommandSender paramCommandSender, String paramString, String[] paramArrayOfString); public String getName() { return this.name; } public String getDescription() { return this.description; } public String getUsage() { return this.usage; } public String getPermission() { return this.permission; } public List<String> getAliases() { return this.aliases; } public boolean isPlayer() { return this.player; } public CommandManager setDescription(String description) { this.description = description; return this; } public CommandManager setUsage(String usage) { this.usage = usage; return this; } public void setPermission(String permission) { this.permission = permission; } public CommandManager setAliases(List<String> aliases) { this.aliases = aliases; return this; } public void setPlayer(boolean player) { this.player = player; } public void register() { try { if (getName() == null) { return; } Field f = Bukkit.getServer().getClass().getDeclaredField("commandMap"); f.setAccessible(true); CommandMap cmap = (CommandMap)f.get(Bukkit.getServer()); cmap.register(getName(), this); } catch (Exception e) { e.printStackTrace(); } } public boolean onExecute(CommandSender sender, String[] args) { return false; } } Log z konsoli: null org.bukkit.command.CommandException: Unhandled exception executing 'invsee' in pl.unixhc.tools.commands.InvseeCommand(invsee) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148) ~[Silnik.jar:git-Spigot-db6de12-18fbb24] at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [Silnik.jar:git-Spigot-db6de12-18fbb24] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_161] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_161] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [Silnik.jar:git-Spigot-db6de12-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [Silnik.jar:git-Spigot-db6de12-18fbb24] at java.lang.Thread.run(Unknown Source) [?:1.8.0_161] Caused by: java.lang.NullPointerException at pl.unixhc.tools.utils.Util.sendPermission(Util.java:20) ~[?:?] at pl.unixhc.tools.managers.CommandManager.execute(CommandManager.java:41) ~[?:?] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[Silnik.jar:git-Spigot-db6de12-18fbb24] ... 14 more
  5. Witam, chcialbym dodac jeszcze mozliwosc rozdania case graczowi uzywajac komendy /case <basic/premium> <nick> <ilosc> lecz niestety nie wiem jak to zrobic, probowalem i mi nie wychodzilo Moglby ktos napisac mi kod? package pl.unixhc.tools.commands; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import pl.unixhc.tools.Main; import pl.unixhc.tools.utils.ChatUtil; import pl.unixhc.tools.utils.ItemBuilder; public class CaseCommand implements CommandExecutor{ Main plugin; public CaseCommand(Main plugin){ this.plugin = plugin; this.plugin.getCommand("case").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){ if(!sender.hasPermission("unixhc.tools.case")){ sender.sendMessage(ChatUtil.fixColor("&4Nie masz uprawnien.")); return false; } if(args.length != 3){ sender.sendMessage(ChatUtil.fixColor("&8>> &cPoprawne uzycie: /case <basic/premium> <all/nick> <ilosc>.")); return false; } if(args[1].equalsIgnoreCase("all")){ int i = Integer.parseInt(args[2]); if(i <= 0){ sender.sendMessage(ChatUtil.fixColor("&8>> &cNie mozesz dac 0 lub mniej skrzynek!")); return false; } if(args[0].equalsIgnoreCase("basic")){ ItemStack item = new ItemBuilder(Material.CHEST, i).setName(ChatUtil.fixColor("&8[&9Basic Case&8]")).toItemStack(); for(Player p : Bukkit.getOnlinePlayers()){ p.getInventory().addItem(item); Bukkit.broadcastMessage(ChatUtil.fixColor("&8{O} &7Administrator &a" + sender.getName() + " &7rozdal Basic Case (&f" + i + "&7)")); return true; } } if(args[0].equalsIgnoreCase("premium")){ ItemStack item = new ItemBuilder(Material.CHEST, i).setName(ChatUtil.fixColor("&8[&cPremium case&8]")).toItemStack(); for(Player p : Bukkit.getOnlinePlayers()){ p.getInventory().addItem(item); Bukkit.broadcastMessage(ChatUtil.fixColor("&8{O} &7Administrator &a" + sender.getName() + " &7rozdal Premium Case (&f" + i + "&7)")); return true; } } } return false; } } Tytuł //xVen
  6. do zamkniecia

  7. Komenda /uhc po wpisaniu takiej komendy automatycznie po 10 minutach odpala się pvp na serwerze oraz 2 efekty na 5 minut odpornosc na ogien i niewidzialność. Daje PLUSA! 

  8. 4RNI

    Komenda nie dziala

    Napisalem ze tak.
  9. 4RNI

    Komenda nie dziala

    Witam po wpisaniu komendy /ts3 nic sie nie dzieje (zadnych logow w konsoli). Od razu mowie ze nie jest to przez config. Kod: package pl.unixhc.tools.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import pl.unixhc.tools.Main; import pl.unixhc.tools.utils.ChatUtil; public class Ts3Command implements CommandExecutor{ Main plugin; public Ts3Command(Main plugin){ this.plugin = plugin; this.plugin.getCommand("ts3").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmnd, String string, String[] args){ for(String ts3 : this.plugin.getConfig().getStringList("Ts3Info")){ sender.sendMessage(ChatUtil.fixColor(ts3)); return true; } return false; } } Main: package pl.unixhc.tools; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import pl.unixhc.tools.commands.*; public class Main extends JavaPlugin implements Listener{ Ts3Command ts3; public void onEnable(){ saveDefaultConfig(); this.ts3 = new Ts3Command(this); } } Komenda jest zarejestrowana w plugin.yml.
  10. 4RNI

    Blad

    Problem rozwiazany ;p
  11. 4RNI

    Blad

    Witam po wpisaniu komendy wyskakuje mi blad. Komende zarejestrowalem w Main i plugin.yml. package pl.unixhc.tools.commands; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import pl.unixhc.tools.Main; public class TeleportAllCommand implements CommandExecutor{ Main plugin; public TeleportAllCommand(Main plugin){ this.plugin = plugin; this.plugin.getCommand("tpall").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmd, String lab, String[] args){ if(!(sender instanceof Player)){ sender.sendMessage(this.plugin.getConfig().getString("Ogolne.WiadomoscKonsola").replace('&', '§')); return false; } if (!(sender.hasPermission(this.plugin.getConfig().getString("TeleportAll.Uprawnienie")))){ sender.sendMessage(this.plugin.getConfig().getString("Ogolne.WiadomoscBrakUprawnien").replace('&', '§')); return false; } Player admin = (Player)sender; for (Player gracze : Bukkit.getOnlinePlayers()){ gracze.teleport(admin.getLocation()); sender.sendMessage(this.plugin.getConfig().getString("TeleportAll.WiadomoscPrzeteleportowano").replace('&', '§')); return true; } return false; } }
  12. Temat do zamknięcia

    1. xVendrome
    2. xVendrome

      xVendrome

      Nie dał plusa oszukista :dealkappa:

    3. TheSzebaXD

      TheSzebaXD

      Chodzi mi bez SkQuery. Slyszałem,że sie da przez WildSkript

  13. 4RNI

    Config v2 :D

    @GotoFinal tam gdzie chcialem aby bylo puste miejsce po prostu nie ma tej linijki
×
×
  • Dodaj nową pozycję...