diff --git a/Changelog.txt b/Changelog.txt index d51f47087..2275a95c8 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ Key: Version 1.3.09 + Added several permission nodes to give individual users special perks (Double/Triple/Quadruple XP) + + Added API for plugins to add custom tools directly via Spout = Fixed issue with NoCheatPlus and Serrated Strikes / Skull Splitter (fight.noswing) = Fixed bug where you could receive Archery XP from Potions = Fixed bug with duping blocks via piston pushing diff --git a/src/main/java/com/gmail/nossr50/api/SpoutToolsAPI.java b/src/main/java/com/gmail/nossr50/api/SpoutToolsAPI.java new file mode 100644 index 000000000..03d3235ae --- /dev/null +++ b/src/main/java/com/gmail/nossr50/api/SpoutToolsAPI.java @@ -0,0 +1,21 @@ +package com.gmail.nossr50.api; + +import java.util.ArrayList; +import java.util.List; + +import org.getspout.spoutapi.inventory.SpoutItemStack; + +public class SpoutToolsAPI { + public static List spoutSwords = new ArrayList(); + + /** + * Add a custom Spout sword to mcMMO for XP gain & ability use. + *
+ * This function is designed for API usage. + * + * @param spoutSword The sword to add + */ + public void addCustomSword(SpoutItemStack spoutSword) { + spoutSwords.add(spoutSword); + } +} diff --git a/src/main/java/com/gmail/nossr50/util/ItemChecks.java b/src/main/java/com/gmail/nossr50/util/ItemChecks.java index 54735af64..80c977c05 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemChecks.java +++ b/src/main/java/com/gmail/nossr50/util/ItemChecks.java @@ -1,7 +1,10 @@ package com.gmail.nossr50.util; import org.bukkit.inventory.ItemStack; +import org.getspout.spoutapi.inventory.SpoutItemStack; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.api.SpoutToolsAPI; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomToolsConfig; @@ -30,6 +33,9 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customSwordIDs.contains(is.getTypeId())) { return true; } + else if (mcMMO.p.spoutEnabled && is instanceof SpoutItemStack && SpoutToolsAPI.spoutSwords.contains((SpoutItemStack) is)) { + return true; + } else { return false; }