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

@ -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)