13
0

Add UnsignCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-22 17:26:51 +01:00
Ursprung 8fff4fb7dd
Commit 9cd5671629
2 geänderte Dateien mit 23 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.tutorial;
import de.steamwar.tutorial.commands.BookReplaceCommand;
import de.steamwar.tutorial.commands.TutorialCommand;
import de.steamwar.tutorial.commands.UnsignCommand;
import de.steamwar.tutorial.listener.Joining;
import de.steamwar.tutorial.listener.RateSign;
import org.bukkit.plugin.java.JavaPlugin;
@ -41,6 +42,7 @@ public class TutorialSystem extends JavaPlugin {
new BookReplaceCommand();
new TutorialCommand();
new UnsignCommand();
}
public static TutorialSystem getPlugin() {

Datei anzeigen

@ -0,0 +1,21 @@
package de.steamwar.tutorial.commands;
import de.steamwar.command.SWCommand;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class UnsignCommand extends SWCommand {
public UnsignCommand() {
super("unsign");
}
@Register(description = "UNSIGN_HELP")
public void unsignCommand(Player p) {
ItemStack itemStack = p.getInventory().getItemInMainHand();
if (itemStack.getType() != Material.WRITTEN_BOOK) return;
itemStack.setType(Material.WRITABLE_BOOK);
p.getInventory().setItemInMainHand(itemStack);
}
}