Created all code necessary to summon the portal. I'm awesome, I know.

This commit is contained in:
WayofTime 2014-12-04 14:31:31 -05:00
parent 832ed15060
commit 9b0fa9b052
37 changed files with 915 additions and 89 deletions

View file

@ -22,6 +22,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.IDemon;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
@ -72,6 +73,13 @@ public class DaggerOfSacrifice extends EnergyItems
return false;
}
if(par2EntityLivingBase instanceof IDemon)
{
System.out.println("Demon");
((IDemon)par2EntityLivingBase).setDropCrystal(false);
this.findAndNotifyAltarOfDemon(world, par2EntityLivingBase);
}
if (par2EntityLivingBase instanceof EntityVillager && !par2EntityLivingBase.isChild())
{
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 2000))
@ -151,6 +159,8 @@ public class DaggerOfSacrifice extends EnergyItems
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, 500))
{
double posX = par2EntityLivingBase.posX;
double posY = par2EntityLivingBase.posY;
double posZ = par2EntityLivingBase.posZ;
@ -200,7 +210,6 @@ public class DaggerOfSacrifice extends EnergyItems
}
@Override
public Multimap getItemAttributeModifiers()
{
Multimap multimap = super.getItemAttributeModifiers();
@ -208,6 +217,23 @@ public class DaggerOfSacrifice extends EnergyItems
return multimap;
}
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice)
{
int posX = (int) Math.round(sacrifice.posX - 0.5f);
int posY = (int) sacrifice.posY;
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
TEAltar altarEntity = this.getAltar(world, posX, posY, posZ);
if (altarEntity == null)
{
return false;
}
altarEntity.addToDemonBloodDuration(50);
return true;
}
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount)
{
int posX = (int) Math.round(sacrifice.posX - 0.5f);

View file

@ -24,7 +24,7 @@ import java.util.List;
public class ItemAttunedCrystal extends Item implements IReagentManipulator
{
public static final int maxDistance = 5;
public static final int maxDistance = 6;
public IIcon crystalBody;
public IIcon crystalLabel;