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
    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);
    }
}
