Add option to control Unarmed item pickup behavior

By default when using Unarmed, picking up items is prevented when a
players entire inventory is full, except for his empty hand.
This commit is contained in:
TfT_02 2014-07-15 15:40:49 +02:00
parent 1c30146491
commit 30085e1e34
3 changed files with 6 additions and 1 deletions

View File

@ -474,6 +474,7 @@ public class Config extends AutoUpdateConfigLoader {
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
public boolean getUnarmedItemPickupDisabled() { return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); }
/* Taming */
public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); }

View File

@ -333,7 +333,8 @@ public class PlayerListener implements Listener {
if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.BERSERK)) {
boolean pickupSuccess = Unarmed.handleItemPickup(player.getInventory(), drop);
event.setCancelled(pickupSuccess);
boolean cancel = Config.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess;
event.setCancelled(cancel);
if (pickupSuccess) {
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());

View File

@ -352,6 +352,9 @@ Skills:
Level_Cap: 0
Block_Cracker:
SmoothBrick_To_CrackedBrick: true
# When using Unarmed, picked up items will automatically get moved to a free slot instead of going in the slot
# of your hand. Should item pickup be disabled when your entire inventory - except for your hand - is full?
Item_Pickup_Disabled_Full_Inventory: true
Woodcutting:
Tree_Feller_Sounds: true
Level_Cap: 0