mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-19 11:49:33 +00:00
Fixes, and fixes!
Wings and boots prevent fall damage one again Wings model is fixed!
This commit is contained in:
1 parent
7d64233ee4
commit
2303c304a8
10 files changed
+498
-526
No files matched your search
@@ -4,7 +4,7 @@ public class ModInformation {
|
||||
|
||||
public static final String name = "Electro-Magic Tools";
|
||||
public static final String modid = "EMT";
|
||||
public static final String version = "2.0.0Alpha";
|
||||
public static final String version = "2.0.0Alpha2";
|
||||
public static final String texturePath = "electromagictools";
|
||||
public static final String guiFactory = "tombenpotter.emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String clientProxy = "tombenpotter.emt.proxies.ClientProxy";
|
||||
|
||||
@@ -6,45 +6,56 @@ import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelWings extends ModelBiped {
|
||||
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer center;
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer center;
|
||||
|
||||
public ModelWings() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
public ModelWings() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
rightWing = new ModelRenderer(this, 24, 0);
|
||||
rightWing.addBox(-11F, 0F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = true;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, 0F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
center = new ModelRenderer(this, 0, 14);
|
||||
center.addBox(0F, 0F, 0F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
}
|
||||
rightWing = new ModelRenderer(this, 24, 0);
|
||||
rightWing.addBox(-11F, 0F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = true;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
rightWing.render(f5);
|
||||
leftWing.render(f5);
|
||||
center.render(f5);
|
||||
}
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, 0F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
center = new ModelRenderer(this, 0, 14);
|
||||
center.addBox(0F, 0F, 0F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
|
||||
this.bipedBody.addChild(rightWing);
|
||||
this.bipedBody.addChild(leftWing);
|
||||
this.bipedBody.addChild(center);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
bipedHead.showModel = false;
|
||||
bipedHeadwear.showModel = false;
|
||||
bipedLeftLeg.showModel = false;
|
||||
bipedRightLeg.showModel = false;
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
rightWing.render(f5);
|
||||
leftWing.render(f5);
|
||||
center.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
@@ -17,64 +17,53 @@ import tombenpotter.emt.client.model.ModelWings;
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public int visDiscount = 0;
|
||||
public int visDiscount = 0;
|
||||
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
}
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":featherwings");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":featherwings");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/featherwing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/featherwing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
return new ModelWings();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
return new ModelWings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) {
|
||||
player.motionY = 0.25;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isJumping) player.motionY = 0.25;
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode) {
|
||||
player.motionY *= 0.9;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.9;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.6;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
|
||||
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
|
||||
if (isSneaking && !player.onGround) {
|
||||
player.motionY = -0.6;
|
||||
player.fallDistance = 0F;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F)
|
||||
player.fallDistance -= 0.25F;
|
||||
}
|
||||
}
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
+43
-53
@@ -19,68 +19,58 @@ import java.util.List;
|
||||
|
||||
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
|
||||
|
||||
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumwings");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumwings");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumiumwing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumiumwing.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) {
|
||||
player.motionY = 0.5;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isJumping) player.motionY = 0.5;
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode) {
|
||||
player.motionY *= 0.5;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.5;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.6;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
|
||||
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
|
||||
if (isSneaking && !player.onGround) {
|
||||
player.motionY = -0.6;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
|
||||
if (player.fallDistance > 0.0F)
|
||||
player.fallDistance -= 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
+159
-155
@@ -40,6 +40,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -52,187 +53,190 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricBootsTraveller extends ItemArmor implements IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public int maxCharge = 10000;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 2;
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public float fallDistance = 0.5F;
|
||||
public double transferLimit = 100;
|
||||
public int maxCharge = 100000;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 2;
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public double transferLimit = 100;
|
||||
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":electricboots");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":electricboots");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
}
|
||||
reduceFallDistance(player);
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
|
||||
if (hasArmor)
|
||||
player.motionY += jumpBonus;
|
||||
}
|
||||
}
|
||||
if (hasArmor)
|
||||
player.motionY += jumpBonus;
|
||||
}
|
||||
}
|
||||
|
||||
public void reduceFallDistance(EntityPlayer player) {
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance -= fallDistance;
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null) && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
if (ElectricItem.manager.use(stack, energyPerDamage, entity)) event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricboots.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricboots.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+18
-19
@@ -31,25 +31,24 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 500000;
|
||||
speedBonus = (float) ConfigHandler.nanoBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.nanoBootsJump;
|
||||
fallDistance = 0.75F;
|
||||
visDiscount = 4;
|
||||
transferLimit = 1000;
|
||||
energyPerDamage = 500;
|
||||
}
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 1000000;
|
||||
speedBonus = (float) ConfigHandler.nanoBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.nanoBootsJump;
|
||||
visDiscount = 4;
|
||||
transferLimit = 1000;
|
||||
energyPerDamage = 500;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanobootstravel");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanobootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
}
|
||||
+18
-27
@@ -25,39 +25,30 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tombenpotter.emt.ModInformation;
|
||||
import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 1000000;
|
||||
speedBonus = (float) ConfigHandler.quantumBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.quantumBootsJump;
|
||||
fallDistance = 0.0F;
|
||||
visDiscount = 5;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 10000000;
|
||||
speedBonus = (float) ConfigHandler.quantumBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.quantumBootsJump;
|
||||
visDiscount = 5;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumbootstravel");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumbootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reduceFallDistance(EntityPlayer player) {
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = fallDistance;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
}
|
||||
+130
-140
@@ -25,172 +25,162 @@ import java.util.List;
|
||||
|
||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
||||
|
||||
public int maxCharge = 100000;
|
||||
public int tier = 3;
|
||||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
public int maxCharge = 100000;
|
||||
public int tier = 3;
|
||||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
|
||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
visDiscount = 5;
|
||||
}
|
||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
visDiscount = 5;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanowings");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanowings");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanowing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanowing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) {
|
||||
player.motionY = 0.7;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isJumping) player.motionY = 0.7;
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode) {
|
||||
player.motionY *= 0.3;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.3;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.4;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.4;
|
||||
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.2;
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.2;
|
||||
|
||||
if (isSneaking && !player.onGround) {
|
||||
player.motionY = -0.6;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
if (player.fallDistance > 0.0F)
|
||||
player.fallDistance -= 0.75F;
|
||||
}
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+37
-44
@@ -13,57 +13,50 @@ import tombenpotter.emt.ModInformation;
|
||||
|
||||
public class ItemQuantumWing extends ItemNanoWing {
|
||||
|
||||
public ItemQuantumWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
maxCharge = 1000000;
|
||||
visDiscount = 6;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
public ItemQuantumWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
maxCharge = 1000000;
|
||||
visDiscount = 6;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumwings");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumwings");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumwing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumwing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping)
|
||||
player.motionY = 0.85;
|
||||
if (isJumping) player.motionY = 0.85;
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.3;
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.3;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.1;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.1;
|
||||
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.05;
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.05;
|
||||
|
||||
if (isSneaking && isHoldingJump)
|
||||
player.motionY = 0;
|
||||
if (isSneaking && isHoldingJump) player.motionY = 0;
|
||||
|
||||
if (isSneaking && !player.onGround && !isHoldingJump)
|
||||
player.motionY = -0.6;
|
||||
|
||||
|
||||
if (player.fallDistance > 0.0F)
|
||||
player.fallDistance = 0F;
|
||||
}
|
||||
}
|
||||
if (isSneaking && !player.onGround && !isHoldingJump) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user