mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 23:45:57 +00:00
Added more implementations of IManaUsingItem.
This commit is contained in:
1 parent
371b5ffac3
commit
016b7d4b86
10 files changed
+71
-13
No files matched your search
@@ -16,11 +16,12 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemDirtRod extends ItemMod {
|
||||
public class ItemDirtRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
private static final int COST = 75;
|
||||
|
||||
@@ -51,5 +52,10 @@ public class ItemDirtRod extends ItemMod {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -35,7 +36,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManaGun extends ItemMod {
|
||||
public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
|
||||
private static final String TAG_LENS = "lens";
|
||||
private static final int COOLDOWN = 30;
|
||||
@@ -179,4 +180,9 @@ public class ItemManaGun extends ItemMod {
|
||||
if(par1ItemStack.isItemDamaged())
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -23,18 +23,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemTerraformRod extends ItemMod {
|
||||
public class ItemTerraformRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
private static final int COST_PER = 55;
|
||||
|
||||
static final List<Block> validBlocks = new ArrayList() {private static final long serialVersionUID = 1378413169035169782L;
|
||||
|
||||
{
|
||||
static final List<Block> validBlocks = new ArrayList() {{
|
||||
add(Blocks.stone);
|
||||
add(Blocks.dirt);
|
||||
add(Blocks.grass);
|
||||
@@ -163,4 +162,9 @@ public class ItemTerraformRod extends ItemMod {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -30,7 +31,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor {
|
||||
public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IManaUsingItem {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 70;
|
||||
|
||||
@@ -86,4 +87,9 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,11 +16,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
|
||||
public class ItemMiningRing extends ItemBauble {
|
||||
public class ItemMiningRing extends ItemBauble implements IManaUsingItem {
|
||||
|
||||
public ItemMiningRing() {
|
||||
super(LibItemNames.MINING_RING);
|
||||
@@ -59,4 +60,9 @@ public class ItemMiningRing extends ItemBauble {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,11 +17,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
|
||||
public class ItemWaterRing extends ItemBauble {
|
||||
public class ItemWaterRing extends ItemBauble implements IManaUsingItem {
|
||||
|
||||
public ItemWaterRing() {
|
||||
super(LibItemNames.WATER_RING);
|
||||
@@ -73,4 +74,9 @@ public class ItemWaterRing extends ItemBauble {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -28,7 +29,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelAxe extends ItemAxe {
|
||||
public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
@@ -74,4 +75,9 @@ public class ItemManasteelAxe extends ItemAxe {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -35,7 +36,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelShears extends ItemShears {
|
||||
public class ItemManasteelShears extends ItemShears implements IManaUsingItem {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 30;
|
||||
|
||||
@@ -123,4 +124,9 @@ public class ItemManasteelShears extends ItemShears {
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -28,7 +29,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelShovel extends ItemSpade {
|
||||
public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
@@ -74,4 +75,9 @@ public class ItemManasteelShovel extends ItemSpade {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
@@ -29,7 +30,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelSword extends ItemSword {
|
||||
public class ItemManasteelSword extends ItemSword implements IManaUsingItem {
|
||||
|
||||
static final int MANA_PER_DAMAGE = 51;
|
||||
|
||||
@@ -92,4 +93,9 @@ public class ItemManasteelSword extends ItemSword {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user