mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-13 17:04:02 +00:00
1.2.6.2
This commit is contained in:
1 parent
be9af968b9
commit
38d769e384
6 files changed
+62
-14
No files matched your search
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.Logger;
|
||||
public class EMT {
|
||||
public static final String NAME = "Electro-Magic Tools";
|
||||
public static final String MOD_ID = "EMT";
|
||||
public static final String VERSION = "1.2.6.1";
|
||||
public static final String VERSION = "1.2.6.2";
|
||||
public static final String TEXTURE_PATH = "emt";
|
||||
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||
|
||||
@@ -20,12 +20,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public int visDiscount = 0;
|
||||
Random rnd;
|
||||
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -33,9 +32,12 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
this.isDamageable();
|
||||
rnd = new Random();
|
||||
}
|
||||
|
||||
public float getFallDamageMult() {
|
||||
return 0.6F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
@@ -70,6 +72,7 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
@@ -93,7 +96,7 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
visDiscount = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -66,9 +71,6 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWings(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance-= player.fallDistance/8;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,6 +23,11 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -39,9 +44,6 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWings(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,11 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
|
||||
@@ -6,12 +6,15 @@ import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||
import emt.EMT;
|
||||
import emt.client.EMTKeys;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.init.EMTItems;
|
||||
import emt.item.armor.wings.ItemFeatherWing;
|
||||
import emt.network.PacketEMTKeys;
|
||||
import emt.proxy.ClientProxy;
|
||||
import ic2.api.item.ElectricItem;
|
||||
@@ -24,7 +27,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
@@ -32,8 +39,36 @@ import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.entities.monster.EntityTaintChicken;
|
||||
|
||||
public class EMTEventHandler {
|
||||
Random rnd = new Random();
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingHurtEvent e) {
|
||||
if(!(e.entityLiving instanceof EntityPlayer) || e.source != DamageSource.fall)
|
||||
return;
|
||||
|
||||
ItemStack s = ((EntityPlayer)e.entityLiving).inventory.armorInventory[2];
|
||||
|
||||
if(s == null || !(s.getItem() instanceof ItemFeatherWing)) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.ammount *= ((ItemFeatherWing)s.getItem()).getFallDamageMult();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTickEvent(TickEvent.PlayerTickEvent e) {
|
||||
|
||||
ItemStack s = e.player.inventory.armorInventory[2];
|
||||
|
||||
if(s == null || !(s.getItem() instanceof ItemFeatherWing) || e.phase == Phase.START) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(e.player.motionY > 0) {
|
||||
if(e.player.fallDistance > 0)
|
||||
e.player.fallDistance -= e.player.motionY;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityLivingDrops(LivingDropsEvent event) {
|
||||
if (event.entityLiving instanceof EntityCreeper) {
|
||||
@@ -43,7 +78,7 @@ public class EMTEventHandler {
|
||||
}
|
||||
}
|
||||
if (event.entityLiving instanceof EntityTaintChicken) {
|
||||
event.entityLiving.entityDropItem(new ItemStack(EMTItems.itemEMTItems, rnd.nextInt(3), 13), 1);
|
||||
event.entityLiving.entityDropItem(new ItemStack(EMTItems.itemEMTItems, event.entityLiving.worldObj.rand.nextInt(3), 13), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +131,5 @@ public class EMTEventHandler {
|
||||
|
||||
e.world.setBlock(e.x, e.y, e.z, EMTBlocks.electricCloud);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user