mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 12:42:50 +00:00
Added the Terra Blade.
This commit is contained in:
1 parent
8154a5ec74
commit
7582889149
8 files changed
+114
-4
No files matched your search
@@ -52,7 +52,7 @@ public final class BotaniaAPI {
|
||||
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
|
||||
public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26);
|
||||
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 3, 1800, 8.6F, 3F, 26);
|
||||
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 3, 1800, 9F, 3F, 26);
|
||||
|
||||
static {
|
||||
registerSubTile("", DummySubTile.class);
|
||||
|
||||
@@ -82,6 +82,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.manasteelChest);
|
||||
addItem(ModItems.manasteelLegs);
|
||||
addItem(ModItems.manasteelBoots);
|
||||
addItem(ModItems.terraSword);
|
||||
addItem(ModItems.terrasteelHelm);
|
||||
addItem(ModItems.terrasteelChest);
|
||||
addItem(ModItems.terrasteelLegs);
|
||||
|
||||
@@ -20,6 +20,7 @@ import vazkii.botania.common.item.tool.ItemManasteelPick;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelShears;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelShovel;
|
||||
import vazkii.botania.common.item.tool.ItemManasteelSword;
|
||||
import vazkii.botania.common.item.tool.ItemTerraSword;
|
||||
import vazkii.botania.common.item.tool.armor.ItemManasteelBoots;
|
||||
import vazkii.botania.common.item.tool.armor.ItemManasteelChest;
|
||||
import vazkii.botania.common.item.tool.armor.ItemManasteelHelm;
|
||||
@@ -64,6 +65,7 @@ public final class ModItems {
|
||||
public static Item terrasteelChest;
|
||||
public static Item terrasteelLegs;
|
||||
public static Item terrasteelBoots;
|
||||
public static Item terraSword;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -98,6 +100,7 @@ public final class ModItems {
|
||||
terrasteelChest = new ItemTerrasteelChest();
|
||||
terrasteelLegs = new ItemTerrasteelLegs();
|
||||
terrasteelBoots = new ItemTerrasteelBoots();
|
||||
terraSword = new ItemTerraSword();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -29,14 +29,18 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemManasteelSword extends ItemSword {
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 50;
|
||||
static final int MANA_PER_DAMAGE = 51;
|
||||
|
||||
IIcon elucidatorIcon;
|
||||
|
||||
public ItemManasteelSword() {
|
||||
super(BotaniaAPI.manasteelToolMaterial);
|
||||
this(BotaniaAPI.manasteelToolMaterial, LibItemNames.MANASTEEL_SWORD);
|
||||
}
|
||||
|
||||
public ItemManasteelSword(ToolMaterial mat, String name) {
|
||||
super(mat);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANASTEEL_SWORD);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Apr 14, 2014, 7:34:56 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.ILensEffect;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
|
||||
|
||||
public ItemTerraSword() {
|
||||
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_SWORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
if(player.swingProgress == 0.16666667F && !par2World.isRemote && par2World.rand.nextInt(2) == 0) {
|
||||
EntityManaBurst burst = getBurst(player, par1ItemStack);
|
||||
par2World.spawnEntityInWorld(burst);
|
||||
ManasteelToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE);
|
||||
par2World.playSoundAtEntity(player, "random.levelup", 1F, 1.4F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack) {
|
||||
EntityManaBurst burst = new EntityManaBurst(player);
|
||||
|
||||
float motionModifier = 5F;
|
||||
|
||||
burst.setColor(0x20FF20);
|
||||
burst.setMana(MANA_PER_DAMAGE);
|
||||
burst.setStartingMana(MANA_PER_DAMAGE);
|
||||
burst.setMinManaLoss(40);
|
||||
burst.setManaLossPerTick(4F);
|
||||
burst.setGravity(0F);
|
||||
burst.setMotion(burst.motionX * motionModifier, burst.motionY * motionModifier, burst.motionZ * motionModifier);
|
||||
|
||||
burst.setSourceLens(stack);
|
||||
return burst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(ItemStack stack, BurstProperties props) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
Entity entity = (Entity) burst;
|
||||
if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && !(pos.entityHit instanceof EntityPlayer)) {
|
||||
EntityLivingBase living = (EntityLivingBase) pos.entityHit;
|
||||
if(living.hurtTime == 0) {
|
||||
int cost = MANA_PER_DAMAGE / 3;
|
||||
int mana = burst.getMana();
|
||||
if(mana >= cost) {
|
||||
burst.setMana(mana - cost);
|
||||
float damage = 4F + BotaniaAPI.terrasteelToolMaterial.getDamageVsEntity();
|
||||
if(!burst.isFake() && !entity.worldObj.isRemote)
|
||||
living.attackEntityFrom(DamageSource.magic, damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBurst(IManaBurst burst, ItemStack stack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doParticles(IManaBurst burst, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,6 +47,7 @@ public final class LibItemNames {
|
||||
public static final String TERRASTEEL_CHEST = LibResources.PREFIX_MOD + "terrasteelChest";
|
||||
public static final String TERRASTEEL_LEGS = LibResources.PREFIX_MOD + "terrasteelLegs";
|
||||
public static final String TERRASTEEL_BOOTS = LibResources.PREFIX_MOD + "terrasteelBoots";
|
||||
public static final String TERRA_SWORD = LibResources.PREFIX_MOD + "terraSword";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
LibResources.PREFIX_MOD + "lensNormal",
|
||||
|
||||
@@ -275,6 +275,7 @@ item.botania:terrasteelHelm.name=Terrasteel Helmet
|
||||
item.botania:terrasteelChest.name=Terrasteel Chestplate
|
||||
item.botania:terrasteelLegs.name=Terrasteel Leggings
|
||||
item.botania:terrasteelBoots.name=Terrasteel Boots
|
||||
item.botania:terraSword.name=Terra Blade
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user