diff --git a/Changelog.txt b/Changelog.txt index 96a57d744..ad736e0da 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,6 +7,8 @@ Key: ! Change - Removal + + Added option to config.yml to let non-tools in hand count as unarmed + Version 1.5.02-dev + Added option to config.yml for Chimaera Wings to stop using bed spawn points = Fixed bug where no Mining XP was granted when Flux Mining was successful diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index d4578166f..2c363b6d8 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -498,6 +498,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); } + public boolean getUnarmedItemsAsUnarmed() { return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); } /* Taming */ public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); } diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index e9d9275fe..a4e092157 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -13,6 +13,7 @@ import org.bukkit.material.Dye; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.party.ItemWeightConfig; +import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; public final class ItemUtils { @@ -153,7 +154,10 @@ public final class ItemUtils { * @return true if the item counts as unarmed, false otherwise */ public static boolean isUnarmed(ItemStack item) { - return !isMinecraftTool(item); + if(Config.getInstance().getUnarmedItemsAsUnarmed()) + return !isMinecraftTool(item); + + return item.getType() == Material.AIR; } /** diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index dc22cf3b3..17f9c0d09 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -395,6 +395,8 @@ Skills: # 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 + # Any attacks made without a tool, i.e. with one's open hand, a block, etc., will count as unarmed. + Items_As_Unarmed: false Woodcutting: Tree_Feller_Sounds: true Level_Cap: 0