A book is a book is a book

This commit is contained in:
WayofTime 2015-01-30 09:29:22 -05:00
parent 5b4d4ff498
commit ae1b86def2
17 changed files with 1162 additions and 41 deletions

View file

@ -1548,7 +1548,7 @@ public class AlchemicalWizardry
continue;
}
strLine = strLine.replace('”', '"').replace('“','"');
strLine = strLine.replace('”', '"').replace('“','"').replace("", "...").replace('', '\'').replace('', '-');
if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
{

View file

@ -35,6 +35,7 @@ import WayofTime.alchemicalWizardry.common.items.ItemBloodLetterPack;
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
import WayofTime.alchemicalWizardry.common.items.ItemComponents;
import WayofTime.alchemicalWizardry.common.items.ItemDiabloKey;
import WayofTime.alchemicalWizardry.common.items.ItemMailOrderCatalogue;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
import WayofTime.alchemicalWizardry.common.items.LifeBucket;
@ -229,6 +230,8 @@ public class ModItems
public static Item inputRoutingFocus;
public static Item outputRoutingFocus;
public static Item itemMailCatalogue;
public static void init()
{
@ -350,6 +353,8 @@ public class ModItems
inputRoutingFocus = new InputRoutingFocus().setUnlocalizedName("inputRoutingFocus");
outputRoutingFocus = new OutputRoutingFocus().setUnlocalizedName("outputRoutingFocus");
itemMailCatalogue = new ItemMailOrderCatalogue().setUnlocalizedName("itemMailCatalogue");
}
public static void registerItems()
@ -476,6 +481,8 @@ public class ModItems
GameRegistry.registerItem(ModItems.inputRoutingFocus, "inputRoutingFocus");
GameRegistry.registerItem(ModItems.outputRoutingFocus, "outputRoutingFocus");
GameRegistry.registerItem(ModItems.itemMailCatalogue, "itemMailCatalogue");
//GameRegistry.registerItem(ModItems.itemBloodFrame, "itemBloodFrame");
}
}

View file

@ -1,9 +1,9 @@
package WayofTime.alchemicalWizardry.api.event;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.world.World;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
/** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation,
or cancel it entirely to prevent the transposition. */

View file

@ -39,7 +39,7 @@ public class EntryItemText implements IEntry{
if(this.entryName == null)
this.entryName = key;
String s = StatCollector.translateToLocal("bu.entry." + this.entryName + "." + page);
String s = StatCollector.translateToLocal("aw.entry." + this.entryName + "." + page);
x = left + width / 2 - 58;
y = (top + 15);

View file

@ -39,6 +39,7 @@ public class EntryRegistry
public static HashMap<Category, Integer> maxEntries = new HashMap<Category, Integer>();
public static HashMap<String, Entry> architect = new HashMap<String, Entry>();
public static HashMap<String, Entry> basics = new HashMap<String, Entry>();
public static HashMap<String, Entry> rituals = new HashMap<String, Entry>();
public static HashMap<String, Entry> bloodUtils = new HashMap<String, Entry>();

View file

@ -1,13 +1,29 @@
package WayofTime.alchemicalWizardry.common;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.*;
import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem;
import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaSecondaryProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam;
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.world.World;
public class CommonProxy
{
@ -66,6 +82,8 @@ public class CommonProxy
EntityRegistry.registerModEntity(EntityMeteor.class, "meteor", 13, AlchemicalWizardry.instance, 120, 3, true);
EntityRegistry.registerModEntity(EntitySpellProjectile.class, "spellProjectile", 14, AlchemicalWizardry.instance, 128, 3, true);
EntityRegistry.registerModEntity(EntityParticleBeam.class, "particleBeam", 15, AlchemicalWizardry.instance, 120, 3, true);
EntityRegistry.registerModEntity(MailOrderEntityItem.class, "catalogueEntityItem", 16, AlchemicalWizardry.instance, 120, 3, true);
EntityRegistry.registerModEntity(BookEntityItem.class, "bookEntityItem", 17, AlchemicalWizardry.instance, 120, 3, true);
}
public void registerTickHandlers()

View file

@ -17,7 +17,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.event.TeleposeEvent;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;

View file

@ -25,20 +25,77 @@ public class BUEntries
public void initCategories(){
categoryBasics = new Category("Basics", new ItemStack(ModItems.weakBloodOrb), EnumType.ITEM);
categoryRituals = new Category("Rituals", new ItemStack(ModItems.itemRitualDiviner), EnumType.ITEM);
catagoryArchitect = new Category("The Architect", new ItemStack(ModBlocks.blockAltar), EnumType.BLOCK);
registerCategories();
}
public static Category categoryBasics;
public static Category categoryRituals;
public static Category catagoryArchitect;
public void registerCategories(){
EntryRegistry.registerCategories(BUEntries.categoryBasics);
EntryRegistry.registerCategories(BUEntries.categoryRituals);
EntryRegistry.registerCategories(BUEntries.catagoryArchitect);
}
public void initEntries()
{
/* The Architect */
aIntro = this.getPureTextEntry(5, "Your classic tragic backstory", 1);
aBloodAltar = this.getPureTextEntry(3, "The Blood Altar", 1);
aSoulNetwork = this.getPureTextEntry(3, "The Soul Network", 1);
aBasicsOfSigils = this.getPureTextEntry(4, "Basics of sigils and a glimpse into the soul", 1);
aTrainingAndWaterSigil = this.getPureTextEntry(6, "Training, and water sigils", 1);
aLavaCrystal = this.getPureTextEntry(5, "The Lava crystal", 1);
aLavaSigil = this.getPureTextEntry(8, "The perversion of the Nether, and a sigil of lava", 1);
aBlankRunes = this.getPureTextEntry(5, "Blank runes, the building blocks of the future", 1);
aSpeedRune = this.getPureTextEntry(2, "Speed runes", 1);
aApprenticeOrb = this.getPureTextEntry(4, "A shining green orb", 1);
aVoidSigil = this.getPureTextEntry(2, "The void sigil", 1);
aAirSigil = this.getPureTextEntry(2, "Air sigil", 1);
aSightSigil = this.getPureTextEntry(2, "Sigil of Sight", 1);
aAdvancedAltar = this.getPureTextEntry(5, "Advanced altar mechanics", 1);
aFastMinder = this.getPureTextEntry(2, "Sigil of the fast miner", 2);
aSoulFray = this.getPureTextEntry(2, "Soul Fray, a few thin threads", 2);
aGreenGrove = this.getPureTextEntry(2, "Green grove, a farmers friend", 2);
aDaggerOfSacrifice = this.getPureTextEntry(9, "Dagger of sacrifice, an alternative energy source", 2);
aRunesOfSacrifice = this.getPureTextEntry(10, "Runes of Sacrifice", 2);
aBloodLetterPack = this.getPureTextEntry(4, "The blood letters pack", 2);
aNewFriends = this.getPureTextEntry(18, "And then there was five", 2);
aUpgradedAltar = this.getPureTextEntry(4, "An altar upgraded, and orb formed", 2);
aNewRunes = this.getPureTextEntry(5, "New runes", 2);
aPhandomBridge = this.getPureTextEntry(8, "The Phantom bridge", 2);
aHolding = this.getPureTextEntry(2, "Sigil of holding", 2);
aElementalAffinity = this.getPureTextEntry(2, "Elemental affinity, a spell casters best friend", 2);
aRitualStones = this.getPureTextEntry(2, "Recreating ritual stones", 2);
aBloodLamp = this.getPureTextEntry(3, "Shining a blood lamp sigil", 2);
aBoundArmour = this.getPureTextEntry(8, "Bound armor, the walking fortress", 3);
aSanguineArmour = this.getPureTextEntry(2, "Sanguine armor", 3);
aSoulSuppressing = this.getPureTextEntry(1, "Suppressing the soul", 3);
aRitualDiviner = this.getPureTextEntry(5, "The ritual diviner", 3);
aBloodShards = this.getPureTextEntry(5, "Blood shards", 3);
aLifeOfMage = this.getPureTextEntry(9, "he life of a Mage", 3);
aT4 = this.getPureTextEntry(5, "The T4 altar, and a master's orb", 3);
aSigilOfWhirlwind = this.getPureTextEntry(2, "The sigil of whirlwinds", 3);
aSigilOfCompression = this.getPureTextEntry(2, "The sigil of compression", 3);
aEnderDivergence = this.getPureTextEntry(3, "The Ender divergence", 3);
aTeleposer = this.getPureTextEntry(9, "The Teleposer", 3);
aSuppression = this.getPureTextEntry(2, "The sigil of suppression", 3);
aSuperiorCapacity = this.getPureTextEntry(2, "The superior capacity rune", 3);
aRuneOfOrb = this.getPureTextEntry(3, "The rune of the orb", 3);
aFieldTrip = this.getPureTextEntry(19, "A field trip", 4);
aKeyOfBinding = this.getPureTextEntry(4, "The key of binding", 4);
aT5 = this.getPureTextEntry(4, "The trials of a T5 altar", 4);
aPriceOfPower = this.getPureTextEntry(2, "The price of power", 4);
aDemonicOrb = this.getPureTextEntry(1, "Demonic orb", 4);
aEnergyBazooka = this.getPureTextEntry(2, "The unspeakable power of the energy bazooka", 4);
aAccelerationRune = this.getPureTextEntry(2, "Acceleration runes", 4);
aHarvestSigil = this.getPureTextEntry(3, "The sigil of the Harvest goddess", 4);
aDemons = this.getPureTextEntry(6, "Solving a demon problem with more demons", 4);
aT6 = this.getPureTextEntry(3, "The T6 altar already", 4);
rIntro = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText()}, "Introduction", 1);
rWeakRituals = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText(), new EntryText()}, "Weak Rituals", 1);
rRituals = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText(), new EntryText()}, "Rituals", 1);
@ -85,6 +142,60 @@ public class BUEntries
return new Entry(entries, name, pageNumber);
}
/* Architect */
public static Entry aIntro;
public static Entry aBloodAltar;
public static Entry aSoulNetwork;
public static Entry aBasicsOfSigils;
public static Entry aTrainingAndWaterSigil;
public static Entry aLavaCrystal;
public static Entry aLavaSigil;
public static Entry aBlankRunes;
public static Entry aSpeedRune;
public static Entry aApprenticeOrb;
public static Entry aVoidSigil;
public static Entry aAirSigil;
public static Entry aSightSigil;
public static Entry aAdvancedAltar;
public static Entry aFastMinder;
public static Entry aSoulFray;
public static Entry aGreenGrove;
public static Entry aDaggerOfSacrifice;
public static Entry aRunesOfSacrifice;
public static Entry aBloodLetterPack;
public static Entry aNewFriends;
public static Entry aUpgradedAltar;
public static Entry aNewRunes;
public static Entry aPhandomBridge;
public static Entry aHolding;
public static Entry aElementalAffinity;
public static Entry aRitualStones;
public static Entry aBloodLamp;
public static Entry aBoundArmour;
public static Entry aSanguineArmour;
public static Entry aSoulSuppressing;
public static Entry aRitualDiviner;
public static Entry aBloodShards;
public static Entry aLifeOfMage;
public static Entry aT4;
public static Entry aSigilOfWhirlwind;
public static Entry aSigilOfCompression;
public static Entry aEnderDivergence;
public static Entry aTeleposer;
public static Entry aSuppression;
public static Entry aSuperiorCapacity;
public static Entry aRuneOfOrb;
public static Entry aFieldTrip;
public static Entry aKeyOfBinding;
public static Entry aT5;
public static Entry aPriceOfPower;
public static Entry aDemonicOrb;
public static Entry aEnergyBazooka;
public static Entry aAccelerationRune;
public static Entry aHarvestSigil;
public static Entry aDemons;
public static Entry aT6;
public static Entry rIntro;
public static Entry rWeakRituals;
public static Entry rRituals;
@ -117,7 +228,61 @@ public class BUEntries
public static Entry debug;
public void registerEntries(){
public void registerEntries()
{
/* Architect */
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aIntro);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodAltar);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulNetwork);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBasicsOfSigils);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aTrainingAndWaterSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLavaCrystal);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLavaSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBlankRunes);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSpeedRune);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aApprenticeOrb);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aVoidSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAirSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSightSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAdvancedAltar);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aFastMinder);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulFray);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aGreenGrove);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDaggerOfSacrifice);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRunesOfSacrifice);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodLetterPack);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aNewFriends);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aUpgradedAltar);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aNewRunes);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aPhandomBridge);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aHolding);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aElementalAffinity);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRitualStones);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodLamp);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBoundArmour);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSanguineArmour);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulSuppressing);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRitualDiviner);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodShards);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLifeOfMage);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT4);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSigilOfWhirlwind);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSigilOfCompression);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aEnderDivergence);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aTeleposer);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSuppression);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSuperiorCapacity);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRuneOfOrb);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aFieldTrip);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aKeyOfBinding);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT5);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aPriceOfPower);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDemonicOrb);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aEnergyBazooka);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAccelerationRune);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aHarvestSigil);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDemons);
EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT6);
EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.theAltar);
EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.runes);

View file

@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem;
public class ItemBMBook extends Item
{
@ -47,4 +48,15 @@ public class ItemBMBook extends Item
stack.setTagCompound(new NBTTagCompound());
}
@Override
public boolean hasCustomEntity(ItemStack stack)
{
return true;
}
@Override
public Entity createEntity(World world, Entity location, ItemStack itemstack)
{
return new BookEntityItem(world, location, itemstack);
}
}

View file

@ -0,0 +1,57 @@
package WayofTime.alchemicalWizardry.common.entity.mob;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class BookEntityItem extends EntityItem
{
public BookEntityItem(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
this.isImmuneToFire = true;
this.lifespan = 72000;
}
public BookEntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
{
this(par1World, par2, par4, par6);
this.setEntityItemStack(par8ItemStack);
this.lifespan = (par8ItemStack.getItem() == null ? 6000 : par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World));
this.isImmuneToFire = true;
}
public BookEntityItem(World world, Entity original, ItemStack stack)
{
this(world, original.posX, original.posY, original.posZ);
this.delayBeforeCanPickup = 20;
this.motionX = original.motionX;
this.motionY = original.motionY;
this.motionZ = original.motionZ;
this.setEntityItemStack(stack);
this.isImmuneToFire = true;
}
public BookEntityItem(World par1world)
{
super(par1world);
}
@Override
public void onUpdate()
{
super.onUpdate();
System.out.println("I is alive");
}
@Override
public boolean attackEntityFrom (DamageSource par1DamageSource, float par2)
{
if (par1DamageSource.getDamageType().equals("outOfWorld"))
return true;
return false;
}
}

