Joshie comment!
This commit is contained in:
parent
1c0deadfc6
commit
ac943e9d38
753 changed files with 8715 additions and 1184 deletions
|
@ -83,6 +83,7 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFlight;
|
|||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap;
|
||||
|
@ -135,7 +136,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 = "v1.0.1d")
|
||||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.0.1e")
|
||||
@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
|
||||
|
@ -1329,6 +1330,7 @@ public class AlchemicalWizardry
|
|||
Rituals.ritualList.add(new Rituals(1, 20000,new RitualEffectAutoAlchemy(), "Ballad of Alchemy"));
|
||||
Rituals.ritualList.add(new Rituals(1, 1000000,new RitualEffectExpulsion(), "Aura of Expulsion"));
|
||||
Rituals.ritualList.add(new Rituals(1, 10000,new RitualEffectSupression(), "Dome of Supression"));
|
||||
Rituals.ritualList.add(new Rituals(1, 25000, new RitualEffectItemSuction(),"Call of the Zephyr"));
|
||||
//Rituals.ritualList.add(new Rituals(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class DivinationSigil extends Item implements ArmourUpgrade
|
|||
ItemStack thisItemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9));
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9,true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -15,11 +10,21 @@ import net.minecraft.item.ItemBucket;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
||||
{
|
||||
|
@ -106,6 +111,26 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
TileEntity tile = par2World.getBlockTileEntity(i, j, k);
|
||||
if(tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(FluidRegistry.LAVA,1000);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false);
|
||||
|
||||
if(amount>0)
|
||||
{
|
||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (this.isFull == 0)
|
||||
{
|
||||
//Empty
|
||||
|
@ -271,7 +296,7 @@ public class LavaSigil extends ItemBucket implements ArmourUpgrade
|
|||
ItemStack thisItemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9));
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9,true));
|
||||
player.extinguish();
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1,true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -149,6 +149,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
if (itemTag == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack[] inv = new ItemStack[9];
|
||||
|
|
|
@ -1,5 +1,22 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
|
@ -7,19 +24,6 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
|||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
||||
{
|
||||
|
@ -185,6 +189,25 @@ public class VoidSigil extends ItemBucket implements ArmourUpgrade
|
|||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
TileEntity tile = par2World.getBlockTileEntity(i, j, k);
|
||||
if(tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, false);
|
||||
|
||||
if(amount != null && amount.amount > 0)
|
||||
{
|
||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), 1000, true);
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (this.isFull == 0)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -14,11 +10,20 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
||||
{
|
||||
|
@ -112,6 +117,26 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
|||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
TileEntity tile = par2World.getBlockTileEntity(i, j, k);
|
||||
if(tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(FluidRegistry.WATER,1000);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, false);
|
||||
|
||||
if(amount>0)
|
||||
{
|
||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (this.isFull == 0)
|
||||
{
|
||||
|
@ -254,7 +279,7 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
|
|||
{
|
||||
// TODO Auto-generated method stub
|
||||
//PotionEffect effect = new PotionEffect(Potion.waterBreathing.id, 2,9);
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9));
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9,true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -249,7 +249,7 @@ public class RitualEffectCrushing extends RitualEffect
|
|||
{
|
||||
int blockID = world.getBlockId(x + i, y + 1, z + j);
|
||||
Block block = Block.blocksList[blockID];
|
||||
if(block == Block.blockEmerald)
|
||||
if(block == Block.blockEmerald || block == Block.blockDiamond)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
package WayofTime.alchemicalWizardry.common.rituals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
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.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class RitualEffectItemSuction extends RitualEffect
|
||||
{
|
||||
@Override
|
||||
public void performEffect(IMasterRitualStone 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.getWorld();
|
||||
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
TileEntity tile = world.getBlockTileEntity(x, y + 1, z);
|
||||
IInventory tileEntity;
|
||||
|
||||
if (tile instanceof IInventory)
|
||||
{
|
||||
tileEntity = (IInventory) tile;
|
||||
} else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileEntity.getSizeInventory() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentEssence < this.getCostPerRefresh()*100)
|
||||
{
|
||||
EntityPlayer entityOwner = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(owner);
|
||||
|
||||
if (entityOwner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
|
||||
} else
|
||||
{
|
||||
List<EntityItem> itemDropList = SpellHelper.getItemsInRange(world, x+0.5f, y+0.5f, z+0.5f, 10, 10);
|
||||
|
||||
int count = 0;
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
int invSize = tileEntity.getSizeInventory();
|
||||
|
||||
for (EntityItem itemEntity : itemDropList)
|
||||
{
|
||||
ItemStack item = itemEntity.getEntityItem();
|
||||
ItemStack copyStack = itemEntity.getEntityItem().copy();
|
||||
|
||||
count++;
|
||||
|
||||
for (int n = 0; n < invSize; n++)
|
||||
{
|
||||
if (tileEntity.isItemValidForSlot(n, copyStack) && copyStack.stackSize != 0)
|
||||
{
|
||||
ItemStack itemStack = tileEntity.getStackInSlot(n);
|
||||
|
||||
if (itemStack == null)
|
||||
{
|
||||
tileEntity.setInventorySlotContents(n, item);
|
||||
copyStack.stackSize = 0;
|
||||
} else
|
||||
{
|
||||
if (itemStack.getItem().equals(copyStack.getItem()))
|
||||
{
|
||||
int itemSize = itemStack.stackSize;
|
||||
int copySize = copyStack.stackSize;
|
||||
int maxSize = itemStack.getMaxStackSize();
|
||||
|
||||
if (copySize + itemSize < maxSize)
|
||||
{
|
||||
copyStack.stackSize = 0;
|
||||
itemStack.stackSize = itemSize + copySize;
|
||||
tileEntity.setInventorySlotContents(n, itemStack);
|
||||
} else
|
||||
{
|
||||
copyStack.stackSize = itemSize + copySize - maxSize;
|
||||
itemStack.stackSize = maxSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(copyStack.stackSize<=0)
|
||||
{
|
||||
itemEntity.setDead();
|
||||
}
|
||||
|
||||
if (copyStack.stackSize > 0)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack));
|
||||
//flag=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count>0)
|
||||
{
|
||||
data.currentEssence = currentEssence - this.getCostPerRefresh()*Math.min(count, 100);
|
||||
data.markDirty();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCostPerRefresh()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RitualComponent> getRitualComponentList()
|
||||
{
|
||||
ArrayList<RitualComponent> suctionRitual = new ArrayList();
|
||||
suctionRitual.add(new RitualComponent(2, 0, 0, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(0, 0, 2, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(0, 0, -2, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(1, 1, 1, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(1, 1, -1, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(-1, 1, 1, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(-1, 1, -1, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(1, -1, 0, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(-1, -1, 0, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(0, -1, 1, RitualComponent.AIR));
|
||||
suctionRitual.add(new RitualComponent(0, -1, -1, RitualComponent.AIR));
|
||||
return suctionRitual;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import java.util.Random;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFluid;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -233,4 +234,9 @@ public class SpellHelper
|
|||
PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(xVel, yVel, zVel), (Player)player);
|
||||
|
||||
}
|
||||
|
||||
public static List<EntityItem> getItemsInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,9 +14,12 @@ import net.minecraft.network.packet.Packet;
|
|||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
||||
import WayofTime.alchemicalWizardry.common.ICatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
|
@ -751,7 +754,14 @@ public class TEWritingTable extends TileEntity implements ISidedInventory
|
|||
progress = 0;
|
||||
this.setInventorySlotContents(6, getResultingItemStack());
|
||||
|
||||
this.decrementSlots(AlchemyRecipeRegistry.getRecipeForItemStack(getResultingItemStack()));
|
||||
ItemStack[] composedRecipe = new ItemStack[5];
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
composedRecipe[i] = inv[i + 1];
|
||||
}
|
||||
|
||||
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
|
||||
|
||||
if (worldObj != null)
|
||||
{
|
||||
|
@ -779,7 +789,14 @@ public class TEWritingTable extends TileEntity implements ISidedInventory
|
|||
result.stackSize += getStackInSlot(6).stackSize;
|
||||
this.setInventorySlotContents(6, result);
|
||||
|
||||
this.decrementSlots(AlchemyRecipeRegistry.getRecipeForItemStack(getResultingItemStack()));
|
||||
ItemStack[] composedRecipe = new ItemStack[5];
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
composedRecipe[i] = inv[i + 1];
|
||||
}
|
||||
|
||||
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
|
||||
|
||||
if (worldObj != null)
|
||||
{
|
||||
|
@ -837,7 +854,7 @@ public class TEWritingTable extends TileEntity implements ISidedInventory
|
|||
return true;
|
||||
}
|
||||
|
||||
public void decrementSlots(ItemStack[] recipe)
|
||||
public void decrementSlots(ItemStack[] recipe) //TODO Fix this. This doesn't work.
|
||||
{
|
||||
boolean[] decrementedList = new boolean[]{false,false,false,false,false};
|
||||
|
||||
|
@ -854,13 +871,45 @@ public class TEWritingTable extends TileEntity implements ISidedInventory
|
|||
{
|
||||
ItemStack testStack = this.getStackInSlot(j+1);
|
||||
|
||||
if(testStack != null && testStack.isItemEqual(decStack) && !(decrementedList[j]))
|
||||
if(testStack != null && (testStack.isItemEqual(decStack) || (testStack.getItem() == decStack.getItem() && decStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) && !(decrementedList[j]))
|
||||
{
|
||||
this.decrStackSize(j+1, 1);
|
||||
if(testStack.getItem().hasContainerItem())
|
||||
{
|
||||
this.inv[j+1] = testStack.getItem().getContainerItemStack(testStack);
|
||||
}else
|
||||
{
|
||||
this.decrStackSize(j+1, 1);
|
||||
}
|
||||
|
||||
decrementedList[j] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack[] getRecipeForItems(ItemStack[] recipe, ItemStack bloodOrb)
|
||||
{
|
||||
if (bloodOrb == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(bloodOrb.getItem() instanceof IBloodOrb))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
|
||||
|
||||
for (AlchemyRecipe ar : AlchemyRecipeRegistry.recipes)
|
||||
{
|
||||
if (ar.doesRecipeMatch(recipe, bloodOrbLevel))
|
||||
{
|
||||
return ar.getRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue