fixed hoe, solars. Added new item.

This commit is contained in:
fewizz committed 2015-07-22 21:08:23 +03:00
1 parent 5419892c90
commit 96ebbf9d05
68 files changed
+222 -119

No files matched your search

@@ -36,7 +36,6 @@ public class EMTResearch {
public static void addResearch() {
ResearchItem research;
String text;
// String text2;
/** Research that can't be disabled **/
text = "1";
@@ -395,5 +394,9 @@ public class EMTResearch {
research = new EMTResearchItem("Quantum Wings", "EMT", ResearchAspects.quantumWing, 0, 8, 3, new ItemStack(ItemRegistry.quantumWing)).setParents("Nanosuit Wings").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(RecipeRegistry.quantumWings));
}
text = "1";
research = new EMTResearchItem("InfusedQuantumArmor", "EMT", ResearchAspects.quantumWing, 0, 10, 4, new ItemStack(ItemRegistry.quantumArmor)).setParents("Quantum Wings").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(RecipeRegistry.infusedQuantumArmor));
}
}
@@ -7,6 +7,8 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBow;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
@@ -106,9 +108,9 @@ public class ModelCpecialArmor extends ModelBiped
model.rotateAngleZ = z;
}
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
{
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, entity);
this.bipedBody.render(p_78088_7_);
this.bipedRightArm.render(p_78088_7_);
@@ -127,6 +129,11 @@ public class ModelCpecialArmor extends ModelBiped
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity)
{
EntityPlayer player = (EntityPlayer) entity;
if(player.inventory.getCurrentItem() != null)
this.heldItemRight = 1;
else
this.heldItemRight = 0;
this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F;
@@ -213,7 +220,7 @@ public class ModelCpecialArmor extends ModelBiped
this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
if (this.aimedBow)
if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ItemBow && player.isUsingItem())
{
f6 = 0.0F;
f7 = 0.0F;
@@ -166,7 +166,6 @@ public class RecipeRegistry {
public static void registerLateRecipes() {
/** Infusion Recipes **/
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", new ItemStack(ItemRegistry.thaumiumDrill), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", new ItemStack(ItemRegistry.thaumiumChainsaw), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
@@ -220,6 +219,8 @@ public class RecipeRegistry {
nanoWings = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Wings", new ItemStack(ItemRegistry.nanoWing), 4, CraftingAspects.nanoWing, new ItemStack(ItemRegistry.thaumiumWing), new ItemStack[]{IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), new ItemStack(IC2Items.getItem("nanoBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
quantumWings = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Wings", new ItemStack(ItemRegistry.quantumWing), 6, CraftingAspects.quantumWing, new ItemStack(ItemRegistry.nanoWing, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
infusedQuantumArmor = ThaumcraftApi.addInfusionCraftingRecipe("InfusedQuantumArmor", new ItemStack(ItemRegistry.quantumArmor), 5, CraftingAspects.quantumWing, new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(BlockRegistry.shield), new ItemStack(BlockRegistry.shield)});
/** Arcane Worktable Recipes **/
@@ -295,7 +296,7 @@ public class RecipeRegistry {
/** IC2 Stuff related recipes **/
/* Ore Clusters Macerator Recipes */
/* Ore Clusters Macerator Recipes */
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
ironClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)), null, ironClusterRecipe);
@@ -396,7 +397,7 @@ public class RecipeRegistry {
public static InfusionRecipe shardToRedstone;
public static InfusionRecipe shardToLapis;
public static InfusionRecipe glowstoneDustToBlock;
public static InfusionRecipe infusedQuantumArmor;
public static InfusionRecipe thaumiumDrill;
public static InfusionRecipe thaumiumChainsaw;
public static InfusionRecipe thaumicQuantumHelmet;
@@ -96,11 +96,6 @@ public class ItemEMTQuantum extends ItemArmorElectric {
icon4 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_q");
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamageForRenderPass(int par1, int par2) {
return getIconFromDamage(par1);
}
@SubscribeEvent
public void onEntityLivingFallEvent(LivingFallEvent event) {
if ((IC2.platform.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
@@ -116,15 +111,14 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
}
}
public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase entity, ItemStack armor, DamageSource source, double damage, int slot)
{
return super.getProperties(entity, armor, source, damage, slot);
}
public double getDamageAbsorptionRatio() {
return 1.1D;
}
private double getBaseAbsorptionRatio() {
return 0.15D;
}
public int getEnergyPerDamage() {
return 20000;
@@ -146,6 +140,12 @@ public class ItemEMTQuantum extends ItemArmorElectric {
boolean jetpack = nbtData.getBoolean("jetpack");
boolean hoverMode = nbtData.getBoolean("hoverMode");
boolean jetpackUsed = false;
String useother = nbtData.getString("useother");
if(!useother.equals("TW") && !useother.equals("NW") && !useother.equalsIgnoreCase("QW") && !useother.equals("Jetpack") && !useother.equals("None")){
nbtData.setString("useother", "None");
}
if ((IC2.keyboard.isJumpKeyDown(player)) && (IC2.keyboard.isModeSwitchKeyDown(player)) && (toggleTimer == 0)) {
toggleTimer = 30;
hoverMode = !hoverMode;
@@ -163,7 +163,7 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
if(player.inventory.getCurrentItem() != null){
if(IC2.keyboard.isSneakKeyDown(player) && (player.inventory.getCurrentItem().getUnlocalizedName().equals("ic2.itemArmorJetpackElectric")) && toggleTimer == 0){
if(IC2.keyboard.isSneakKeyDown(player) && (player.inventory.getCurrentItem().getUnlocalizedName().equals("ic2.itemArmorJetpackElectric")) && toggleTimer == 0 && nbtData.getString("useother").equals("None")){
toggleTimer = 30;
if (IC2.platform.isSimulating()) {
player.inventory.armorInventory[2].stackTagCompound.setBoolean("jetpack", true);
@@ -178,7 +178,7 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
if(player.inventory.getCurrentItem() != null){
if(IC2.keyboard.isSneakKeyDown(player) && (player.inventory.getCurrentItem().getUnlocalizedName().equals("item.EMT.wing.thaumium")) && toggleTimer == 0){
if(IC2.keyboard.isSneakKeyDown(player) && player.inventory.getCurrentItem().getItem() == ItemRegistry.thaumiumWing && toggleTimer == 0 && nbtData.getString("useother").equals("None")){
toggleTimer = 30;
if (IC2.platform.isSimulating()) {
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
@@ -191,12 +191,13 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
if(player.inventory.getCurrentItem() != null){
if(IC2.keyboard.isSneakKeyDown(player) && (player.inventory.getCurrentItem().getUnlocalizedName().equals("item.EMT.wing.nano")) && toggleTimer == 0){
if(IC2.keyboard.isSneakKeyDown(player) && player.inventory.getCurrentItem().getItem() == ItemRegistry.nanoWing && toggleTimer == 0 && nbtData.getString("useother").equals("None")){
toggleTimer = 30;
if (IC2.platform.isSimulating()) {
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
if(player.inventory.armorInventory[2] == itemStack){
player.inventory.armorInventory[2].stackTagCompound.setString("useother", "NW");
player.inventory.armorInventory[2].stackTagCompound.setInteger("NWCharge", (int) ElectricItem.manager.getCharge(player.inventory.getCurrentItem()));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
@@ -204,12 +205,13 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
if(player.inventory.getCurrentItem() != null){
if(IC2.keyboard.isSneakKeyDown(player) && (player.inventory.getCurrentItem().getUnlocalizedName().equals("item.EMT.wing.quantum")) && toggleTimer == 0){
if(IC2.keyboard.isSneakKeyDown(player) && player.inventory.getCurrentItem().getItem() == ItemRegistry.quantumWing && toggleTimer == 0 && nbtData.getString("useother").equals("None")){
toggleTimer = 30;
if (IC2.platform.isSimulating()) {
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
if(player.inventory.armorInventory[2] == itemStack){
player.inventory.armorInventory[2].stackTagCompound.setString("useother", "QW");
player.inventory.armorInventory[2].stackTagCompound.setInteger("QWCharge", (int) ElectricItem.manager.getCharge(player.inventory.getCurrentItem()));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
@@ -225,7 +227,10 @@ public class ItemEMTQuantum extends ItemArmorElectric {
jetpack = false;
player.inventory.armorInventory[2].stackTagCompound.setString("useother", "None");
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
ElectricItem.manager.charge(charged, player.inventory.armorInventory[2].stackTagCompound.getInteger("jetpackCharge"), player.inventory.armorInventory[2].stackTagCompound.getInteger("jetpackCharge"), true, false);
if(player.inventory.armorInventory[2].stackTagCompound.getInteger("jetpackCharge") > 50)
ElectricItem.manager.charge(charged, player.inventory.armorInventory[2].stackTagCompound.getInteger("jetpackCharge"), player.inventory.armorInventory[2].stackTagCompound.getInteger("jetpackCharge"), true, false);
else
ElectricItem.manager.charge(charged, 50, 50, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
@@ -238,13 +243,23 @@ public class ItemEMTQuantum extends ItemArmorElectric {
if(player.inventory.armorInventory[2].stackTagCompound.getString("useother").equals("NW")){
IC2.platform.messagePlayer(player, "Nano wings disabled.", new Object[0]);
player.inventory.armorInventory[2].stackTagCompound.setString("useother", "None");
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemRegistry.nanoWing));
ItemStack charged = new ItemStack(ItemRegistry.nanoWing);
if(player.inventory.armorInventory[2].stackTagCompound.getInteger("NWCharge") > 1)
ElectricItem.manager.charge(charged, player.inventory.armorInventory[2].stackTagCompound.getInteger("NWCharge"), player.inventory.armorInventory[2].stackTagCompound.getInteger("NWCharge"), true, false);
else
ElectricItem.manager.charge(charged, 1, 1, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
if(player.inventory.armorInventory[2].stackTagCompound.getString("useother").equals("QW")){
IC2.platform.messagePlayer(player, "Quantum wings disabled.", new Object[0]);
player.inventory.armorInventory[2].stackTagCompound.setString("useother", "None");
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemRegistry.quantumWing));
ItemStack charged = new ItemStack(ItemRegistry.quantumWing);
if(player.inventory.armorInventory[2].stackTagCompound.getInteger("QWCharge") > 1)
ElectricItem.manager.charge(charged, player.inventory.armorInventory[2].stackTagCompound.getInteger("QWCharge"), player.inventory.armorInventory[2].stackTagCompound.getInteger("QWCharge"), true, false);
else
ElectricItem.manager.charge(charged, 1, 1, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
}
}
@@ -255,20 +270,19 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
if ((player.inventory.armorInventory[2].stackTagCompound.getString("useother").equals("TW"))) {
useWings(player, itemStack, world, 0.15f, 0.8f, 0.5f);
useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, false);
}
if ((player.inventory.armorInventory[2].stackTagCompound.getString("useother").equals("NW"))) {
useWings(player, itemStack, world, 0.25f, 0.7f, 0.3f);
useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, true);
}
if ((player.inventory.armorInventory[2].stackTagCompound.getString("useother").equals("QW"))) {
useWings(player, itemStack, world, 0.33f, 0.6f, 0.3f);
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, true);
}
if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) {
toggleTimer = (byte) (toggleTimer - 1);
nbtData.setByte("toggleTimer", toggleTimer);
}
if ((IC2.platform.isRendering()) && (player == IC2.platform.getPlayerInstance())) {
@@ -291,9 +305,9 @@ public class ItemEMTQuantum extends ItemArmorElectric {
}
}
if(world.isRemote)
if(world.isRemote){
getIconIndex(itemStack);
}
ret = jetpackUsed;
player.extinguish();
@@ -308,20 +322,33 @@ public class ItemEMTQuantum extends ItemArmorElectric {
@SideOnly(Side.CLIENT)
@Override
public IIcon getIconIndex(ItemStack stack){
if((stack.stackTagCompound.getString("useother")).equals("Jetpack")){
return icon1;
try{
if((stack.stackTagCompound.getString("useother")).equals("Jetpack")){
return icon1;
}
if((stack.stackTagCompound.getString("useother")).equals("TW")){
return icon2;
}
if((stack.stackTagCompound.getString("useother")).equals("NW")){
return icon3;
}
if((stack.stackTagCompound.getString("useother")).equals("QW")){
return icon4;
}
}
if((stack.stackTagCompound.getString("useother")).equals("TW")){
return icon2;
}
if((stack.stackTagCompound.getString("useother")).equals("NW")){
return icon3;
}
if((stack.stackTagCompound.getString("useother")).equals("QW")){
return icon4;
catch(Exception ex){
return icon0;
}
return icon0;
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIconFromDamage(int par1)
{
return icon0;
}
@Override
public int getItemEnchantability() {
@@ -347,7 +374,7 @@ public class ItemEMTQuantum extends ItemArmorElectric {
if((stack.stackTagCompound.getString("useother")).equals("QW")){
return ModInformation.texturePath + ":textures/models/quantum_wings_q.png";
}
return super.getArmorTexture(stack, entity, slot, type);
return ModInformation.texturePath + ":textures/models/quantum.png";
}
@Override
@@ -371,6 +398,12 @@ public class ItemEMTQuantum extends ItemArmorElectric {
if((stack.stackTagCompound.getString("useother")).equals("Jetpack")){
list.add((stack.stackTagCompound.getInteger("jetpackCharge")) + " EU JETPACK");
}
if((stack.stackTagCompound.getString("useother")).equals("NW")){
list.add((stack.stackTagCompound.getInteger("NWCharge")) + " EU NW");
}
if((stack.stackTagCompound.getString("useother")).equals("QW")){
list.add((stack.stackTagCompound.getInteger("QWCharge")) + " EU QW");
}
}
public boolean useJetpack(EntityPlayer player, boolean hoverMode, ItemStack stack) {
@@ -433,35 +466,39 @@ public class ItemEMTQuantum extends ItemArmorElectric {
return true;
}
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1){
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, boolean isElectric){
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
if(nbtData.getBoolean("isJumping")){
nbtData.setBoolean("isHolding", true);
f += 1;
if(f > 7) f = 7;
}
else if(nbtData.getBoolean("isHolding")){
nbtData.setBoolean("isHolding", false);
player.motionY = motionY * f;
player.motionX /= motionXZ;
player.motionZ /= motionXZ;
f = 0;
}
if((nbtData.getString("useother").equals("NW") && nbtData.getInteger("NWCharge") > 0) || (nbtData.getString("useother").equals("QW") && nbtData.getInteger("QWCharge") > 0) || nbtData.getString("useother").equals("TW")){
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
if(nbtData.getBoolean("isJumping")){
nbtData.setBoolean("isHolding", true);
nbtData.setInteger("f", nbtData.getInteger("f") + 1);
if(nbtData.getInteger("f") > 7) nbtData.setInteger("f", 7);
}
else if(nbtData.getBoolean("isHolding")){
nbtData.setBoolean("isHolding", false);
player.motionY = motionY * nbtData.getInteger("f");
player.motionX /= motionXZ;
player.motionZ /= motionXZ;
world.playSoundEffect(player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, "mob.ghast.fireball", 1.0F, 0.7F + 0.3F);
nbtData.setInteger("f", 0);
}
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
player.motionY *= f1;
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0)
player.motionY *= f1;
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
}
}
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
if (player.fallDistance > 0.0F) player.fallDistance = 0;
if (player.fallDistance > 0.0F) player.fallDistance = 0;
}
}
}
@@ -41,7 +41,6 @@ public class ItemFeatherWing extends ItemArmor {
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if(stack.stackTagCompound.getBoolean("isJumping")){ return ModInformation.texturePath + ":textures/models/quantumwing.png";}
return ModInformation.texturePath + ":textures/models/featherwing.png";
}
@@ -68,19 +67,20 @@ public class ItemFeatherWing extends ItemArmor {
if(nbtData.getBoolean("isJumping")){
nbtData.setBoolean("isHolding", true);
f += 1;
if(f > 7) f = 7;
nbtData.setInteger("f", nbtData.getInteger("f") + 1);
if(nbtData.getInteger("f") > 7) nbtData.setInteger("f", 7);
}
else if(nbtData.getBoolean("isHolding")){
nbtData.setBoolean("isHolding", false);
player.motionY = motionY * f;
player.motionY = motionY * nbtData.getInteger("f");
player.motionX /= motionXZ;
player.motionZ /= motionXZ;
f = 0;
world.playSoundEffect(player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, "mob.ghast.fireball", 1.0F, 0.7F + 0.3F);
nbtData.setInteger("f", 0);
}
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0)
player.motionY *= f1;
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
@@ -66,7 +66,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.updateWings(player, stack, world, 0.25f, 0.7f, 0.3f);
this.updateWings(player, stack, world, 0.25f, 0.6f, 0.3f);
}
@Override
@@ -39,6 +39,6 @@ public class ItemQuantumWing extends ItemNanoWing {
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.updateWings(player, stack, world, 0.33f, 0.6f, 0.3f);
this.updateWings(player, stack, world, 0.33f, 0.5f, 0.2f);
}
}
@@ -57,39 +57,6 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.updateWings(player, stack, world, 0.15f, 0.8f, 0.5f);
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
if (world.isRemote) {
if(nbtData.getBoolean("isJumping")){
nbtData.setBoolean("isHolding", true);
f += 1;
if(f > 7) f = 7;
}
else if(nbtData.getBoolean("isJumping")){
nbtData.setBoolean("isHolding", false);
player.motionY = 0.15 * f;
player.motionX /= 0.8;
player.motionZ /= 0.8;
f = 0;
}
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
player.motionY *= 0.5;
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
}
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
}
if (player.fallDistance > 0.0F) player.fallDistance = 0;
this.updateWings(player, stack, world, 0.15f, 0.7f, 0.5f);
}
}
@@ -16,16 +16,27 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.blocks.BlockCustomPlant;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.items.equipment.ItemElementalHoe;
import thaumcraft.common.lib.utils.Utils;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import java.util.List;
public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectricItem {
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
public IIcon icon;
public int maxCharge = 1000000;
@@ -36,14 +47,13 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
super(ToolMaterial.EMERALD);
this.setCreativeTab(ElectroMagicTools.tabEMT);
this.setMaxStackSize(1);
this.growthCost = 10000;
}
// Why this no work? :(
// @SideOnly(Side.CLIENT)
// @Override
// public void registerIcons(IIconRegister iconRegister) {
// this.icon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/hoe_growth");
// }
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.icon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/hoe_growth");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
@@ -58,17 +68,77 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
return this.icon;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
{
if(ElectricItem.manager.getCharge(stack) > 10000){
boolean did = false;
for (int x1 = -1; x1 <= 1; x1++) {
for (int z1 = -1; z1 <= 1; z1++) {
if (super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10))
{
ElectricItem.manager.discharge(stack, 250, 2, true, false, false);
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
if (!did) {
did = true;
}
}
}
}
if (!did)
{
did = Utils.useBonemealAtLoc(world, player, x, y, z);
if (!did)
{
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if ((block == ConfigBlocks.blockCustomPlant) && (meta == 0) && (ElectricItem.manager.getCharge(stack) + 20 <= this.getMaxCharge(stack)))
{
((BlockCustomPlant)block).growGreatTree(world, x, y, z, world.rand);
ElectricItem.manager.discharge(stack, 50, 2, true, false, false);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
did = true;
}
else if ((block == ConfigBlocks.blockCustomPlant) && (meta == 1) && (ElectricItem.manager.getCharge(stack) + 150 <= this.getMaxCharge(stack)))
{
((BlockCustomPlant)block).growSilverTree(world, x, y, z, world.rand);
ElectricItem.manager.discharge(stack, 250, 2, true, false, false);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
did = true;
}
}
else
{
ElectricItem.manager.discharge(stack, 1, 2, true, false, false);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
}
if (did) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F);
}
}
return did;
}
else
return false;
}
/* IC2 API METHODS */
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
return true;
}
@Override
@@ -78,7 +148,7 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
@Override
public int getTier(ItemStack itemStack) {
return 3;
return 1;
}
@Override
@@ -88,7 +158,7 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
return this;
}
@Override
@@ -10,7 +10,7 @@ import java.util.Random;
public abstract class TileEntitySolarBase extends TileEntityEMT implements IWrenchable {
public BasicSource energySource = new BasicSource(this, 10000, 1);
public BasicSource energySource= new BasicSource(this, 10000, 4);
public static Random random = new Random();
public boolean initialized;
public boolean theSunIsVisible;
@@ -12,6 +12,7 @@
package tombenpotter.emt.common.tile.solars.air;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import tombenpotter.emt.common.blocks.BlockRegistry;
@@ -12,6 +12,7 @@
package tombenpotter.emt.common.tile.solars.air;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import tombenpotter.emt.common.blocks.BlockRegistry;
@@ -12,6 +12,7 @@
package tombenpotter.emt.common.tile.solars.air;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import tombenpotter.emt.common.blocks.BlockRegistry;
@@ -19,7 +19,9 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.item.ItemEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import thaumcraft.common.entities.monster.EntityTaintChicken;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
@@ -67,4 +69,9 @@ public class EventHandlerEMT {
}
}
}
@SubscribeEvent
public void breaktool(PlayerDestroyItemEvent event){
event.entityPlayer.stopUsingItem();
}
}