Java Code Examples for cn.nukkit.item.Item#equalsExact()

The following examples show how to use cn.nukkit.item.Item#equalsExact() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EnchantInputAction.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean isValid(Player source) {
    Item check = inventory.getItem(0);

    return check.equalsExact(this.sourceItem);
}
 
Example 2
Source File: AnvilInputAction.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean isValid(Player source) {
    Item check = inventory.getItem(0);
    return check.equalsExact(this.sourceItem);
}
 
Example 3
Source File: AnvilMaterialAction.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean isValid(Player source) {
    Item check = inventory.getItem(1);
    return check.equalsExact(this.sourceItem);
}
 
Example 4
Source File: EnchantMaterialAction.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean isValid(Player source) {
    Item check = inventory.getItem(1);
    return check.equalsExact(this.sourceItem);
}
 
Example 5
Source File: SlotChangeAction.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Checks if the item in the inventory at the specified inventorySlot is the same as this action's source item.
 */
public boolean isValid(Player source) {
    Item check = inventory.getItem(this.inventorySlot);

    return check.equalsExact(this.sourceItem);
}
 
Example 6
Source File: SlotChangeAction.java    From Nukkit with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Checks if the item in the inventory at the specified inventorySlot is the same as this action's source item.
 *
 * @param source player
 * @return valid
 */
public boolean isValid(Player source) {
    Item check = inventory.getItem(this.inventorySlot);

    return check.equalsExact(this.sourceItem);
}