Anti-comments sweep!

This commit is contained in:
Tombenpotter 2014-10-13 22:33:20 +02:00
parent e6a10f3f06
commit dea1f87078
454 changed files with 23594 additions and 26739 deletions

View file

@ -1,30 +1,25 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class RitualEffectInterdiction extends RitualEffect
{
public static final int aetherDrain = 1;
public static final int magicalesDrain = 1;
public static final int aetherDrain = 1;
public static final int magicalesDrain = 1;
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
@ -43,15 +38,15 @@ public class RitualEffectInterdiction extends RitualEffect
{
int d0 = 5;
List<EntityLivingBase> list = SpellHelper.getLivingEntitiesInRange(world, x+0.5, y+0.5, z+0.5, d0, d0);
List<EntityLivingBase> list = SpellHelper.getLivingEntitiesInRange(world, x + 0.5, y + 0.5, z + 0.5, d0, d0);
boolean flag = false;
boolean hasOffensa = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false);
boolean playerFlag = false;
for(EntityLivingBase entityLiving : list)
for (EntityLivingBase entityLiving : list)
{
if (!((!hasOffensa && entityLiving instanceof EntityPlayer) && (SpellHelper.getUsername((EntityPlayer)entityLiving).equals(owner))))
if (!((!hasOffensa && entityLiving instanceof EntityPlayer) && (SpellHelper.getUsername((EntityPlayer) entityLiving).equals(owner))))
{
double xDif = entityLiving.posX - x;
double yDif = entityLiving.posY - (y + 1);
@ -59,65 +54,59 @@ public class RitualEffectInterdiction extends RitualEffect
entityLiving.motionX = 0.1 * xDif;
entityLiving.motionY = 0.1 * yDif;
entityLiving.motionZ = 0.1 * zDif;
if(hasOffensa && entityLiving instanceof EntityPlayer)
if (hasOffensa && entityLiving instanceof EntityPlayer)
{
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityLiving, 0.1 * xDif, 0.1 * yDif, 0.1 * zDif);
playerFlag = true;
SpellHelper.setPlayerSpeedFromServer((EntityPlayer) entityLiving, 0.1 * xDif, 0.1 * yDif, 0.1 * zDif);
playerFlag = true;
}
entityLiving.fallDistance = 0;
flag = true;
//entityLiving.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
}
}
if(playerFlag)
if (playerFlag)
{
this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true);
this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, true);
}
boolean hasAether = this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, false);
if(hasAether)
if (hasAether)
{
int aetherDrainRate = 10;
int horizontalRadius = 5;
int verticalRadius = 5;
List<EntityItem> itemList = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(horizontalRadius, verticalRadius, horizontalRadius));
if(itemList != null)
{
boolean itemFlag = false;
for(EntityItem entity : itemList)
{
double xDif = entity.posX - x;
int aetherDrainRate = 10;
int horizontalRadius = 5;
int verticalRadius = 5;
List<EntityItem> itemList = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(horizontalRadius, verticalRadius, horizontalRadius));
if (itemList != null)
{
boolean itemFlag = false;
for (EntityItem entity : itemList)
{
double xDif = entity.posX - x;
double yDif = entity.posY - (y + 1);
double zDif = entity.posZ - z;
entity.motionX = 0.1 * xDif;
entity.motionY = 0.1 * yDif;
entity.motionZ = 0.1 * zDif;
itemFlag = true;
}
if(itemFlag)
{
flag = true;
if(world.getWorldTime() % aetherDrainRate == 0)
{
this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true);
}
}
}
}
if (itemFlag)
{
flag = true;
if (world.getWorldTime() % aetherDrainRate == 0)
{
this.canDrainReagent(ritualStone, ReagentRegistry.aetherReagent, aetherDrain, true);
}
}
}
}
if (world.getWorldTime() % 2 == 0 && flag)
{
@ -133,9 +122,9 @@ public class RitualEffectInterdiction extends RitualEffect
}
@Override
public List<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> interdictionRitual = new ArrayList();
public List<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> interdictionRitual = new ArrayList();
interdictionRitual.add(new RitualComponent(1, 0, 0, 4));
interdictionRitual.add(new RitualComponent(-1, 0, 0, 4));
interdictionRitual.add(new RitualComponent(0, 0, 1, 4));
@ -145,5 +134,5 @@ public class RitualEffectInterdiction extends RitualEffect
interdictionRitual.add(new RitualComponent(-1, 0, -1, 4));
interdictionRitual.add(new RitualComponent(1, 0, -1, 4));
return interdictionRitual;
}
}
}