mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
WIP - Spout custom tool support
This commit is contained in:
parent
c2d1909379
commit
41e9bd3cb5
@ -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
|
||||
|
21
src/main/java/com/gmail/nossr50/api/SpoutToolsAPI.java
Normal file
21
src/main/java/com/gmail/nossr50/api/SpoutToolsAPI.java
Normal file
@ -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<SpoutItemStack> spoutSwords = new ArrayList<SpoutItemStack>();
|
||||
|
||||
/**
|
||||
* Add a custom Spout sword to mcMMO for XP gain & ability use.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param spoutSword The sword to add
|
||||
*/
|
||||
public void addCustomSword(SpoutItemStack spoutSword) {
|
||||
spoutSwords.add(spoutSword);
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user