crwdns132241:0crwdne132241:0

crwdns132243:0:javadoc:crwdnd132243:0:javadoc:crwdne132243:0

crwdns132245:0crwdne132245:0

crwdns132247:0:javadoc:crwdne132247:0

import org.spongepowered.api.item.ItemType;
import org.spongepowered.api.item.ItemTypes;
import org.spongepowered.api.item.inventory.ItemStack;

public boolean isStick(ItemStack stack) {
    ItemType type = stack.getItem();
    return type.equals(ItemTypes.STICK);
}

crwdns132249:0crwdne132249:0

crwdns132251:0:javadoc:crwdne132251:0

crwdns132253:0crwdne132253:0

crwdns132255:0crwdne132255:0

import org.spongepowered.api.data.key.Keys;

public void setUnbreakable(ItemStack stack) {
    stack.offer(Keys.UNBREAKABLE, true);
}

crwdns132257:0:javadoc:crwdne132257:0

crwdns132259:0:javadoc:crwdne132259:0

import org.spongepowered.api.text.Text;

import java.util.List;

public void setLore(ItemStack stack, List<Text> itemLore) {
    if (stack.get(Keys.ITEM_LORE).isPresent()) {
        stack.offer(Keys.ITEM_LORE, itemLore);
    }
}

crwdns132261:0crwdne132261:0

crwdns132263:0:javadoc:crwdne132263:0

import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.data.property.item.HarvestingProperty;

import java.util.Optional;

public boolean canMineObsidian(ItemStack stack) {
    Optional<HarvestingProperty> optional =
        stack.getProperty(HarvestingProperty.class);

    if (optional.isPresent()) {
        HarvestingProperty property = optional.get();
        return property.getValue().contains(BlockTypes.OBSIDIAN);
    }
    return false;
}

crwdns132265:0crwdne132265:0

crwdns132267:0crwdne132267:0

crwdns132269:0:javadoc:crwdnd132269:0:javadoc:crwdne132269:0

public boolean isEqual(ItemStack stack1, ItemStack stack2) {
    return stack1.equalTo(stack2);
}