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

@@ -37,6 +37,7 @@ public class EntityShield extends Entity {
@Override
protected void entityInit() {
this.dataWatcher.addObject(11, "");
}
@Override
+6
View File
@@ -5,6 +5,8 @@ import cpw.mods.fml.common.registry.GameRegistry;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTCraftingAspects;
import emt.util.EMTResearchAspects;
import static emt.util.EMTRandomHelper.*;
import ic2.api.item.ElectricItem;
import ic2.api.item.IC2Items;
@@ -227,6 +229,9 @@ public class EMTRecipes {
wandChargeFocus = addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(EMTItems.wandChargeFocus), 5, EMTCraftingAspects.wandChargeFocus, new ItemStack(EMTBlocks.emtMachines, 1, 0),
new ItemStack[] { new ItemStack(EMTItems.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate") });
energyBallFocus = addInfusionCraftingRecipe("Wand Focus: Energy Ball", new ItemStack(EMTItems.energyBallFocus), 4, EMTResearchAspects.energyBallFocusResearch, new ItemStack(ConfigItems.itemFocusShock),
new ItemStack[] { new ItemStack(Blocks.tnt), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem())});
inventoryChargingRing = addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(EMTItems.emtBauble, 1, 1), 6, EMTCraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1),
new ItemStack[] { new ItemStack(EMTItems.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), ic2.core.Ic2Items.WindKineticGenerator, ic2.core.Ic2Items.WaterKineticGenerator, IC2Items.getItem("nuclearReactor") });
@@ -448,6 +453,7 @@ public class EMTRecipes {
public static InfusionRecipe electricHoeGrowth;
public static InfusionRecipe chargeFocus;
public static InfusionRecipe wandChargeFocus;
public static InfusionRecipe energyBallFocus;
public static InfusionRecipe inventoryChargingRing;
public static InfusionRecipe armorChargingRing;
public static InfusionRecipe nanoWings;
+1 -1
View File
@@ -94,7 +94,7 @@ public class EMTResearches {
}
if (!EMTConfigHandler.energyBallFocusResearch) {
new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus));
}
if (!EMTConfigHandler.shieldFocusResearch) {
@@ -111,7 +111,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
@SubscribeEvent
public void onEntityLivingFallEvent(LivingFallEvent event) {
if ((IC2.platform.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
EntityLivingBase entity = (EntityLivingBase) event.entity;
ItemStack armor = entity.getEquipmentInSlot(1);
@@ -162,7 +162,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
}
ItemStack currentStack = player.inventory.getCurrentItem();
Item currentItem = currentStack == null ? null : player.inventory.getCurrentItem().getItem();
Item currentItem = currentStack == null ? null : currentStack.getItem();
if (nbt.hasKey("useother")) {
String useother = nbt.getString("useother");
@@ -182,11 +182,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
nbt.removeTag("useother");
}
if (wing == 0) {
if (wing == NONE) {
nbt.setByte("wing", NONE);
}
if ((IC2.keyboard.isJumpKeyDown(player)) && (IC2.keyboard.isModeSwitchKeyDown(player)) && (toggleTimer == 0)) {
if (IC2.keyboard.isJumpKeyDown(player) && IC2.keyboard.isModeSwitchKeyDown(player) && toggleTimer == 0) {
toggleTimer = 30;
hoverMode = !hoverMode;
if (IC2.platform.isSimulating()) {
@@ -204,11 +204,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
if (currentItem == IC2Items.getItem("electricJetpack").getItem()) {
IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]);
nbt.setByte("wing", JETPACK);
int charge = (int) ElectricItem.manager.getCharge(itemStack);
if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player);
}
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack))*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
@@ -221,22 +221,22 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
else if (currentItem == EMTItems.nanoWing) {
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
nbt.setByte("wing", NANO);
int charge = (int) ElectricItem.manager.getCharge(itemStack);
if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
}
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem())/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
else if (currentItem == EMTItems.quantumWing) {
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
nbt.setByte("wing", QUANTUM);
int charge = (int) ElectricItem.manager.getCharge(itemStack);
if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
}
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
@@ -298,11 +298,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
if (wing == QUANTUM)
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) {
if (IC2.platform.isSimulating() && toggleTimer > 0) {
toggleTimer = (byte) (toggleTimer - 1);
nbt.setByte("toggleTimer", toggleTimer);
}
if ((IC2.platform.isRendering()) && (player == IC2.platform.getPlayerInstance())) {
if (IC2.platform.isRendering() && player == IC2.platform.getPlayerInstance()) {
if (lastJetpackUsed != jetpackUsed) {
if (jetpackUsed) {
if (audioSource == null) {
@@ -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;
}
@@ -10,18 +10,25 @@ import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
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.network.PacketEMTKeys;
import emt.proxy.ClientProxy;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.entities.monster.EntityTaintChicken;
public class EMTEventHandler {
@@ -63,4 +70,30 @@ public class EMTEventHandler {
}
}
@SubscribeEvent
public void createCloud(PlayerInteractEvent e) {
if(e.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK || e.world.isRemote) {
return;
}
Block block = e.world.getBlock(e.x, e.y, e.z);
int meta = e.world.getBlockMetadata(e.x, e.y, e.z);
if(block != ConfigBlocks.blockAiry || meta != 1) {
return;
}
ItemStack currentStack = e.entityPlayer.inventory.getCurrentItem();
if(currentStack == null) {
return;
}
double val = ElectricItem.manager.discharge(currentStack, 256, 4, false, true, false);
if(val < 256) {
return;
}
e.world.setBlock(e.x, e.y, e.z, EMTBlocks.electricCloud);
}
}
@@ -13,7 +13,7 @@ public class EMTResearchAspects {
public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6);
public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3);
public static AspectList christmasFocusResearch = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6).add(Aspect.DEATH, 2);
public static AspectList energyBallFocusResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6);
public static AspectList energyBallFocusResearch = new AspectList().add(Aspect.ENERGY, 10).add(Aspect.MAGIC, 5).add(Aspect.LIFE, 6);
public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2);
public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6);
public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3);