crwdns151565:0crwdne151565:0
crwdns151567:0:javadoc:crwdnd151567:0:javadoc:crwdne151567:0
crwdns151569:0crwdne151569:0
crwdns151571:0:javadoc:crwdne151571: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);
}
crwdns151573:0crwdne151573:0
crwdns151575:0:javadoc:crwdne151575:0
crwdns151577:0crwdne151577:0
crwdns151579:0crwdne151579:0
import org.spongepowered.api.data.key.Keys;
public void setUnbreakable(ItemStack stack) {
stack.offer(Keys.UNBREAKABLE, true);
}
crwdns151581:0:javadoc:crwdne151581:0
crwdns151583:0:javadoc:crwdne151583: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);
}
}
crwdns151585:0crwdne151585:0
crwdns151587:0:javadoc:crwdne151587: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;
}
crwdns151589:0crwdne151589:0
crwdns151591:0crwdne151591:0
crwdns151593:0:javadoc:crwdnd151593:0:javadoc:crwdne151593:0
public boolean isEqual(ItemStack stack1, ItemStack stack2) {
return stack1.equalTo(stack2);
}