mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-28 07:35:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38d769e384 | ||
|
|
be9af968b9 | ||
|
|
30d0534377 | ||
|
|
9c4f0034fb | ||
|
|
b97d3e1d27 | ||
|
|
21ce8e85c6 | ||
|
|
501360c92b | ||
|
|
022137be62 |
No files matched your search
@@ -42,3 +42,4 @@ Thumbs.db
|
|||||||
|
|
||||||
#Vim backups
|
#Vim backups
|
||||||
*~
|
*~
|
||||||
|
*.bat
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
package_group=emt
|
package_group=emt
|
||||||
mc_version=1.7.10
|
mc_version=1.7.10
|
||||||
forge_version=10.13.4.1614
|
forge_version=10.13.4.1614
|
||||||
mod_version=1.2.6
|
mod_version=1.2.6.2
|
||||||
mod_name=ElectroMagicTools
|
mod_name=ElectroMagicTools
|
||||||
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
public class EMT {
|
public class EMT {
|
||||||
public static final String NAME = "Electro-Magic Tools";
|
public static final String NAME = "Electro-Magic Tools";
|
||||||
public static final String MOD_ID = "EMT";
|
public static final String MOD_ID = "EMT";
|
||||||
public static final String VERSION = "1.2.6";
|
public static final String VERSION = "1.2.6.2";
|
||||||
public static final String TEXTURE_PATH = "emt";
|
public static final String TEXTURE_PATH = "emt";
|
||||||
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||||
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||||
@@ -61,7 +61,8 @@ public class EMT {
|
|||||||
LOGGER.info("Starting planning the world domination");
|
LOGGER.info("Starting planning the world domination");
|
||||||
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||||
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||||
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
if(FMLCommonHandler.instance().getSide().isClient())
|
||||||
|
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
||||||
Registry.register();
|
Registry.register();
|
||||||
EMTEssentiasOutputs.addPrimalOutputs();
|
EMTEssentiasOutputs.addPrimalOutputs();
|
||||||
EMTEssentiasOutputs.addOutputs();
|
EMTEssentiasOutputs.addOutputs();
|
||||||
@@ -76,7 +77,8 @@ public class EMT {
|
|||||||
proxy.load();
|
proxy.load();
|
||||||
LOGGER.info("Making mobs drop additional items");
|
LOGGER.info("Making mobs drop additional items");
|
||||||
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
||||||
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
if(FMLCommonHandler.instance().getSide().isClient())
|
||||||
|
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
||||||
LOGGER.info("Adding dungeon loot");
|
LOGGER.info("Adding dungeon loot");
|
||||||
EMTDungeonChestGenerator.generateLoot();
|
EMTDungeonChestGenerator.generateLoot();
|
||||||
LOGGER.info("Registering entities");
|
LOGGER.info("Registering entities");
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package emt.block;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import emt.EMT;
|
import emt.EMT;
|
||||||
import emt.tile.TileElectricCloud;
|
import emt.tile.TileElectricCloud;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@@ -32,6 +34,7 @@ public class BlockElectricCloud extends BlockBase {
|
|||||||
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
|
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
|
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
|
||||||
FXSparkle ef = new FXSparkle(world, x + 0.5F, y + 0.5F, z + 0.5F, x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, 1.0F, 6, 3);
|
FXSparkle ef = new FXSparkle(world, x + 0.5F, y + 0.5F, z + 0.5F, x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, 1.0F, 6, 3);
|
||||||
|
|||||||
@@ -116,10 +116,10 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
|
|||||||
entities.add(entity);
|
entities.add(entity);
|
||||||
/** Closer - Harder */
|
/** Closer - Harder */
|
||||||
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
|
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
|
||||||
entity.performHurtAnimation();
|
|
||||||
|
|
||||||
if(worldObj.isRemote)
|
if(worldObj.isRemote) {
|
||||||
Thaumcraft.proxy.bolt(worldObj, this, entity);
|
Thaumcraft.proxy.bolt(worldObj, this, entity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,12 +20,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemFeatherWing extends ItemArmor {
|
public class ItemFeatherWing extends ItemArmor {
|
||||||
|
|
||||||
public int visDiscount = 0;
|
public int visDiscount = 0;
|
||||||
Random rnd;
|
|
||||||
|
|
||||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||||
super(material, par3, par4);
|
super(material, par3, par4);
|
||||||
@@ -33,7 +32,10 @@ public class ItemFeatherWing extends ItemArmor {
|
|||||||
this.setMaxDamage(120);
|
this.setMaxDamage(120);
|
||||||
this.setCreativeTab(EMT.TAB);
|
this.setCreativeTab(EMT.TAB);
|
||||||
this.isDamageable();
|
this.isDamageable();
|
||||||
rnd = new Random();
|
}
|
||||||
|
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.6F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -65,11 +67,12 @@ public class ItemFeatherWing extends ItemArmor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
useWings(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||||
|
|
||||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
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);
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||||
for (int i = 0; i < 4; i++) {
|
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);
|
nbtData.setByte("f", (byte) 0);
|
||||||
}
|
}
|
||||||
@@ -115,9 +118,8 @@ public class ItemFeatherWing extends ItemArmor {
|
|||||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||||
player.motionY *= 0.6;
|
player.motionY *= 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.fallDistance > 0.0F) {
|
if (player.fallDistance > 0.0F) {
|
||||||
player.fallDistance = 0;
|
player.fallDistance-= player.fallDistance/40;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,11 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
|||||||
visDiscount = 5;
|
visDiscount = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.2F;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ public class ItemQuantumWing extends ItemNanoWing {
|
|||||||
energyPerDamage = 1000;
|
energyPerDamage = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
|||||||
visDiscount = 4;
|
visDiscount = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFallDamageMult() {
|
||||||
|
return 0.4F;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||||
return visDiscount;
|
return visDiscount;
|
||||||
@@ -57,5 +62,8 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
|||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
this.useWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
this.useWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||||
|
if (player.fallDistance > 0.0F) {
|
||||||
|
player.fallDistance -= player.fallDistance /25;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
package emt.tile;
|
package emt.tile;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import thaumcraft.client.fx.ParticleEngine;
|
import thaumcraft.client.fx.ParticleEngine;
|
||||||
import thaumcraft.client.fx.particles.FXWisp;
|
import thaumcraft.client.fx.particles.FXWisp;
|
||||||
@@ -14,28 +18,32 @@ public class TileElectricCloud extends TileEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
if (worldObj.isRemote) {
|
if(worldObj.isRemote && FMLCommonHandler.instance().getSide().isClient() && FMLClientHandler.instance().getClient().renderViewEntity != null)
|
||||||
if (worldObj.rand.nextInt(4) == 0) {
|
fx();
|
||||||
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (worldObj.rand.nextInt(12) == 0) {
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void fx() {
|
||||||
|
if (worldObj.rand.nextInt(4) == 0) {
|
||||||
|
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (worldObj.rand.nextInt(12) == 0) {
|
||||||
|
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||||
|
if (worldObj.rand.nextInt(2) == 0) {
|
||||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||||
if (worldObj.rand.nextInt(2) == 0) {
|
|
||||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
|
||||||
}
|
|
||||||
if (worldObj.rand.nextInt(4) == 0) {
|
|
||||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (worldObj.rand.nextInt(4) == 0) {
|
||||||
|
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (worldObj.rand.nextInt(3) == 0) {
|
if (worldObj.rand.nextInt(3) == 0) {
|
||||||
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
||||||
wisp.setGravity(-0.02F);
|
wisp.setGravity(-0.02F);
|
||||||
wisp.setRBGColorF(worldObj.rand.nextInt(40) / 100f, 0, 1);
|
wisp.setRBGColorF(worldObj.rand.nextInt(40) / 100f, 0, 1);
|
||||||
wisp.setAlphaF(1);
|
wisp.setAlphaF(1);
|
||||||
ParticleEngine.instance.addEffect(worldObj, wisp);
|
ParticleEngine.instance.addEffect(worldObj, wisp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,12 +6,15 @@ import baubles.api.BaublesApi;
|
|||||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
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.ClientTickEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||||
import emt.EMT;
|
import emt.EMT;
|
||||||
import emt.client.EMTKeys;
|
import emt.client.EMTKeys;
|
||||||
import emt.init.EMTBlocks;
|
import emt.init.EMTBlocks;
|
||||||
import emt.init.EMTItems;
|
import emt.init.EMTItems;
|
||||||
|
import emt.item.armor.wings.ItemFeatherWing;
|
||||||
import emt.network.PacketEMTKeys;
|
import emt.network.PacketEMTKeys;
|
||||||
import emt.proxy.ClientProxy;
|
import emt.proxy.ClientProxy;
|
||||||
import ic2.api.item.ElectricItem;
|
import ic2.api.item.ElectricItem;
|
||||||
@@ -24,7 +27,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
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.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.living.LivingSetAttackTargetEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import thaumcraft.common.config.ConfigBlocks;
|
import thaumcraft.common.config.ConfigBlocks;
|
||||||
@@ -32,7 +39,35 @@ import thaumcraft.common.config.ConfigItems;
|
|||||||
import thaumcraft.common.entities.monster.EntityTaintChicken;
|
import thaumcraft.common.entities.monster.EntityTaintChicken;
|
||||||
|
|
||||||
public class EMTEventHandler {
|
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
|
@SubscribeEvent
|
||||||
public void onEntityLivingDrops(LivingDropsEvent event) {
|
public void onEntityLivingDrops(LivingDropsEvent event) {
|
||||||
@@ -43,7 +78,7 @@ public class EMTEventHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.entityLiving instanceof EntityTaintChicken) {
|
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);
|
e.world.setBlock(e.x, e.y, e.z, EMTBlocks.electricCloud);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -91,8 +91,9 @@ item.EMT.focus.explosion.name=Wand Focus: Explosion
|
|||||||
item.EMT.focus.christmas.name=Wand Focus: Kris-tmas
|
item.EMT.focus.christmas.name=Wand Focus: Kris-tmas
|
||||||
item.EMT.focus.shield.name=Wand Focus: Shield
|
item.EMT.focus.shield.name=Wand Focus: Shield
|
||||||
item.EMT.focus.charge.name=Wand Focus: Charging
|
item.EMT.focus.charge.name=Wand Focus: Charging
|
||||||
item.EMT.focus.charge_wand.name=Wand Focus: Wand Charging
|
item.EMT.focus.chargeWand.name=Wand Focus: Wand Charging
|
||||||
item.EMT.focus.electricCloud.name=Electric Cloud
|
item.EMT.focus.electricCloud.name=Electric Cloud
|
||||||
|
item.EMT.focus.energyBall.name=Energy Ball Focus
|
||||||
|
|
||||||
#=============Block Names=============
|
#=============Block Names=============
|
||||||
tile.EMT.electricCloud.name=Electric Cloud
|
tile.EMT.electricCloud.name=Electric Cloud
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ item.EMT.focus.explosion.name=Набалдашник: Взрыв
|
|||||||
item.EMT.focus.christmas.name=Набалдашник: Рождество
|
item.EMT.focus.christmas.name=Набалдашник: Рождество
|
||||||
item.EMT.focus.shield.name=Набалдашник: Щит
|
item.EMT.focus.shield.name=Набалдашник: Щит
|
||||||
item.EMT.focus.charge.name=Набалдашник: Зарядка
|
item.EMT.focus.charge.name=Набалдашник: Зарядка
|
||||||
item.EMT.focus.charge_wand.name=Набалдашник: Зарядка жезла
|
item.EMT.focus.chargeWand.name=Набалдашник: Зарядка жезла
|
||||||
item.EMT.focus.energyBall.name=Набалдашник: Наэлектризованное облако
|
item.EMT.focus.energyBall.name=Набалдашник: Наэлектризованное облако
|
||||||
|
|
||||||
#=============Block Names=============
|
#=============Block Names=============
|
||||||
|
|||||||
Reference in new issue
Block a user