diff --git a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index aec0c335..2f387e4b 100644 --- a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -109,7 +109,7 @@ import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.0.0") +@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.0.0b") @NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class) public class AlchemicalWizardry @@ -1057,8 +1057,8 @@ public class AlchemicalWizardry AlchemyRecipeRegistry.registerRecipe(new ItemStack(Block.obsidian), 1, new ItemStack[]{waterBucketStack,lavaBucketStack}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Item.paper), 1, new ItemStack[]{new ItemStack(Item.reed)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Block.slowSand,3,0), 3, new ItemStack[]{new ItemStack(Block.sand),new ItemStack(Block.sand),new ItemStack(Block.sand),waterBucketStack,weakBloodShardStack}, 3); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(Block.mycelium,1,0), 5, new ItemStack[]{new ItemStack(Block.grass),new ItemStack(Block.mushroomCapBrown), new ItemStack(Block.mushroomCapRed)}, 2); - + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Block.mycelium,1,0), 5, new ItemStack[]{new ItemStack(Block.grass),new ItemStack(Block.mushroomBrown), new ItemStack(Block.mushroomRed)}, 2); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(Block.ice), 2, new ItemStack[]{waterBucketStack,new ItemStack(Item.snowball)}, 1); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/BM_src/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index ef7ee1b8..ccb57bea 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; @@ -23,6 +24,8 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import cpw.mods.fml.common.network.PacketDispatcher; public class AlchemicalWizardryEventHooks { @@ -53,6 +56,10 @@ public class AlchemicalWizardryEventHooks public void onEntityDamaged(LivingAttackEvent event) { EntityLivingBase entityAttacked = event.entityLiving; + EntityLivingBase entity = event.entityLiving; + double posX = entity.posX; + double posY = entity.posY; + double posZ = entity.posZ; if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionReciprocation)) { @@ -78,6 +85,30 @@ public class AlchemicalWizardryEventHooks entityAttacking.setFire(3); } } + + //TODO Make this work for a different potion +// if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable()) +// { +// if(event.ammount>event.entityLiving.getHealth()) +// { +// int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionPlanarBinding).getAmplifier(); +// +// event.setCanceled(true); +// +// if(event.entityLiving.worldObj.rand.nextFloat()>((i+1)/6)) +// { +// event.entityLiving.removePotionEffect(AlchemicalWizardry.customPotionPlanarBinding.id); +// } +// +// for(int j=0; j<10; j++) +// { +// PacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 20, entity.worldObj.provider.dimensionId, TEAltar.getParticlePacket(posX, posY, posZ, (short) 4)); +// } +// event.entityLiving.worldObj.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (entity.worldObj.rand.nextFloat() - entity.worldObj.rand.nextFloat()) * 0.8F); +// +// event.entityLiving.heal(20); +// } +// } } // @ForgeSubscribe @@ -121,7 +152,7 @@ public class AlchemicalWizardryEventHooks { int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier(); - if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0) + if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0 && !event.entityLiving.isPotionActive(Potion.waterBreathing)) { event.entityLiving.attackEntityFrom(DamageSource.drown, 2); event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1)); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java b/BM_src/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java index 36fb6c2f..aabb92cb 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/alchemy/AlchemicalPotionCreationHandler.java @@ -17,6 +17,7 @@ public class AlchemicalPotionCreationHandler addPotion(new ItemStack(Item.ghastTear), Potion.regeneration.id, 450); addPotion(new ItemStack(Item.goldenCarrot), Potion.nightVision.id, 2 * 60 * 20); addPotion(new ItemStack(Item.magmaCream), Potion.fireResistance.id, 2 * 60 * 20); + addPotion(new ItemStack(Item.bucketWater), Potion.waterBreathing.id, 2 * 60 * 20); addPotion(new ItemStack(Item.sugar), Potion.moveSpeed.id, 2 * 60 * 20); addPotion(new ItemStack(Item.speckledMelon), Potion.heal.id, 2 * 60 * 20); addPotion(new ItemStack(Item.spiderEye), Potion.poison.id, 450); @@ -35,6 +36,7 @@ public class AlchemicalPotionCreationHandler addPotion(new ItemStack(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 1 * 60 * 20); addPotion(new ItemStack(Item.feather), AlchemicalWizardry.customPotionFlight.id, 1 * 60 * 20); addPotion(new ItemStack(Item.arrow), AlchemicalWizardry.customPotionReciprocation.id, 1 * 60 * 20); + addPotion(new ItemStack(Item.enderPearl),AlchemicalWizardry.customPotionPlanarBinding.id,1*60*20); } public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) diff --git a/BM_src/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/BM_src/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java index bf3d50b6..3789195a 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -110,18 +110,9 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile //doDamage(8 + d6(), mop); if (mop instanceof EntityLivingBase) { - //((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2)); - ((EntityLivingBase) mop).setFire(50); - ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); - - if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire()) - { - ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); - } else - { - doDamage(projectileDamage, mop); - ((EntityLivingBase) mop).hurtResistantTime = 0; - } + + ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + } //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/items/EnergyItems.java b/BM_src/WayofTime/alchemicalWizardry/common/items/EnergyItems.java index ef7ef76b..dba7a7ba 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/items/EnergyItems.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/EnergyItems.java @@ -60,9 +60,10 @@ public class EnergyItems extends Item implements IBindable //player.setEntityHealth((player.getHealth()-1)); player.setHealth((player.getHealth() - 1)); - if (player.getHealth() <= 0) + if (player.getHealth() <= 0.0005) { player.inventory.dropAllItems(); + break; } } } @@ -217,9 +218,10 @@ public class EnergyItems extends Item implements IBindable //player.setEntityHealth((player.getHealth()-1)); user.setHealth((user.getHealth() - 1)); - if (user.getHealth() <= 0.1f) + if (user.getHealth() <= 0.0005f) { user.onDeath(DamageSource.generic); + } } } else if (energySyphoned >= 100) @@ -231,9 +233,10 @@ public class EnergyItems extends Item implements IBindable //player.setEntityHealth((player.getHealth()-1)); user.setHealth((user.getHealth() - 1)); - if (user.getHealth() <= 0.1f) + if (user.getHealth() <= 0.0005f) { user.onDeath(DamageSource.generic); + break; } } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java b/BM_src/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java index 9f76a671..4d85f018 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/sigil/ItemBloodLightSigil.java @@ -117,7 +117,7 @@ public class ItemBloodLightSigil extends EnergyItems if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10)); + par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 1)); } return par1ItemStack; diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java index 7d82d9d7..16319934 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellHelper.java @@ -180,7 +180,8 @@ public class SpellHelper public static void evaporateWaterBlock(World world, int posX, int posY, int posZ) { - Block block = Block.blocksList[world.getBlockId(posX, posY, posZ)]; + int id = world.getBlockId(posX, posY, posZ); + Block block = Block.blocksList[id]; if(block == Block.waterMoving || block == Block.waterStill) { @@ -194,15 +195,17 @@ public class SpellHelper if(oreName.contains("ore")) { - String lowercaseOre = oreName; - lowercaseOre.toLowerCase(); + String lowercaseOre = oreName.toLowerCase(); boolean isAllowed = false; - + for(String str : AlchemicalWizardry.allowedCrushedOresArray) - { - if(lowercaseOre.contains(str)) + { + String testStr = str.toLowerCase(); + + if(lowercaseOre.contains(testStr)) { isAllowed = true; + break; } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java index 28bd2dd1..4d523a0a 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/earth/MeleeDefaultEarth.java @@ -28,6 +28,10 @@ public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect if(!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getBlockTileEntity(posX + i, posY + j, posZ + k)==null) { int id = world.getBlockId(posX + i, posY + j, posZ + k); + if(Block.blocksList[id].getBlockHardness(world, posX + i, posY + j, posZ + k)==-1) + { + continue; + } int meta = world.getBlockMetadata(posX + i, posY + j, posZ + k); EntityFallingSand entity = new EntityFallingSand(world, posX + i + 0.5f, posY + j + 0.5f, posZ + k + 0.5f, id, meta); @@ -36,6 +40,5 @@ public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect } } } - } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java index bd7ba401..74dd6e13 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/wind/SelfOffensiveWind.java @@ -23,11 +23,9 @@ public class SelfOffensiveWind extends SelfSpellEffect public void onSelfUse(World world, EntityPlayer player) { Vec3 vec = player.getLookVec(); - double wantedVelocity = 1.2 + this.powerUpgrades*0.3; + double wantedVelocity = 1.5 + this.powerUpgrades*0.4; - player.motionX = vec.xCoord * wantedVelocity; - player.motionY = vec.yCoord * wantedVelocity; - player.motionZ = vec.zCoord * wantedVelocity; + SpellHelper.setPlayerSpeedFromServer(player, vec.xCoord * wantedVelocity, vec.yCoord * wantedVelocity, vec.zCoord * wantedVelocity); player.fallDistance = 0; }