Add BookReplaceCommand #2
@ -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() {
|
||||
|
21
src/de/steamwar/tutorial/commands/UnsignCommand.java
Normale Datei
21
src/de/steamwar/tutorial/commands/UnsignCommand.java
Normale Datei
@ -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);
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren