Quick update

This commit is contained in:
WayofTime 2014-03-18 21:50:57 -04:00
parent be38ab1076
commit b9263ee174
20 changed files with 866 additions and 73 deletions

View file

@ -109,7 +109,7 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v0.7.3e")
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class)
public class AlchemicalWizardry
@ -962,6 +962,7 @@ public class AlchemicalWizardry
ItemStack offenseCoreStack = new ItemStack(ModItems.baseItems,1,19);
ItemStack defensiveCoreStack = new ItemStack(ModItems.baseItems,1,20);
ItemStack environmentalCoreStack = new ItemStack(ModItems.baseItems,1,21);
ItemStack powerCoreStack = new ItemStack(ModItems.baseItems,1,22);
ItemStack magicalesCraftedCableStack = new ItemStack(ModItems.baseItems,5,2);
ItemStack crackedRunicPlateStackCrafted = new ItemStack(ModItems.baseItems,2,15);
@ -975,7 +976,7 @@ public class AlchemicalWizardry
GameRegistry.addRecipe(projectileCoreStack, "mbm","aca","mom",'c', emptyCoreStack,'b',weakBloodShardStack,'m', magicalesStack,'o', magicianBloodOrbStack,'a',new ItemStack(Item.arrow));
GameRegistry.addRecipe(selfCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',sanctusStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',glowstoneDustStack);
GameRegistry.addRecipe(meleeCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',incendiumStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',new ItemStack(Item.flintAndSteel));
GameRegistry.addRecipe(meleeCoreStack,"sbs","ncn","sos",'c', emptyCoreStack, 's',incendiumStack,'b', weakBloodShardStack,'o', magicianBloodOrbStack,'n',new ItemStack(Item.fireballCharge));
GameRegistry.addRecipe(paradigmBackPlateStack,"isi","rgr","isi",'i',ironIngotStack,'r',stoneStack,'g',goldIngotStack,'s',reinforcedSlateStack);
GameRegistry.addRecipe(outputCableStack, " si","s c"," si",'s',stoneStack,'i',ironIngotStack,'c',simpleCatalystStack);
@ -1011,7 +1012,7 @@ public class AlchemicalWizardry
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,2),"bgb","ico","bgb",'c',defensiveCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack);
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellModifier,1,3),"bgb","ico","bgb",'c',environmentalCoreStack,'i',inputCableStack,'o',outputCableStack,'b',stoneBraceStack,'g',ironIngotStack);
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,0),"bpb","ico","bpb",'c', emptyCoreStack,'b',woodBraceStack,'p',crackedRunicPlateStack,'i',inputCableStack,'o',outputCableStack);
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockSpellEnhancement,1,0),"bpb","ico","bpb",'c', powerCoreStack,'b',woodBraceStack,'p',crackedRunicPlateStack,'i',inputCableStack,'o',outputCableStack);
GameRegistry.addShapelessRecipe(new ItemStack(Item.dyePowder,5,15),fracturedBoneStack);
@ -1044,6 +1045,7 @@ public class AlchemicalWizardry
LanguageRegistry.addName(crackedRunicPlateStack,"Cracked Runic Plate");
LanguageRegistry.addName(runicPlateStack,"Runic Plate");
LanguageRegistry.addName(imbuedRunicPlateStack,"Imbued Runic Plate");
}
@EventHandler

View file

@ -305,7 +305,7 @@ public class AlchemicalWizardryEventHooks
entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0);
int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getAmplifier();
int radius = r+1;
float radius = 0.5f*r+0.5f;
if(entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration()<=2)
{

View file

@ -0,0 +1,387 @@
package WayofTime.alchemicalWizardry.common.rituals;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
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.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
public class RitualEffectAutoAlchemy 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()*6)
{
EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner);
if (entityOwner == null)
{
return;
}
entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
} else
{
int flag = 0;
TileEntity topEntity = world.getBlockTileEntity(x, y+1, z);
if(!(topEntity instanceof TEAltar))
{
return;
}
TEAltar tileAltar = (TEAltar)topEntity;
ItemStack targetStack = tileAltar.getStackInSlot(0);
if(targetStack == null)
{
return;
}
ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(targetStack);
if(recipe!=null)
{
TEWritingTable alchemyEntity;
IInventory outputInv = null;
IInventory inputInv1 = null;
IInventory inputInv2 = null;
TileEntity northEntity = world.getBlockTileEntity(x,y,z-1);
TileEntity southEntity = world.getBlockTileEntity(x,y,z+1);
TileEntity eastEntity = world.getBlockTileEntity(x+1,y,z);
TileEntity westEntity = world.getBlockTileEntity(x-1,y,z);
if(northEntity instanceof TEWritingTable)
{
alchemyEntity = (TEWritingTable)northEntity;
if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable))
{
outputInv = (IInventory)southEntity;
}
if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable))
{
inputInv1 = (IInventory)eastEntity;
}
if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable))
{
inputInv2 = (IInventory)westEntity;
}
}else if(southEntity instanceof TEWritingTable)
{
alchemyEntity = (TEWritingTable)southEntity;
if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable))
{
outputInv = (IInventory)northEntity;
}
if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable))
{
inputInv1 = (IInventory)eastEntity;
}
if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable))
{
inputInv2 = (IInventory)westEntity;
}
}else if(eastEntity instanceof TEWritingTable)
{
alchemyEntity = (TEWritingTable)eastEntity;
if(westEntity instanceof IInventory && !(westEntity instanceof TEWritingTable))
{
outputInv = (IInventory)westEntity;
}
if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable))
{
inputInv1 = (IInventory)northEntity;
}
if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable))
{
inputInv2 = (IInventory)southEntity;
}
}else if(westEntity instanceof TEWritingTable)
{
alchemyEntity = (TEWritingTable)westEntity;
if(eastEntity instanceof IInventory && !(eastEntity instanceof TEWritingTable))
{
outputInv = (IInventory)eastEntity;
}
if(northEntity instanceof IInventory && !(northEntity instanceof TEWritingTable))
{
inputInv1 = (IInventory)northEntity;
}
if(southEntity instanceof IInventory && !(southEntity instanceof TEWritingTable))
{
inputInv2 = (IInventory)southEntity;
}
}else
{
return;
}
if(outputInv!=null)
{
ItemStack outputStack = alchemyEntity.getStackInSlot(6);
if(outputStack!=null)
{
for(int i=0; i<outputInv.getSizeInventory(); i++)
{
ItemStack curStack = outputInv.getStackInSlot(i);
if(curStack==null)
{
ItemStack copyStack = outputStack.copy();
copyStack.stackSize = 1;
outputStack.stackSize--;
if(outputStack.stackSize<=0)
{
alchemyEntity.setInventorySlotContents(6, null);
}else
{
alchemyEntity.setInventorySlotContents(6, outputStack);
}
outputInv.setInventorySlotContents(i, copyStack);
flag++;
break;
}
else if(curStack.isItemEqual(outputStack)&&curStack.stackSize<curStack.getMaxStackSize())
{
outputStack.stackSize--;
if(outputStack.stackSize<=0)
{
alchemyEntity.setInventorySlotContents(6, null);
}else
{
alchemyEntity.setInventorySlotContents(6, outputStack);
}
curStack.stackSize++;
outputInv.setInventorySlotContents(i, curStack);
flag++;
break;
}
}
}
for(int i=0; i<recipe.length;i++)
{
ItemStack recItem = recipe[i];
if(recItem==null)
{
continue;
}
ItemStack alchStack = alchemyEntity.getStackInSlot(i+1);
if(alchStack!=null&&!(recItem.isItemEqual(alchStack)))
{
for(int j=0;j<outputInv.getSizeInventory();j++)
{
ItemStack curStack = outputInv.getStackInSlot(j);
if(curStack==null)
{
ItemStack copyStack = alchStack.copy();
copyStack.stackSize = 1;
alchStack.stackSize--;
if(alchStack.stackSize<=0)
{
alchemyEntity.setInventorySlotContents(i+1, null);
}else
{
alchemyEntity.setInventorySlotContents(i+1, alchStack);
}
outputInv.setInventorySlotContents(j, copyStack);
flag++;
break;
}
else if(curStack.isItemEqual(alchStack)&&curStack.stackSize<curStack.getMaxStackSize())
{
alchStack.stackSize--;
if(alchStack.stackSize<=0)
{
alchemyEntity.setInventorySlotContents(i+1, null);
}else
{
alchemyEntity.setInventorySlotContents(i+1, alchStack);
}
curStack.stackSize++;
outputInv.setInventorySlotContents(j, curStack);
flag++;
break;
}
}
continue;
}
}
}
if(flag==0&&inputInv1!=null)
{
for(int i=0;i<recipe.length;i++)
{
ItemStack recItem = recipe[i];
if(recItem==null)
{
continue;
}
ItemStack alchStack = alchemyEntity.getStackInSlot(i+1);
if(alchStack!=null&&((!recItem.isItemEqual(alchStack))||alchStack.stackSize>=alchStack.getMaxStackSize()))
{
continue;
}
for(int j=0;j<inputInv1.getSizeInventory();j++)
{
ItemStack curItem = inputInv1.getStackInSlot(j);
if(curItem==null)
{
continue;
}
if(curItem.isItemEqual(recItem))
{
if(alchStack==null)
{
ItemStack copyStack = recItem.copy();
copyStack.stackSize = 1;
alchemyEntity.setInventorySlotContents(i+1, copyStack);
curItem.stackSize--;
if(curItem.stackSize<=0)
{
inputInv1.setInventorySlotContents(j, null);
}else
{
inputInv1.setInventorySlotContents(j, curItem);
}
flag++;
break;
}else
{
alchStack.stackSize++;
alchemyEntity.setInventorySlotContents(i+1, alchStack);
curItem.stackSize--;
if(curItem.stackSize<=0)
{
inputInv1.setInventorySlotContents(j, null);
}else
{
inputInv1.setInventorySlotContents(j, curItem);
}
flag++;
break;
}
}
}
}
}
if(flag==0&&inputInv2!=null)
{
for(int i=0;i<recipe.length;i++)
{
ItemStack recItem = recipe[i];
if(recItem==null)
{
continue;
}
ItemStack alchStack = alchemyEntity.getStackInSlot(i+1);
if(alchStack!=null&&((!recItem.isItemEqual(alchStack))||alchStack.stackSize>=alchStack.getMaxStackSize()))
{
continue;
}
for(int j=0;j<inputInv2.getSizeInventory();j++)
{
ItemStack curItem = inputInv2.getStackInSlot(j);
if(curItem==null)
{
continue;
}
if(curItem.isItemEqual(recItem))
{
if(alchStack==null)
{
ItemStack copyStack = recItem.copy();
copyStack.stackSize = 1;
alchemyEntity.setInventorySlotContents(i+1, copyStack);
curItem.stackSize--;
if(curItem.stackSize<=0)
{
inputInv2.setInventorySlotContents(j, null);
}else
{
inputInv2.setInventorySlotContents(j, curItem);
}
flag++;
break;
}else
{
alchStack.stackSize++;
alchemyEntity.setInventorySlotContents(i+1, alchStack);
curItem.stackSize--;
if(curItem.stackSize<=0)
{
inputInv2.setInventorySlotContents(j, null);
}else
{
inputInv2.setInventorySlotContents(j, curItem);
}
flag++;
break;
}
}
}
}
}
}
if (flag>0)
{
world.markBlockForUpdate(x, y, z+1);
world.markBlockForUpdate(x, y, z-1);
world.markBlockForUpdate(x+1, y, z);
world.markBlockForUpdate(x-1, y, z);
data.currentEssence = currentEssence - this.getCostPerRefresh()*flag;
data.markDirty();
}
}
}
@Override
public int getCostPerRefresh()
{
return 10;
}
}

View file

@ -0,0 +1,86 @@
package WayofTime.alchemicalWizardry.common.rituals;
import WayofTime.alchemicalWizardry.common.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public class RitualEffectEnhancedAlchemy 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
{
if (world.getWorldTime() % 20 != 0)
{
return;
}
boolean flag = false;
for (int i = -1; i <= 1; i++)
{
for (int j = -1; j <= 1; j++)
{
int id = world.getBlockId(x + i, y + 2, z + j);
Block block = Block.blocksList[id];
if (block instanceof IPlantable)
{
{
PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(x + i, y + 2, z + j, (short) 3));
block.updateTick(world, x + i, y + 2, z + j, world.rand);
flag = true;
}
}
}
}
if (flag)
{
data.currentEssence = currentEssence - this.getCostPerRefresh();
data.markDirty();
}
}
}
@Override
public int getCostPerRefresh()
{
return 0;
}
}

View file

@ -879,6 +879,16 @@ public class Rituals
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));
ArrayList<RitualComponent> autoAlchemyRitual = new ArrayList();
autoAlchemyRitual.add(new RitualComponent(1,0,1, RitualComponent.DUSK));
autoAlchemyRitual.add(new RitualComponent(1,0,-1, RitualComponent.DUSK));
autoAlchemyRitual.add(new RitualComponent(-1,0,-1, RitualComponent.DUSK));
autoAlchemyRitual.add(new RitualComponent(-1,0,1, RitualComponent.DUSK));
autoAlchemyRitual.add(new RitualComponent(2,0,2, RitualComponent.WATER));
autoAlchemyRitual.add(new RitualComponent(2,0,-2, RitualComponent.WATER));
autoAlchemyRitual.add(new RitualComponent(-2,0,-2, RitualComponent.WATER));
autoAlchemyRitual.add(new RitualComponent(-2,0,2, RitualComponent.WATER));
ritualList.add(new Rituals(waterRitual, 1, 500, new RitualEffectWater(), "Ritual of the Full Spring"));
@ -900,6 +910,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(autoAlchemyRitual,1,20000,new RitualEffectAutoAlchemy(),"Ballad of Alchemy"));
//ritualList.add(new Rituals(apiaryRitual,1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
}

