Added a new Forestry bee frame

This commit is contained in:
WayofTime 2014-01-26 16:04:27 -05:00
parent bd26e441cb
commit e159a6795c
7 changed files with 275 additions and 1 deletions

View file

@ -61,6 +61,7 @@ import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock;
import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.items.LifeBucket;
import WayofTime.alchemicalWizardry.common.items.forestry.ItemBloodFrame;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
import WayofTime.alchemicalWizardry.common.rituals.Rituals;
@ -140,6 +141,7 @@ public class AlchemicalWizardry
public static int customPotionFlameCloakID;
public static boolean isThaumcraftLoaded;
public static boolean isForestryLoaded;
public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic")
{
@ -267,6 +269,7 @@ public class AlchemicalWizardry
public static int energyBazookaItemID;
public static int itemBloodLightSigilItemID;
public static int itemComplexSpellCrystalItemID;
public static int itemBloodFrameItemID;
public static int testingBlockBlockID;
public static int lifeEssenceFlowingBlockID;
@ -931,5 +934,22 @@ public class AlchemicalWizardry
{
this.isThaumcraftLoaded = false;
}
if(Loader.isModLoaded("Forestry"))
{
this.isForestryLoaded = true;
ModItems.itemBloodFrame = new ItemBloodFrame(this.itemBloodFrameItemID).setUnlocalizedName("bloodFrame");
ItemStack provenFrame = GameRegistry.findItemStack("Forestry", "frameImpregnated", 1);
if(provenFrame !=null)
{
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.itemBloodFrame), provenFrame, 3, 30000, 20, 20, false);
}
}else
{
this.isForestryLoaded = false;
}
}
}

View file

@ -174,7 +174,8 @@ public class BloodMagicConfiguration
AlchemicalWizardry.focusGravityWellItemID = config.getItem("FocusGravityWell", 17077).getInt();
AlchemicalWizardry.sigilOfMagnetismItemID = config.getItem("SigilOfMagnetism", 17080).getInt();
AlchemicalWizardry.itemComplexSpellCrystalItemID = config.getItem("ComplexSpellCrystal",17081).getInt();
AlchemicalWizardry.itemBloodFrameItemID = config.getItem("BloodFrame", 17082).getInt();
} catch (Exception e)
{

View file

@ -104,6 +104,7 @@ public class ModItems
public static Item energyBazooka;
public static Item itemBloodLightSigil;
public static Item itemComplexSpellCrystal;
public static Item itemBloodFrame;
public static void init()
{

View file

@ -0,0 +1,155 @@
package WayofTime.alchemicalWizardry.common.items.forestry;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ArmourUpgrade;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import java.util.List;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IHiveFrame;
public class ItemBloodFrame extends EnergyItems implements IHiveFrame
{
public ItemBloodFrame(int id)
{
super(id);
this.maxStackSize = 1;
this.setMaxDamage(10);
//setMaxDamage(1000);
setEnergyUsed(3000);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Stirs bees into a frenzy.");
if (!(par1ItemStack.stackTagCompound == null))
{
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if(par1ItemStack.getItemDamage()>0)
{
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage()-1);
}
return par1ItemStack;
}
@Override
public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
{
// TODO Auto-generated method stub
return 0.0001f;
}
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 0;
}
@Override
public float getFloweringModifier(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override
public float getGeneticDecay(IBeeGenome genome, float currentModifier)
{
// TODO Auto-generated method stub
return 1;
}
@Override
public boolean isSealed()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isSelfLighted()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isSunlightSimulated()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isHellish()
{
// TODO Auto-generated method stub
return false;
}
@Override
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
{
// TODO Auto-generated method stub
if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear))
{
EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear);
return frame;
}else
{
frame.setItemDamage(frame.getItemDamage() + wear);
if(frame.getItemDamage()>=frame.getMaxDamage())
{
return null;
}
return frame;
}
}
}

View file

@ -0,0 +1,84 @@
package WayofTime.alchemicalWizardry.common.rituals;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeekeepingLogic;
public class RitualEffectApiaryOverclock extends RitualEffect
{
@Override
public void performEffect(TEMasterStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
World world = ritualStone.worldObj;
int x = ritualStone.xCoord;
int y = ritualStone.yCoord;
int z = ritualStone.zCoord;
if (currentEssence < this.getCostPerRefresh())
{
EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner);
if (entityOwner == null)
{
return;
}
entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
} else
{
TileEntity tile = world.getBlockTileEntity(x, y+1, z);
try{
if(tile instanceof IBeeHousing && tile.getClass().getName().contains("Apiary"))
{
for (int i = 0; i < 10; i++)
{
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(x, y+1, z, (short) 3));
}
for(int i=0; i<9; i++)
{
tile.updateEntity();
}
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
}
}catch (Exception e)
{
}
}
}
@Override
public int getCostPerRefresh()
{
// TODO Auto-generated method stub
return 10;
}
}

View file

@ -869,6 +869,18 @@ public class Rituals
meteorRitual.add(new RitualComponent(-2, 4, -3, RitualComponent.FIRE));
meteorRitual.add(new RitualComponent(-3, 4, -2, RitualComponent.FIRE));
meteorRitual.add(new RitualComponent(-3, 4, -3, RitualComponent.FIRE));
ArrayList<RitualComponent> apiaryRitual = new ArrayList();
apiaryRitual.add(new RitualComponent(1,0,0, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(1,0,1, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(1,0,-1, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(-1,0,-1, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(-1,0,1, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(-1,0,0, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(0,0,-1, RitualComponent.DUSK));
apiaryRitual.add(new RitualComponent(0,0,1, RitualComponent.DUSK));
ritualList.add(new Rituals(waterRitual, 1, 500, new RitualEffectWater(), "Ritual of the Full Spring"));
ritualList.add(new Rituals(lavaRitual, 1, 10000, new RitualEffectLava(), "Serenade of the Nether"));
ritualList.add(new Rituals(growthRitual, 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove"));
@ -888,6 +900,7 @@ public class Rituals
ritualList.add(new Rituals(biomeChangerRitual, 2, 1000000, new RitualEffectBiomeChanger(), "Ritual of Gaia's Transformation"));
ritualList.add(new Rituals(flightRitual, 2, 1000000, new RitualEffectFlight(), "Reverence of the Condor"));
ritualList.add(new Rituals(meteorRitual, 2, 1000000, new RitualEffectSummonMeteor(), "Mark of the Falling Tower"));
ritualList.add(new Rituals(apiaryRitual,1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
}
public static int getCostForActivation(int ritualID)

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B