Merge pull request #40 from peacefulfarms/master
Cancel gift command if partner's inventory is full
This commit is contained in:
commit
814827beaa
|
@ -36,6 +36,11 @@ public class CommandGift extends Command {
|
|||
reply(Message.NO_ITEM);
|
||||
return;
|
||||
}
|
||||
|
||||
if(partner.getInventory().firstEmpty() == -1) {
|
||||
reply(Message.PARTNER_INVENTORY_FULL);
|
||||
return;
|
||||
}
|
||||
|
||||
partner.getInventory().addItem(item.clone());
|
||||
player.setItemInHand(null);
|
||||
|
|
|
@ -55,6 +55,7 @@ public enum Message {
|
|||
CONFIG_RELOAD("&aConfiguration settings were reloaded, please note that some settings may not apply until reboot."),
|
||||
GENDER_ALREADY_CHANGED("&cYou have already specified your gender, you can only do this once."),
|
||||
TELEPORT_UNSAFE("&cThe location you are trying to teleport to is unsafe or obstructed"),
|
||||
PARTNER_INVENTORY_FULL("&cYour partner's inventory is full!"),
|
||||
|
||||
// COMMANDS
|
||||
COMMAND_MARRY("Request a marriage with another player"),
|
||||
|
@ -105,4 +106,4 @@ public enum Message {
|
|||
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue