Delivering packages in style!

This commit is contained in:
WayofTime 2015-05-25 14:58:23 -04:00
parent f553711573
commit 5c01df44c1
52 changed files with 2444 additions and 61 deletions

View file

@ -1,11 +1,15 @@
package WayofTime.alchemicalWizardry.common.entity.mob;
import WayofTime.alchemicalWizardry.ModItems;
import pneumaticCraft.api.PneumaticRegistry;
import cpw.mods.fml.common.Optional;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.book.BloodMagicGuide;
import amerifrance.guideapi.api.GuideRegistry;
public class MailOrderEntityItem extends EntityItem
{
@ -46,13 +50,26 @@ public class MailOrderEntityItem extends EntityItem
if(!worldObj.isRemote && this.ticksExisted > 100 && !this.isDead)
{
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, this.posX, this.posY, this.posZ));
EntityItem entity = new BookEntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(ModItems.itemBloodMagicBook));
entity.lifespan = 6000;
entity.delayBeforeCanPickup = 20;
entity.motionY = 1;
worldObj.spawnEntityInWorld(entity);
if(AlchemicalWizardry.isPneumaticCraftLoaded)
{
this.deliverItemViaDrone(this.posX, this.posY, this.posZ);
}else
{
worldObj.addWeatherEffect(new EntityLightningBolt(worldObj, this.posX, this.posY, this.posZ));
EntityItem entity = new BookEntityItem(worldObj, this.posX, this.posY, this.posZ, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide));
entity.lifespan = 6000;
entity.delayBeforeCanPickup = 20;
entity.motionY = 1;
worldObj.spawnEntityInWorld(entity);
}
this.setDead();
}
}
@Optional.Method(modid = "PneumaticCraft")
public void deliverItemViaDrone(double x, double y, double z)
{
PneumaticRegistry.getInstance().deliverItemsAmazonStyle(worldObj, (int)x, (int)y, (int)z, GuideRegistry.getItemStackForBook(BloodMagicGuide.bloodMagicGuide));
}
}