Add TutorialCommand #1

Zusammengeführt
Lixfel hat 2 Commits von TutorialRate nach master 2022-03-22 11:03:09 +01:00 zusammengeführt
3 geänderte Dateien mit 26 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.tutorial;
import de.steamwar.tutorial.commands.TutorialCommand;
import de.steamwar.tutorial.listener.Joining;
import de.steamwar.tutorial.listener.RateSign;
import org.bukkit.plugin.java.JavaPlugin;
@ -36,6 +37,8 @@ public class TutorialSystem extends JavaPlugin {
public void onEnable() {
new RateSign();
new Joining();
new TutorialCommand();
}
public static TutorialSystem getPlugin() {

Datei anzeigen

@ -0,0 +1,21 @@
package de.steamwar.tutorial.commands;
import de.steamwar.command.SWCommand;
import de.steamwar.comms.packets.ExecuteCommandPacket;
import org.bukkit.entity.Player;
public class TutorialCommand extends SWCommand {
public TutorialCommand() {
super("tutorial");
}
@Register("rate")
public void rateCommand(Player player) {
rate(player);
}
public static void rate(Player player) {
new ExecuteCommandPacket(player, "tutorial rate " + System.getProperty("tutorial")).send(player);
}
}

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.tutorial.listener;
import de.steamwar.comms.packets.ExecuteCommandPacket;
import de.steamwar.tutorial.commands.TutorialCommand;
import org.bukkit.block.BlockState;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
@ -43,6 +43,6 @@ public class RateSign extends BasicListener {
return;
Player player = event.getPlayer();
new ExecuteCommandPacket(player, "tutorial rate " + System.getProperty("tutorial")).send(player);
TutorialCommand.rate(player);
}
}