diff --git a/src/de/steamwar/tutorial/TutorialSystem.java b/src/de/steamwar/tutorial/TutorialSystem.java index a348818..a261375 100644 --- a/src/de/steamwar/tutorial/TutorialSystem.java +++ b/src/de/steamwar/tutorial/TutorialSystem.java @@ -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() { diff --git a/src/de/steamwar/tutorial/commands/UnsignCommand.java b/src/de/steamwar/tutorial/commands/UnsignCommand.java new file mode 100644 index 0000000..799cdd9 --- /dev/null +++ b/src/de/steamwar/tutorial/commands/UnsignCommand.java @@ -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); + } +}