diff options
| author | Lance5057 <Lance5057@gmail.com> | 2015-07-09 04:03:29 -0500 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2015-07-09 04:03:29 -0500 |
| commit | eb7abd4ef915fd5ec6783d93cf7ba17d7f43d208 (patch) | |
| tree | c746be5a9b4dcbe91733357020bfb8c717f1d71a /src/main/java | |
| parent | e913b331003a724f6be8675ca886f7d5ca112348 (diff) | |
Started making MnB an optional mod.
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/gmail/Lance5057/items/tools/Shield.java | 23 | ||||
| -rw-r--r-- | src/main/java/gmail/Lance5057/modifiers/shields/modifierCrestofLegends.java | 14 |
2 files changed, 27 insertions, 10 deletions
diff --git a/src/main/java/gmail/Lance5057/items/tools/Shield.java b/src/main/java/gmail/Lance5057/items/tools/Shield.java index 90b5dd4..58dc60b 100644 --- a/src/main/java/gmail/Lance5057/items/tools/Shield.java +++ b/src/main/java/gmail/Lance5057/items/tools/Shield.java @@ -1,8 +1,8 @@ package gmail.Lance5057.items.tools; +import cpw.mods.fml.common.Optional; import tconstruct.library.tools.ToolCore; import cpw.mods.fml.relauncher.*; -import mods.battlegear2.api.IEnchantable; import mods.battlegear2.api.ISheathed; import mods.battlegear2.api.shield.IArrowCatcher; import mods.battlegear2.api.shield.IArrowDisplay; @@ -17,6 +17,14 @@ import net.minecraft.item.*; import net.minecraft.util.DamageSource; import net.minecraft.world.World; + +@Optional.InterfaceList({ + @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.ISheathed"), + @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IArrowCatcher"), + @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IArrowDisplay"), + @Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.shield.IShield") +}) + public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatcher, IArrowDisplay { public Shield(int baseDamage) { @@ -129,18 +137,21 @@ public class Shield extends ToolCore implements IShield, ISheathed, } @Override + @Optional.Method(modid = "battlegear2") public int getArrowCount(ItemStack arg0) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public void setArrowCount(ItemStack arg0, int arg1) { // TODO Auto-generated method stub } @Override + @Optional.Method(modid = "battlegear2") public boolean catchArrow(ItemStack arg0, EntityPlayer arg1, IProjectile arg2) { // TODO Auto-generated method stub @@ -148,60 +159,70 @@ public class Shield extends ToolCore implements IShield, ISheathed, } @Override + @Optional.Method(modid = "battlegear2") public boolean sheatheOnBack(ItemStack item) { // TODO Auto-generated method stub return false; } @Override + @Optional.Method(modid = "battlegear2") public void blockAnimation(EntityPlayer arg0, float arg1) { // TODO Auto-generated method stub } @Override + @Optional.Method(modid = "battlegear2") public boolean canBlock(ItemStack arg0, DamageSource arg1) { // TODO Auto-generated method stub return false; } @Override + @Optional.Method(modid = "battlegear2") public int getBashTimer(ItemStack arg0) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public float getBlockAngle(ItemStack arg0) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public float getDamageDecayRate(ItemStack arg0, float arg1) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public float getDamageReduction(ItemStack arg0, DamageSource arg1) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public float getDecayRate(ItemStack arg0) { // TODO Auto-generated method stub return 0; } @Override + @Optional.Method(modid = "battlegear2") public float getRecoveryRate(ItemStack arg0) { // TODO Auto-generated method stub return 0; } @Override + public Item getAccessoryItem() { // TODO Auto-generated method stub return null; diff --git a/src/main/java/gmail/Lance5057/modifiers/shields/modifierCrestofLegends.java b/src/main/java/gmail/Lance5057/modifiers/shields/modifierCrestofLegends.java index 7282cc6..1589b36 100644 --- a/src/main/java/gmail/Lance5057/modifiers/shields/modifierCrestofLegends.java +++ b/src/main/java/gmail/Lance5057/modifiers/shields/modifierCrestofLegends.java @@ -1,5 +1,6 @@ package gmail.Lance5057.modifiers.shields; +import gmail.Lance5057.items.tools.Shield; import tconstruct.modifiers.tools.ItemModTypeFilter; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -20,16 +21,11 @@ public class modifierCrestofLegends extends ItemModTypeFilter protected boolean canModify (ItemStack tool, ItemStack[] input) { NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - int keyPair[] = tags.getIntArray(key); - if (keyPair[0] + matchingAmount(input) <= keyPair[1]) - return true; - - else if (keyPair[0] == keyPair[1]) + + if(tool.getItem() instanceof Shield) return tags.getInteger("Modifiers") > 0; - - else - return false; + + return false; } @Override |
