Late git push is late

This commit is contained in:
WayofTime 2014-04-01 20:29:02 -04:00
parent b962ede72d
commit a1ca81423b
9 changed files with 62 additions and 31 deletions

View file

@ -109,7 +109,7 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry; 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) @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 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(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(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.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);

View file

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile; import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer; 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.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import cpw.mods.fml.common.network.PacketDispatcher;
public class AlchemicalWizardryEventHooks public class AlchemicalWizardryEventHooks
{ {
@ -53,6 +56,10 @@ public class AlchemicalWizardryEventHooks
public void onEntityDamaged(LivingAttackEvent event) public void onEntityDamaged(LivingAttackEvent event)
{ {
EntityLivingBase entityAttacked = event.entityLiving; 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)) if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionReciprocation))
{ {
@ -78,6 +85,30 @@ public class AlchemicalWizardryEventHooks
entityAttacking.setFire(3); 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 // @ForgeSubscribe
@ -121,7 +152,7 @@ public class AlchemicalWizardryEventHooks
{ {
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier(); 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.attackEntityFrom(DamageSource.drown, 2);
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1)); event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1));

View file

@ -17,6 +17,7 @@ public class AlchemicalPotionCreationHandler
addPotion(new ItemStack(Item.ghastTear), Potion.regeneration.id, 450); addPotion(new ItemStack(Item.ghastTear), Potion.regeneration.id, 450);
addPotion(new ItemStack(Item.goldenCarrot), Potion.nightVision.id, 2 * 60 * 20); 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.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.sugar), Potion.moveSpeed.id, 2 * 60 * 20);
addPotion(new ItemStack(Item.speckledMelon), Potion.heal.id, 2 * 60 * 20); addPotion(new ItemStack(Item.speckledMelon), Potion.heal.id, 2 * 60 * 20);
addPotion(new ItemStack(Item.spiderEye), Potion.poison.id, 450); 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(ModItems.terrae), AlchemicalWizardry.customPotionBoost.id, 1 * 60 * 20);
addPotion(new ItemStack(Item.feather), AlchemicalWizardry.customPotionFlight.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.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) public static void addPotion(ItemStack itemStack, int potionID, int tickDuration)

View file

@ -110,18 +110,9 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
//doDamage(8 + d6(), mop); //doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase) if (mop instanceof EntityLivingBase)
{ {
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
((EntityLivingBase) mop).setFire(50); ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
((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;
}
} }
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true); //worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);

View file

@ -60,9 +60,10 @@ public class EnergyItems extends Item implements IBindable
//player.setEntityHealth((player.getHealth()-1)); //player.setEntityHealth((player.getHealth()-1));
player.setHealth((player.getHealth() - 1)); player.setHealth((player.getHealth() - 1));
if (player.getHealth() <= 0) if (player.getHealth() <= 0.0005)
{ {
player.inventory.dropAllItems(); player.inventory.dropAllItems();
break;
} }
} }
} }
@ -217,9 +218,10 @@ public class EnergyItems extends Item implements IBindable
//player.setEntityHealth((player.getHealth()-1)); //player.setEntityHealth((player.getHealth()-1));
user.setHealth((user.getHealth() - 1)); user.setHealth((user.getHealth() - 1));
if (user.getHealth() <= 0.1f) if (user.getHealth() <= 0.0005f)
{ {
user.onDeath(DamageSource.generic); user.onDeath(DamageSource.generic);
} }
} }
} else if (energySyphoned >= 100) } else if (energySyphoned >= 100)
@ -231,9 +233,10 @@ public class EnergyItems extends Item implements IBindable
//player.setEntityHealth((player.getHealth()-1)); //player.setEntityHealth((player.getHealth()-1));
user.setHealth((user.getHealth() - 1)); user.setHealth((user.getHealth() - 1));
if (user.getHealth() <= 0.1f) if (user.getHealth() <= 0.0005f)
{ {
user.onDeath(DamageSource.generic); user.onDeath(DamageSource.generic);
break;
} }
} }
} }

View file

@ -117,7 +117,7 @@ public class ItemBloodLightSigil extends EnergyItems
if (!par2World.isRemote) if (!par2World.isRemote)
{ {
par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10)); par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 1));
} }
return par1ItemStack; return par1ItemStack;

View file

@ -180,7 +180,8 @@ public class SpellHelper
public static void evaporateWaterBlock(World world, int posX, int posY, int posZ) 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) if(block == Block.waterMoving || block == Block.waterStill)
{ {
@ -194,15 +195,17 @@ public class SpellHelper
if(oreName.contains("ore")) if(oreName.contains("ore"))
{ {
String lowercaseOre = oreName; String lowercaseOre = oreName.toLowerCase();
lowercaseOre.toLowerCase();
boolean isAllowed = false; boolean isAllowed = false;
for(String str : AlchemicalWizardry.allowedCrushedOresArray) for(String str : AlchemicalWizardry.allowedCrushedOresArray)
{ {
if(lowercaseOre.contains(str)) String testStr = str.toLowerCase();
if(lowercaseOre.contains(testStr))
{ {
isAllowed = true; isAllowed = true;
break;
} }
} }

View file

@ -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) 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); 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); 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); 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
} }
} }
} }
} }
} }

View file

@ -23,11 +23,9 @@ public class SelfOffensiveWind extends SelfSpellEffect
public void onSelfUse(World world, EntityPlayer player) public void onSelfUse(World world, EntityPlayer player)
{ {
Vec3 vec = player.getLookVec(); 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; SpellHelper.setPlayerSpeedFromServer(player, vec.xCoord * wantedVelocity, vec.yCoord * wantedVelocity, vec.zCoord * wantedVelocity);
player.motionY = vec.yCoord * wantedVelocity;
player.motionZ = vec.zCoord * wantedVelocity;
player.fallDistance = 0; player.fallDistance = 0;
} }