Skocz do zawartości
  • 0

Co zrobiłem źle?


kapi.

Pytanie

package com.earth2me.essentials.commands;

import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.I18n;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.Server;

public class Commandhelpop extends EssentialsCommand
{
  public Commandhelpop()
  {
     super("helpop");
  }
  
  public void run(Server server, User user, String commandLabel, String[] args)
    throws Exception
  {
     user.setDisplayNick();
     String message = sendMessage(user.getSource(), user.getDisplayName(), args);
     if (!user.isAuthorized("esej.helpop.receive"))
    {
       user.sendMessage(message);
    }
  }
  
  public void run(Server server, CommandSource sender, String commandLabel, String[] args)
    throws Exception
  {
     sendMessage(server, sender, "ROOT", args);
  }
  
  private String sendMessage(Server server, CommandSource sender, String from, String[] args) throws Exception
  {
     if (args.length < 1)
    {
       throw new NotEnoughArgumentsException();
    }
     String message = I18n.tl("helpOp", new Object[] { from, FormatUtil.stripFormat(getFinalArg(args, 0)) });
     server.getLogger().log(Level.INFO, message);
     this.ess.broadcastMessage("esej.helpop.receive", message);
     return message;
  }
}

Póki co na razie wzoruję się na innych pluginach edytuje itp... lecz coś mi tu nie chce działać pomoże ktoś?

@Wizzard? @KrejzolekPRO

Odnośnik do komentarza
https://skript.pl/temat/20686-co-zrobi%C5%82em-%C5%BAle/
Udostępnij na innych stronach

6 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 2
1 minutę temu, esej napisał:

package com.earth2me.essentials.commands;

import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.I18n;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.Server;

public class Commandhelpop extends EssentialsCommand
{
  public Commandhelpop()
  {
     super("helpop");
  }
  
  public void run(Server server, User user, String commandLabel, String[] args)
    throws Exception
  {
     user.setDisplayNick();
     String message = sendMessage(user.getSource(), user.getDisplayName(), args);
     if (!user.isAuthorized("esej.helpop.receive"))
    {
       user.sendMessage(message);
    }
  }
  
  public void run(Server server, CommandSource sender, String commandLabel, String[] args)
    throws Exception
  {
     sendMessage(server, sender, "ROOT", args);
  }
  
  private String sendMessage(Server server, CommandSource sender, String from, String[] args) throws Exception
  {
     if (args.length < 1)
    {
       throw new NotEnoughArgumentsException();
    }
     String message = I18n.tl("helpOp", new Object[] { from, FormatUtil.stripFormat(getFinalArg(args, 0)) });
     server.getLogger().log(Level.INFO, message);
     this.ess.broadcastMessage("esej.helpop.receive", message);
     return message;
  }
}

Póki co na razie wzoruję się na innych pluginach edytuje itp... lecz coś mi tu nie chce działać pomoże ktoś?

@Wizzard? @KrejzolekPRO

Robisz wielki błąd. Nie znasz podstaw a bierzesz się za takie coś... Pooglądaj pierwsze odcinki Kamilkime, a potem analizuj łatwiejsze pluginy.

Odnośnik do komentarza
https://skript.pl/temat/20686-co-zrobi%C5%82em-%C5%BAle/#findComment-140581
Udostępnij na innych stronach

  • 0
Teraz, KrejzolekPRO napisał:

Robisz wielki błąd. Nie znasz podstaw a bierzesz się za takie coś... Pooglądaj pierwsze odcinki Kamilkime, a potem analizuj łatwiejsze pluginy.

Ale jaki błąd w kodzie mam to było moim pytaniem.

Odnośnik do komentarza
https://skript.pl/temat/20686-co-zrobi%C5%82em-%C5%BAle/#findComment-140582
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...