Finished almost all rituals.

This commit is contained in:
WayofTime 2015-07-29 14:26:37 -04:00
parent 1fbebc56a2
commit 86b753d098
18 changed files with 321 additions and 424 deletions

View file

@ -16,8 +16,8 @@ import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
@ -92,8 +92,8 @@ public class RitualEffectCrafting extends RitualEffect
{
int gridSpace = (i+1)*3 + (j+1);
Int3 pos = this.getSlotPositionForDirection(gridSpace, direction);
TileEntity inv = world.getTileEntity(x + pos.xCoord, y + pos.yCoord, z + pos.zCoord);
Int3 position = this.getSlotPositionForDirection(gridSpace, direction);
TileEntity inv = world.getTileEntity(pos.add(position.xCoord, position.yCoord, position.zCoord));
if(inv instanceof IInventory)
{
if(((IInventory) inv).getSizeInventory() <= slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation)))
@ -133,10 +133,10 @@ public class RitualEffectCrafting extends RitualEffect
List<IInventory> invList = new ArrayList();
TileEntity northEntity = world.getTileEntity(x, y-1, z - 2);
TileEntity southEntity = world.getTileEntity(x, y-1, z + 2);
TileEntity eastEntity = world.getTileEntity(x + 2, y-1, z);
TileEntity westEntity = world.getTileEntity(x - 2, y-1, z);
TileEntity northEntity = world.getTileEntity(pos.add(0, -1, -2));
TileEntity southEntity = world.getTileEntity(pos.add(0, -1, 2));
TileEntity eastEntity = world.getTileEntity(pos.add(2, -1, 0));
TileEntity westEntity = world.getTileEntity(pos.add(-2, -1, 0));
switch(direction)
{
@ -239,7 +239,7 @@ public class RitualEffectCrafting extends RitualEffect
if (outputInv != null)
{
if(!(!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, ForgeDirection.DOWN, true, returnStack.getMaxStackSize())))
if(!(!limitToSingleStack ? SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, EnumFacing.DOWN) : SpellHelper.canInsertStackFullyIntoInventory(returnStack, outputInv, EnumFacing.DOWN, true, returnStack.getMaxStackSize())))
{
tag.setBoolean("didLastCraftFail", true);
return;
@ -331,7 +331,7 @@ public class RitualEffectCrafting extends RitualEffect
/* The recipe is valid and the items have been found */
SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, ForgeDirection.DOWN);
SpellHelper.insertStackIntoInventory(CraftingManager.getInstance().findMatchingRecipe(inventory, world), outputInv, EnumFacing.DOWN);
for(Entry<Integer, Map<Integer, Integer>> entry1 : syphonMap.entrySet())
{
@ -366,10 +366,10 @@ public class RitualEffectCrafting extends RitualEffect
this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true);
}
world.markBlockForUpdate(x, y-1, z + 2);
world.markBlockForUpdate(x, y-1, z - 2);
world.markBlockForUpdate(x + 2, y-1, z);
world.markBlockForUpdate(x - 2, y-1, z);
world.markBlockForUpdate(pos.add(0, 1, 2));
world.markBlockForUpdate(pos.add(0, 1, -2));
world.markBlockForUpdate(pos.add(2, 1, 0));
world.markBlockForUpdate(pos.add(-2, 1, 0));
// long endTime = System.nanoTime();
//