Changes...

This commit is contained in:
fewizz committed 2016-09-23 19:42:25 +03:00
1 parent 5cc45ee0cb
commit 3fcf1a13f4
10 files changed
+90 -33

No files matched your search

@@ -1,6 +1,9 @@
package emt.item.focus;
import emt.entity.EntityEnergyBall;
import ic2.api.item.ElectricItem;
import ic2.core.item.armor.ItemArmorElectric;
import ic2.core.item.armor.ItemArmorIC2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
@@ -30,12 +33,26 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
@Override
public ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer player, MovingObjectPosition mop) {
if (!world.isRemote) {
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
if (world.isRemote) {
return stack;
}
ItemStack armor = player.inventory.armorInventory[2];
if (armor == null) {
return stack;
}
double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false);
if (val < 5120) {
return stack;
}
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
return stack;
}