View file

@ -93,44 +93,44 @@ public class SpellEffectEarth extends SpellEffect
@Override
protected int getCostForDefaultProjectile()
{
return (int)(10*Math.pow((0.5*(this.powerEnhancement)+1)*2 + 1,3)*Math.pow(0.8, costEnhancement));
return (int)(10*Math.pow((0.5*(this.powerEnhancement)+1)*2 + 1,3)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseProjectile()
{
return (int)(10*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.8, costEnhancement));
return (int)(10*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseProjectile()
{
return (int)(3*Math.pow((this.powerEnhancement*2+1),2)*(this.potencyEnhancement*2+1)*Math.pow(0.8, costEnhancement));
return (int)(3*Math.pow((this.powerEnhancement*2+1),2)*(this.potencyEnhancement*2+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentProjectile()
{
return (int)(10*2*(0.1d*(this.potencyEnhancement+1))*Math.pow(3.47,this.potencyEnhancement)*Math.pow(0.8, costEnhancement));
return (int)(10*2*(0.1d*(this.potencyEnhancement+1))*Math.pow(3.47,this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefaultSelf()
{
return (int)(20*Math.pow(1.5*powerEnhancement+1,2)*(2*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(20*Math.pow(1.5*powerEnhancement+1,2)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseSelf()
{
return (int)(10*Math.pow(2*this.powerEnhancement+1,2)*(this.potencyEnhancement+1));
return (int)(10*Math.pow(2*this.powerEnhancement+1,2)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseSelf()
{
return (int)(750*(1.1*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(750*(1.1*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
@ -143,24 +143,24 @@ public class SpellEffectEarth extends SpellEffect
@Override
protected int getCostForDefaultMelee()
{
return (int)(50*Math.pow(1.5*this.potencyEnhancement + 1,3)*(0.5*this.powerEnhancement + 1)*Math.pow(0.8, costEnhancement));
return (int)(50*Math.pow(1.5*this.potencyEnhancement + 1,3)*(0.5*this.powerEnhancement + 1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseMelee()
{
return (int)(20*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1));
return (int)(20*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseMelee()
{
return (int)(5*(1.2*this.powerEnhancement+1)*(1.0f/3.0f*Math.pow(this.potencyEnhancement,2)+2+1.0f/2.0f*this.potencyEnhancement)*Math.pow(0.8, costEnhancement));
return (int)(5*(1.2*this.powerEnhancement+1)*(1.0f/3.0f*Math.pow(this.potencyEnhancement,2)+2+1.0f/2.0f*this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentMelee()
{
return (int)(500*Math.pow(2*this.potencyEnhancement+1, 3)*(0.25*this.powerEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(500*Math.pow(2*this.potencyEnhancement+1, 3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
}

View file

@ -3,6 +3,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefaultFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefensiveFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeEnvironmentalFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeOffensiveFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefensiveFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileEnvironmentalFire;
@ -66,104 +70,96 @@ public class SpellEffectFire extends SpellEffect
@Override
public void defaultModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addEntityEffect(new MeleeDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
}
@Override
public void offensiveModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addEntityEffect(new MeleeOffensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
public void defensiveModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addWorldEffect(new MeleeDefensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
public void environmentalModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addWorldEffect(new MeleeEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
protected int getCostForDefaultProjectile()
{
return (int)((5*Math.pow(1.5*this.powerEnhancement+1, 2)*(1.5*this.potencyEnhancement+1)+this.potencyEnhancement*15)*Math.pow(0.8, costEnhancement));
return (int)((5*Math.pow(1.5*this.powerEnhancement+1, 2)*(1.5*this.potencyEnhancement+1)+this.potencyEnhancement*15)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseProjectile()
{
return (int)(10*Math.pow((this.powerEnhancement)*1.3+1,2)*((1.5*this.potencyEnhancement+1))*Math.pow(0.8, costEnhancement));
return (int)(10*Math.pow((this.powerEnhancement)*1.3+1,2)*((1.5*this.potencyEnhancement+1))*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseProjectile()
{
return (int)(25*Math.pow(1*this.powerEnhancement+1,2)*(1*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(25*Math.pow(1*this.powerEnhancement+1,2)*(1*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentProjectile()
{
return (int)(75*(0.5*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(75*(0.5*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefaultSelf()
{
return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement)*Math.pow(0.8, costEnhancement));
return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseSelf()
{
return 500*(int)((this.powerEnhancement+1)*Math.pow(2, potencyEnhancement)*Math.pow(0.8, costEnhancement));
return (int)(300*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseSelf()
{
return (int)(25*(3*this.potencyEnhancement+1)*(2*this.powerEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(25*(3*this.potencyEnhancement+1)*(2*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentSelf()
{
return (int) ((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.8, costEnhancement));
return (int)((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefaultMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(25*(1.2*this.potencyEnhancement+1)*(2.5*this.powerEnhancement+2)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(500*(1+this.potencyEnhancement)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(30*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(25*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
}

View file

@ -3,9 +3,11 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeOffensiveWind;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileDefaultWind;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileEnvironmentalWind;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileOffensiveWind;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfEnvironmentalWind;
public class SpellEffectWind extends SpellEffect
{
@ -57,8 +59,7 @@ public class SpellEffectWind extends SpellEffect
@Override
public void environmentalModificationSelf(SpellParadigmSelf parad)
{
// TODO Auto-generated method stub
parad.addSelfSpellEffect(new SelfEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
@ -71,8 +72,7 @@ public class SpellEffectWind extends SpellEffect
@Override
public void offensiveModificationMelee(SpellParadigmMelee parad)
{
// TODO Auto-generated method stub
parad.addEntityEffect(new MeleeOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
@ -92,26 +92,25 @@ public class SpellEffectWind extends SpellEffect
@Override
protected int getCostForDefaultProjectile()
{
return (int)(100*(this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(100*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForOffenseProjectile()
{
return (int)(100*(0.5*this.potencyEnhancement+1)*(this.powerEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(100*(0.5*this.potencyEnhancement+1)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseProjectile()
{
// TODO Auto-generated method stub
return 0;
return (int)(100*(this.potencyEnhancement+1));
}
@Override
protected int getCostForEnvironmentProjectile()
{
return (int)(50*(this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.8, costEnhancement));
return (int)(50*(this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
@ -138,8 +137,7 @@ public class SpellEffectWind extends SpellEffect
@Override
protected int getCostForEnvironmentSelf()
{
// TODO Auto-generated method stub
return 0;
return (int)(500*(0.7d*this.powerEnhancement+1)*(0.2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override
@ -152,8 +150,7 @@ public class SpellEffectWind extends SpellEffect
@Override
protected int getCostForOffenseMelee()
{
// TODO Auto-generated method stub
return 0;
return (int)(250*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
}
@Override

View file

@ -45,7 +45,7 @@ public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntity
{
if(hit<maxHit&&!entity.equals(entityPlayer))
{
if(this.entityEffect(world, entity))
if(this.entityEffect(world, entity, entityPlayer))
{
hit++;
}
@ -55,7 +55,7 @@ public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntity
}
}
protected abstract boolean entityEffect(World world, Entity entity);
protected abstract boolean entityEffect(World world, Entity entity, EntityPlayer player);
public void setRange(float range)
{

View file

@ -0,0 +1,30 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeDefaultFire extends ExtrapolatedMeleeEntityEffect
{
public MeleeDefaultFire(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3+0.3f*potency);
this.setRadius(2+0.3f*potency);
this.setMaxNumberHit(potency+1);
}
@Override
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
{
if(entity instanceof EntityLiving)
{
entity.setFire(3*this.powerUpgrades+3);
return true;
}
return false;
}
}

View file

@ -0,0 +1,49 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
public class MeleeDefensiveFire extends MeleeSpellWorldEffect
{
public MeleeDefensiveFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onWorldEffect(World world, EntityPlayer entityPlayer)
{
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec());
int width = this.potencyUpgrades + 1;
int length = 5*this.powerUpgrades + 3;
int xOffset = look.offsetX;
int zOffset = look.offsetZ;
Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer);
int xStart = (int)(lookVec.xCoord)+1*xOffset;
int zStart = (int)(lookVec.zCoord)+1*zOffset;
int yStart = (int)(lookVec.yCoord)-1;
for(int i=-width; i<=width; i++)
{
for(int j=0; j<length;j++)
{
for(int k=0;k<3;k++)
{
if(world.isAirBlock(xStart + i*(zOffset) + j*(xOffset), yStart+k, zStart + i*(xOffset) + j*(zOffset)))
{
world.setBlock(xStart + i*(zOffset) + j*(xOffset), yStart+k, zStart + i*(xOffset) + j*(zOffset), Block.fire.blockID);
}
}
}
}
}
}

View file

@ -0,0 +1,34 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityFallingSand;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect
{
public MeleeEnvironmentalFire(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3*power + 2);
}
@Override
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
{
int radius = this.potencyUpgrades;
for(int i=-radius; i<=radius; i++)
{
for(int j=-radius; j<=radius; j++)
{
for(int k=-radius; k<=radius; k++)
{
SpellHelper.evaporateWaterBlock(world, posX+i, posY+j, posZ+k);
}
}
}
}
}

View file

@ -0,0 +1,32 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeOffensiveFire extends ExtrapolatedMeleeEntityEffect
{
public MeleeOffensiveFire(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3+0.3f*potency);
this.setRadius(2+0.3f*potency);
this.setMaxNumberHit(1);
}
@Override
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
{
if(entity instanceof EntityLiving)
{
((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id,20*(7-this.powerUpgrades),this.potencyUpgrades));
return true;
}
return false;
}
}

View file

@ -16,6 +16,6 @@ public class SelfOffensiveFire extends SelfSpellEffect
@Override
public void onSelfUse(World world, EntityPlayer player)
{
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,200*(this.powerUpgrades+1)*(this.powerUpgrades+1),this.potencyUpgrades));
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,300*(2*this.powerUpgrades+1),this.potencyUpgrades));
}
}

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
@ -15,7 +16,7 @@ public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect {
}
@Override
protected boolean entityEffect(World world, Entity entity)
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
{
if(entity.hurtResistantTime>0)
{

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
@ -16,7 +17,7 @@ public class MeleeEnvironmentalIce extends ExtrapolatedMeleeEntityEffect
}
@Override
protected boolean entityEffect(World world, Entity entity)
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
{
for(int i=0;i<=this.powerUpgrades;i++)
{

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.i
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
@ -18,7 +19,7 @@ public class MeleeOffensiveIce extends ExtrapolatedMeleeEntityEffect
}
@Override
protected boolean entityEffect(World world, Entity entity)
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
{
Vec3 blockVector = SpellHelper.getEntityBlockVector(entity);

View file

@ -0,0 +1,40 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeOffensiveWind extends ExtrapolatedMeleeEntityEffect
{
public MeleeOffensiveWind(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3+0.3f*potency);
this.setRadius(2+0.3f*potency);
this.setMaxNumberHit(potency+1);
}
@Override
protected boolean entityEffect(World world, Entity entity, EntityPlayer player)
{
double wantedVel = 1.0d+1.0d*this.powerUpgrades;
if(entity instanceof EntityLiving)
{
double dist = Math.sqrt(entity.getDistanceToEntity(player));
double xVel = wantedVel*(entity.posX - player.posX)/dist;
double yVel = wantedVel*(entity.posY - player.posY+0.5f)/dist;
double zVel = wantedVel*(entity.posZ - player.posZ)/dist;
entity.motionX = xVel;
entity.motionY = yVel;
entity.motionZ = zVel;
return true;
}
return false;
}
}

View file

@ -0,0 +1,45 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfEnvironmentalWind extends SelfSpellEffect
{
public SelfEnvironmentalWind(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
double radius = 1.5d*this.potencyUpgrades+1;
double posX = player.posX;
double posY = player.posY-0.7d;
double posZ = player.posZ;
double wantedVel = 0.7d+0.7d*this.powerUpgrades;
List<Entity> entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius);
for(Entity entity: entities)
{
if((!entity.equals(player))&&entity instanceof EntityLiving)
{
double dist = Math.sqrt(entity.getDistanceToEntity(player));
double xVel = wantedVel*(entity.posX - posX)/dist;
double yVel = wantedVel*(entity.posY - posY)/dist;
double zVel = wantedVel*(entity.posZ - posZ)/dist;
entity.motionX = xVel;
entity.motionY = yVel;
entity.motionZ = zVel;
}
}
}
}

View file

@ -1,14 +1,11 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.*;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import cpw.mods.fml.common.network.PacketDispatcher;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -16,12 +13,20 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.IBindingAgent;
import WayofTime.alchemicalWizardry.common.ICatalyst;
import WayofTime.alchemicalWizardry.common.IFillingAgent;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import cpw.mods.fml.common.network.PacketDispatcher;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class TEWritingTable extends TileEntity implements IInventory
public class TEWritingTable extends TileEntity implements ISidedInventory
{
private ItemStack[] inv;
private int progress;
@ -79,6 +84,37 @@ public class TEWritingTable extends TileEntity implements IInventory
return stack;
}
public ItemStack decrStackSizeLeaveContainer(int slot, int amt)
{
ItemStack stack = getStackInSlot(slot);
if (stack != null)
{
ItemStack containedStack = stack.getItem().getContainerItemStack(stack);
if(containedStack!=null)
{
setInventorySlotContents(slot,containedStack);
}
else
{
if (stack.stackSize <= amt)
{
setInventorySlotContents(slot, null);
} else
{
stack = stack.splitStack(amt);
if (stack.stackSize == 0)
{
setInventorySlotContents(slot, null);
}
}
}
}
return stack;
}
@Override
public ItemStack getStackInSlotOnClosing(int slot)
@ -716,7 +752,7 @@ public class TEWritingTable extends TileEntity implements IInventory
for (int i = 0; i < 5; i++)
{
this.decrStackSize(i + 1, 1);
this.decrStackSizeLeaveContainer(i + 1, 1);
}
if (worldObj != null)
@ -747,7 +783,7 @@ public class TEWritingTable extends TileEntity implements IInventory
for (int i = 0; i < 5; i++)
{
this.decrStackSize(i + 1, 1);
this.decrStackSizeLeaveContainer(i + 1, 1);
}
if (worldObj != null)
@ -760,4 +796,49 @@ public class TEWritingTable extends TileEntity implements IInventory
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
public int[] getAccessibleSlotsFromSide(int var1)
{
ForgeDirection dir = ForgeDirection.getOrientation(var1);
switch(dir)
{
case DOWN:
return new int[]{0};
case UP:
return new int[]{6};
case NORTH:
case SOUTH:
case EAST:
case WEST:
return new int[]{1,2,3,4,5};
default:
return new int[]{};
}
}
@Override
public boolean canInsertItem(int i, ItemStack itemStack, int j)
{
ForgeDirection dir = ForgeDirection.getOrientation(j);
if(itemStack == null)
{
return false;
}
if(dir.equals(ForgeDirection.DOWN) && !(itemStack.getItem() instanceof EnergyBattery))
{
return false;
}
return true;
}
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j)
{
return true;
}
}