2015-01-11 21:05:28 -05:00
|
|
|
package WayofTime.alchemicalWizardry.common.omega;
|
|
|
|
|
2015-01-13 21:02:11 -05:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2015-01-11 21:05:28 -05:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-01-13 21:02:11 -05:00
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.potion.Potion;
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
2015-07-29 08:23:01 -04:00
|
|
|
import net.minecraft.util.BlockPos;
|
2015-01-13 21:02:11 -05:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
2015-01-11 21:05:28 -05:00
|
|
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
|
|
|
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
|
2015-01-13 21:02:11 -05:00
|
|
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock;
|
2015-01-11 21:05:28 -05:00
|
|
|
|
|
|
|
public class OmegaParadigmWater extends OmegaParadigm
|
|
|
|
{
|
|
|
|
public OmegaParadigmWater(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots)
|
|
|
|
{
|
2015-04-13 13:10:10 -04:00
|
|
|
super(ReagentRegistry.aquasalusReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 1, 10));
|
2015-01-11 21:05:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getCostPerTickOfUse(EntityPlayer player)
|
|
|
|
{
|
|
|
|
if(player.isInWater())
|
|
|
|
{
|
|
|
|
return 0.5f;
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2015-01-13 21:02:11 -05:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onUpdate(World world, EntityPlayer player, ItemStack stack)
|
|
|
|
{
|
2015-07-29 08:23:01 -04:00
|
|
|
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 3, 0, true, false));
|
|
|
|
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionAmphibian.id, 3, 0, true, false));
|
2015-04-13 13:10:10 -04:00
|
|
|
|
|
|
|
if(world.getWorldTime() % 100 == 0 && !world.isRemote)
|
|
|
|
{
|
|
|
|
if(player.isInWater() && player.getHealth() < player.getMaxHealth())
|
|
|
|
{
|
2015-07-29 08:23:01 -04:00
|
|
|
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0, true, false));
|
2015-04-13 13:10:10 -04:00
|
|
|
}
|
|
|
|
}
|
2015-01-13 21:02:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z)
|
|
|
|
{
|
|
|
|
if(entity instanceof EntityLivingBase)
|
|
|
|
{
|
2015-07-29 08:23:01 -04:00
|
|
|
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 1, true, false));
|
2015-01-13 21:02:11 -05:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack)
|
|
|
|
{
|
|
|
|
World world = player.worldObj;
|
|
|
|
|
|
|
|
int x = (int) Math.round(player.posX);
|
|
|
|
int y = (int) Math.round(player.posY);
|
|
|
|
int z = (int) Math.round(player.posZ);
|
|
|
|
|
|
|
|
int range = 3;
|
|
|
|
|
|
|
|
for(int i=-range; i<=range; i++)
|
|
|
|
{
|
|
|
|
for(int j=-range; j<=range; j++)
|
|
|
|
{
|
|
|
|
for(int k=-range; k<=range; k++)
|
|
|
|
{
|
2015-07-29 08:23:01 -04:00
|
|
|
TEMimicBlock.createMimicBlockAtLocation(world, new BlockPos(x+i, y+j, z+k), 300, Blocks.water.getDefaultState(), ReagentRegistry.aquasalusReagent);
|
2015-01-13 21:02:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-01-11 21:05:28 -05:00
|
|
|
}
|