View file

@ -0,0 +1,58 @@
package WayofTime.alchemicalWizardry.common.entity.mob;
import WayofTime.alchemicalWizardry.ModItems;
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;
public class MailOrderEntityItem extends EntityItem
{
public MailOrderEntityItem(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
this.isImmuneToFire = true;
this.lifespan = 72000;
}
public MailOrderEntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
{
this(par1World, par2, par4, par6);
this.setEntityItemStack(par8ItemStack);
this.isImmuneToFire = true;
this.lifespan = (par8ItemStack.getItem() == null ? 6000 : par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World));
}
public MailOrderEntityItem(World world, Entity original, ItemStack stack)
{
this(world, original.posX, original.posY, original.posZ);
this.delayBeforeCanPickup = 20;
this.motionX = original.motionX;
this.motionY = original.motionY;
this.motionZ = original.motionZ;
this.setEntityItemStack(stack);
this.isImmuneToFire = true;
}
public MailOrderEntityItem(World par1world)
{
super(par1world);
}
public void onUpdate()
{
super.onUpdate();
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);
this.setDead();
}
}
}

View file

@ -0,0 +1,39 @@
package WayofTime.alchemicalWizardry.common.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemMailOrderCatalogue extends Item
{
public ItemMailOrderCatalogue()
{
super();
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MailOrder");
}
@Override
public boolean hasCustomEntity(ItemStack stack)
{
return true;
}
@Override
public Entity createEntity(World world, Entity location, ItemStack itemstack)
{
return new MailOrderEntityItem(world, location, itemstack);
}
}