Removed needing a buffer chest for the new item routing ritual - working on a few odd quirks, however.
This commit is contained in:
parent
2888fcfe07
commit
539bb564fa
12 changed files with 437 additions and 188 deletions
|
@ -1508,8 +1508,8 @@ public class AlchemicalWizardry
|
||||||
String strLine;
|
String strLine;
|
||||||
//Read File Line By Line
|
//Read File Line By Line
|
||||||
|
|
||||||
int maxWidth = 25;
|
int defMaxLines = 16;
|
||||||
int maxLines = 16;
|
int maxLines = defMaxLines;
|
||||||
|
|
||||||
int currentPage = 0;
|
int currentPage = 0;
|
||||||
|
|
||||||
|
@ -1545,6 +1545,31 @@ public class AlchemicalWizardry
|
||||||
String title = strLine.replaceFirst("//TITLE ", " ").trim();
|
String title = strLine.replaceFirst("//TITLE ", " ").trim();
|
||||||
currentTitle = "aw.entry." + title;
|
currentTitle = "aw.entry." + title;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}else if(strLine.startsWith("//SPECIAL "))
|
||||||
|
{
|
||||||
|
if(strings[currentPage].isEmpty())
|
||||||
|
{
|
||||||
|
String lines = strLine.replaceFirst("//SPECIAL ", "");
|
||||||
|
Integer ln = Integer.decode(lines);
|
||||||
|
if(ln != null)
|
||||||
|
{
|
||||||
|
maxLines = ln;
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing
|
||||||
|
for(int i=0; i<strings.length; i++)
|
||||||
|
{
|
||||||
|
newStrings[i] = strings[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPage++;
|
||||||
|
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
||||||
|
newStrings[currentPage] = "";
|
||||||
|
strings = newStrings;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1568,12 +1593,6 @@ public class AlchemicalWizardry
|
||||||
word = word.replace('\t', ' ');
|
word = word.replace('\t', ' ');
|
||||||
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
|
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
|
||||||
|
|
||||||
// if(currentWidth != 0 && currentWidth + length + 1 > maxWidth)
|
|
||||||
// {
|
|
||||||
// currentLine++;
|
|
||||||
// currentWidth = 0;
|
|
||||||
// }
|
|
||||||
//if(currentLine > maxLines)
|
|
||||||
if(list.size() > maxLines)
|
if(list.size() > maxLines)
|
||||||
{
|
{
|
||||||
changePage = true;
|
changePage = true;
|
||||||
|
@ -1594,6 +1613,8 @@ public class AlchemicalWizardry
|
||||||
|
|
||||||
pageIndex++;
|
pageIndex++;
|
||||||
|
|
||||||
|
maxLines = defMaxLines;
|
||||||
|
|
||||||
changePage = false;
|
changePage = false;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,4 +35,10 @@ public class Int3
|
||||||
{
|
{
|
||||||
return o instanceof Int3 ? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord && ((Int3) o).zCoord == this.zCoord : false;
|
return o instanceof Int3 ? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord && ((Int3) o).zCoord == this.zCoord : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
return this.xCoord + this.yCoord << 8 + this.zCoord << 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ public class RoutingFocusParadigm
|
||||||
|
|
||||||
public List<RoutingFocusPosAndFacing> locationList = new LinkedList();
|
public List<RoutingFocusPosAndFacing> locationList = new LinkedList();
|
||||||
|
|
||||||
|
public int maximumAmount = 0;
|
||||||
|
|
||||||
public void addRoutingFocusPosAndFacing(RoutingFocusPosAndFacing facing)
|
public void addRoutingFocusPosAndFacing(RoutingFocusPosAndFacing facing)
|
||||||
{
|
{
|
||||||
locationList.add(facing);
|
locationList.add(facing);
|
||||||
|
@ -38,4 +40,14 @@ public class RoutingFocusParadigm
|
||||||
logicList.clear();
|
logicList.clear();
|
||||||
locationList.clear();
|
locationList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMaximumAmount(int amt)
|
||||||
|
{
|
||||||
|
this.maximumAmount = amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaximumAmount()
|
||||||
|
{
|
||||||
|
return this.maximumAmount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package WayofTime.alchemicalWizardry.api.event;
|
package WayofTime.alchemicalWizardry.api.event;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||||
import cpw.mods.fml.common.eventhandler.Event;
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class EntryImage implements IEntry{
|
||||||
if(this.entryName == null)
|
if(this.entryName == null)
|
||||||
this.entryName = key;
|
this.entryName = key;
|
||||||
|
|
||||||
String s = StatCollector.translateToLocal("bu.entry." + this.entryName + "." + page);
|
String s = StatCollector.translateToLocal("aw.entry." + this.entryName + "." + page);
|
||||||
x = left + width / 2 - 58;
|
x = left + width / 2 - 58;
|
||||||
y = (top + 15) + 65;
|
y = (top + 15) + 65;
|
||||||
|
|
||||||
|
|
|
@ -685,8 +685,18 @@ public class AlchemicalWizardryEventHooks
|
||||||
}
|
}
|
||||||
|
|
||||||
@Optional.Method(modid = "Botania")
|
@Optional.Method(modid = "Botania")
|
||||||
private boolean isManaBurst(Entity projectile)
|
private boolean isManaBurst(Entity entity)
|
||||||
{
|
{
|
||||||
return projectile instanceof IManaBurst;
|
if(entity instanceof IManaBurst) {
|
||||||
|
ItemStack lens = ((IManaBurst)entity).getSourceLens();
|
||||||
|
if(lens.getItemDamage()!=8 && lens.getItemDamage()!=11)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package WayofTime.alchemicalWizardry.common.book;
|
package WayofTime.alchemicalWizardry.common.book;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
@ -41,9 +44,10 @@ public class BUEntries
|
||||||
|
|
||||||
public void initEntries()
|
public void initEntries()
|
||||||
{
|
{
|
||||||
|
HashMap<Integer, IEntry> aIntroMap = new HashMap();
|
||||||
|
aIntroMap.put(0, new EntryImage("bloodutils:textures/misc/screenshots/t1.png", 854, 480));
|
||||||
/* The Architect */
|
/* The Architect */
|
||||||
|
aIntro = this.getMixedTextEntry(6, "Your classic tragic backstory", 1, aIntroMap);
|
||||||
aIntro = this.getPureTextEntry(5, "Your classic tragic backstory", 1);
|
|
||||||
aBloodAltar = this.getPureTextEntry(3, "The Blood Altar", 1);
|
aBloodAltar = this.getPureTextEntry(3, "The Blood Altar", 1);
|
||||||
aSoulNetwork = this.getPureTextEntry(3, "The Soul Network", 1);
|
aSoulNetwork = this.getPureTextEntry(3, "The Soul Network", 1);
|
||||||
aBasicsOfSigils = this.getPureTextEntry(4, "Basics of sigils and a glimpse into the soul", 1);
|
aBasicsOfSigils = this.getPureTextEntry(4, "Basics of sigils and a glimpse into the soul", 1);
|
||||||
|
@ -142,6 +146,25 @@ public class BUEntries
|
||||||
return new Entry(entries, name, pageNumber);
|
return new Entry(entries, name, pageNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Entry getMixedTextEntry(int numberOfPages, String name, int pageNumber, Map<Integer, IEntry> map)
|
||||||
|
{
|
||||||
|
IEntry[] entries = new IEntry[numberOfPages];
|
||||||
|
for(int i=0; i<numberOfPages; i++)
|
||||||
|
{
|
||||||
|
entries[i] = new EntryText();
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Map.Entry<Integer, IEntry> ent : map.entrySet())
|
||||||
|
{
|
||||||
|
if(ent.getKey() < entries.length)
|
||||||
|
{
|
||||||
|
entries[ent.getKey()] = ent.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Entry(entries, name, pageNumber);
|
||||||
|
}
|
||||||
|
|
||||||
/* Architect */
|
/* Architect */
|
||||||
public static Entry aIntro;
|
public static Entry aIntro;
|
||||||
public static Entry aBloodAltar;
|
public static Entry aBloodAltar;
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package WayofTime.alchemicalWizardry.common.rituals;
|
package WayofTime.alchemicalWizardry.common.rituals;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
|
@ -52,25 +54,43 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<Int3, IInventory> tileMap = new HashMap();
|
||||||
|
|
||||||
IInventory bufferInventory = (IInventory)bufferTile;
|
IInventory bufferInventory = (IInventory)bufferTile;
|
||||||
|
|
||||||
|
List<IInventory> outputList = new ArrayList();
|
||||||
|
for(int i=0; i<4; i++) //Check output foci chests, return if none available
|
||||||
|
{
|
||||||
|
Int3 outputFocusChest = this.getOutputBufferChestLocation(i);
|
||||||
|
TileEntity outputFocusInv = world.getTileEntity(x + outputFocusChest.xCoord, y + outputFocusChest.yCoord, z + outputFocusChest.zCoord);
|
||||||
|
if(outputFocusInv instanceof IInventory)
|
||||||
|
{
|
||||||
|
outputList.add((IInventory)outputFocusInv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(outputList.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i=0; i<4; i++)
|
for(int i=0; i<4; i++)
|
||||||
{
|
{
|
||||||
Int3 inputFocusChest = this.getInputBufferChestLocation(i);
|
Int3 inputFocusChest = this.getInputBufferChestLocation(i);
|
||||||
TileEntity inputFocusInv = world.getTileEntity(x + inputFocusChest.xCoord, y + inputFocusChest.yCoord, z + inputFocusChest.zCoord);
|
TileEntity inputFocusInv = world.getTileEntity(x + inputFocusChest.xCoord, y + inputFocusChest.yCoord, z + inputFocusChest.zCoord);
|
||||||
if(inputFocusInv instanceof IInventory)
|
if(inputFocusInv instanceof IInventory)
|
||||||
{
|
{
|
||||||
for(int j=0; j<((IInventory) inputFocusInv).getSizeInventory(); j++)
|
for(int ji=0; ji<((IInventory) inputFocusInv).getSizeInventory(); ji++) //Iterate through foci inventory
|
||||||
{
|
{
|
||||||
ItemStack stack = ((IInventory) inputFocusInv).getStackInSlot(j);
|
ItemStack inputFocusStack = ((IInventory) inputFocusInv).getStackInSlot(ji);
|
||||||
if(stack != null && stack.getItem() instanceof InputRoutingFocus)
|
if(inputFocusStack != null && inputFocusStack.getItem() instanceof InputRoutingFocus)
|
||||||
{
|
{
|
||||||
InputRoutingFocus inputFocus = (InputRoutingFocus)stack.getItem();
|
InputRoutingFocus inputFocus = (InputRoutingFocus)inputFocusStack.getItem();
|
||||||
TileEntity inputChest = world.getTileEntity(inputFocus.xCoord(stack), inputFocus.yCoord(stack), inputFocus.zCoord(stack));
|
TileEntity inputChest = world.getTileEntity(inputFocus.xCoord(inputFocusStack), inputFocus.yCoord(inputFocusStack), inputFocus.zCoord(inputFocusStack));
|
||||||
if(inputChest instanceof IInventory)
|
if(inputChest instanceof IInventory)
|
||||||
{
|
{
|
||||||
IInventory inputChestInventory = (IInventory)inputChest;
|
IInventory inputChestInventory = (IInventory)inputChest;
|
||||||
ForgeDirection syphonDirection = inputFocus.getSetDirection(stack);
|
ForgeDirection syphonDirection = inputFocus.getSetDirection(inputFocusStack);
|
||||||
boolean[] canSyphonList = new boolean[inputChestInventory.getSizeInventory()];
|
boolean[] canSyphonList = new boolean[inputChestInventory.getSizeInventory()];
|
||||||
if(inputChest instanceof ISidedInventory)
|
if(inputChest instanceof ISidedInventory)
|
||||||
{
|
{
|
||||||
|
@ -81,50 +101,27 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
for(int n=0; n<inputChestInventory.getSizeInventory(); n++)
|
for(int ni=0; ni<inputChestInventory.getSizeInventory(); ni++)
|
||||||
{
|
{
|
||||||
canSyphonList[n] = true;
|
canSyphonList[ni] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int n=0; n<inputChestInventory.getSizeInventory(); n++)
|
for(int ni=0; ni<inputChestInventory.getSizeInventory(); ni++)
|
||||||
{
|
{
|
||||||
if(canSyphonList[n])
|
if(canSyphonList[ni])
|
||||||
{
|
{
|
||||||
ItemStack syphonedStack = inputChestInventory.getStackInSlot(n);
|
ItemStack syphonedStack = inputChestInventory.getStackInSlot(ni); //Has a syphoned item linked, next need to find a destination
|
||||||
if(syphonedStack == null)
|
if(syphonedStack == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = syphonedStack.stackSize;
|
int size = syphonedStack.stackSize;
|
||||||
ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, bufferInventory, ForgeDirection.DOWN);
|
|
||||||
if(size == newStack.stackSize)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(newStack != null && newStack.stackSize <= 0)
|
|
||||||
{
|
|
||||||
newStack = null;
|
|
||||||
}
|
|
||||||
inputChestInventory.setInventorySlotContents(n, newStack);
|
|
||||||
// break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int i=0; i<4; i++)
|
for(IInventory outputFocusInventory : outputList)
|
||||||
{
|
{
|
||||||
Int3 outputFocusChest = this.getOutputBufferChestLocation(i);
|
ItemStack stack = outputFocusInventory.getStackInSlot(0);
|
||||||
TileEntity outputFocusInv = world.getTileEntity(x + outputFocusChest.xCoord, y + outputFocusChest.yCoord, z + outputFocusChest.zCoord);
|
|
||||||
if(outputFocusInv instanceof IInventory)
|
|
||||||
{
|
|
||||||
IInventory outputFocusInventory = (IInventory)outputFocusInv;
|
|
||||||
ItemStack stack = ((IInventory) outputFocusInv).getStackInSlot(0);
|
|
||||||
if(stack != null && stack.getItem() instanceof OutputRoutingFocus) //TODO change to output routing focus
|
if(stack != null && stack.getItem() instanceof OutputRoutingFocus) //TODO change to output routing focus
|
||||||
{
|
{
|
||||||
boolean transferEverything = true;
|
boolean transferEverything = true;
|
||||||
|
@ -143,37 +140,49 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(stack));
|
parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(stack));
|
||||||
parad.addLogic(outputFocus.getLogic(stack.getItemDamage()));
|
parad.addLogic(outputFocus.getLogic(stack.getItemDamage()));
|
||||||
|
|
||||||
TileEntity outputChest = world.getTileEntity(outputFocus.xCoord(stack), outputFocus.yCoord(stack), outputFocus.zCoord(stack)); //Destination
|
Int3 outputChestPos = new Int3(outputFocus.xCoord(stack), outputFocus.yCoord(stack), outputFocus.zCoord(stack));
|
||||||
ForgeDirection inputDirection = outputFocus.getSetDirection(stack);
|
TileEntity outputChest; //Destination
|
||||||
|
if(tileMap.containsKey(outputChestPos))
|
||||||
if(transferEverything)
|
|
||||||
{
|
{
|
||||||
|
outputChest = (TileEntity) tileMap.get(outputChestPos);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
outputChest = world.getTileEntity(outputFocus.xCoord(stack), outputFocus.yCoord(stack), outputFocus.zCoord(stack));
|
||||||
if(outputChest instanceof IInventory)
|
if(outputChest instanceof IInventory)
|
||||||
{
|
{
|
||||||
IInventory outputChestInventory = (IInventory)outputChest;
|
tileMap.put(outputChestPos, (IInventory)outputChest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ForgeDirection inputDirection = outputFocus.getSetDirection(stack);
|
||||||
|
|
||||||
for(int n=0; n<bufferInventory.getSizeInventory(); n++)
|
// if(transferEverything)
|
||||||
{
|
// {
|
||||||
ItemStack syphonedStack = bufferInventory.getStackInSlot(n);
|
// if(outputChest instanceof IInventory)
|
||||||
if(syphonedStack == null)
|
// {
|
||||||
{
|
// IInventory outputChestInventory = (IInventory)outputChest;
|
||||||
continue;
|
//
|
||||||
}
|
// for(int n=0; n<bufferInventory.getSizeInventory(); n++)
|
||||||
int size = syphonedStack.stackSize;
|
// {
|
||||||
ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection);
|
// ItemStack syphonedStack = bufferInventory.getStackInSlot(n);
|
||||||
if(size == newStack.stackSize)
|
// if(syphonedStack == null)
|
||||||
{
|
// {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
if(newStack != null && newStack.stackSize <= 0)
|
// int size = syphonedStack.stackSize;
|
||||||
{
|
// ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection);
|
||||||
newStack = null;
|
// if(size == newStack.stackSize)
|
||||||
}
|
// {
|
||||||
bufferInventory.setInventorySlotContents(n, newStack);
|
// continue;
|
||||||
// break;
|
// }
|
||||||
}
|
// if(newStack != null && newStack.stackSize <= 0)
|
||||||
}
|
// {
|
||||||
}else
|
// newStack = null;
|
||||||
|
// }
|
||||||
|
// bufferInventory.setInventorySlotContents(n, newStack);
|
||||||
|
//// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }else
|
||||||
{
|
{
|
||||||
if(!(outputChest instanceof IInventory))
|
if(!(outputChest instanceof IInventory))
|
||||||
{
|
{
|
||||||
|
@ -218,9 +227,20 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
}
|
}
|
||||||
inputDirection = posAndFacing.facing;
|
inputDirection = posAndFacing.facing;
|
||||||
if(outputChest == null || !posAndFacing.location.equals(new Int3(outputChest.xCoord, outputChest.yCoord, outputChest.zCoord)))
|
if(outputChest == null || !posAndFacing.location.equals(new Int3(outputChest.xCoord, outputChest.yCoord, outputChest.zCoord)))
|
||||||
|
{
|
||||||
|
outputChestPos = new Int3(outputChest.xCoord, outputChest.yCoord, outputChest.zCoord);
|
||||||
|
if(tileMap.containsKey(outputChestPos))
|
||||||
|
{
|
||||||
|
outputChest = (TileEntity) tileMap.get(outputChestPos);
|
||||||
|
}else
|
||||||
{
|
{
|
||||||
outputChest = world.getTileEntity(posAndFacing.location.xCoord, posAndFacing.location.yCoord, posAndFacing.location.zCoord);
|
outputChest = world.getTileEntity(posAndFacing.location.xCoord, posAndFacing.location.yCoord, posAndFacing.location.zCoord);
|
||||||
if(outputChest instanceof IInventory)
|
if(outputChest instanceof IInventory)
|
||||||
|
{
|
||||||
|
tileMap.put(outputChestPos, (IInventory)outputChest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(outputChest instanceof IInventory)
|
||||||
{
|
{
|
||||||
outputChestInventory = (IInventory)outputChest;
|
outputChestInventory = (IInventory)outputChest;
|
||||||
}else
|
}else
|
||||||
|
@ -229,27 +249,39 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int n=0; n<bufferInventory.getSizeInventory(); n++)
|
if(parad.doesItemMatch(keyStack, syphonedStack))
|
||||||
{
|
{
|
||||||
ItemStack checkStack = bufferInventory.getStackInSlot(n);
|
ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection);
|
||||||
if(checkStack == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(parad.doesItemMatch(keyStack, checkStack))
|
|
||||||
{
|
|
||||||
int size = checkStack.stackSize;
|
|
||||||
ItemStack newStack = SpellHelper.insertStackIntoInventory(checkStack, outputChestInventory, inputDirection);
|
|
||||||
if(size == newStack.stackSize)
|
if(size == newStack.stackSize)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newStack != null && newStack.stackSize <= 0)
|
if(newStack != null && newStack.stackSize <= 0)
|
||||||
{
|
{
|
||||||
|
size = newStack.stackSize;
|
||||||
newStack = null;
|
newStack = null;
|
||||||
}
|
}
|
||||||
bufferInventory.setInventorySlotContents(n, newStack);
|
inputChestInventory.setInventorySlotContents(ni, newStack);
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, bufferInventory, ForgeDirection.DOWN);
|
||||||
|
// if(size == newStack.stackSize)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// if(newStack != null && newStack.stackSize <= 0)
|
||||||
|
// {
|
||||||
|
// newStack = null;
|
||||||
|
// }
|
||||||
|
// inputChestInventory.setInventorySlotContents(n, newStack);
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +290,149 @@ public class RitualEffectItemRouting extends RitualEffect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// for(int i=0; i<4; i++)
|
||||||
|
// {
|
||||||
|
// Int3 outputFocusChest = this.getOutputBufferChestLocation(i);
|
||||||
|
// TileEntity outputFocusInv = world.getTileEntity(x + outputFocusChest.xCoord, y + outputFocusChest.yCoord, z + outputFocusChest.zCoord);
|
||||||
|
// if(outputFocusInv instanceof IInventory)
|
||||||
|
// {
|
||||||
|
// IInventory outputFocusInventory = (IInventory)outputFocusInv;
|
||||||
|
// ItemStack stack = outputFocusInventory.getStackInSlot(0);
|
||||||
|
// if(stack != null && stack.getItem() instanceof OutputRoutingFocus) //TODO change to output routing focus
|
||||||
|
// {
|
||||||
|
// boolean transferEverything = true;
|
||||||
|
// for(int j=1; j<outputFocusInventory.getSizeInventory(); j++)
|
||||||
|
// {
|
||||||
|
// if(outputFocusInventory.getStackInSlot(j) != null)
|
||||||
|
// {
|
||||||
|
// transferEverything = false;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// OutputRoutingFocus outputFocus = (OutputRoutingFocus)stack.getItem();
|
||||||
|
//
|
||||||
|
// RoutingFocusParadigm parad = new RoutingFocusParadigm();
|
||||||
|
// parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(stack));
|
||||||
|
// parad.addLogic(outputFocus.getLogic(stack.getItemDamage()));
|
||||||
|
//
|
||||||
|
// TileEntity outputChest = world.getTileEntity(outputFocus.xCoord(stack), outputFocus.yCoord(stack), outputFocus.zCoord(stack)); //Destination
|
||||||
|
// ForgeDirection inputDirection = outputFocus.getSetDirection(stack);
|
||||||
|
//
|
||||||
|
// if(transferEverything)
|
||||||
|
// {
|
||||||
|
// if(outputChest instanceof IInventory)
|
||||||
|
// {
|
||||||
|
// IInventory outputChestInventory = (IInventory)outputChest;
|
||||||
|
//
|
||||||
|
// for(int n=0; n<bufferInventory.getSizeInventory(); n++)
|
||||||
|
// {
|
||||||
|
// ItemStack syphonedStack = bufferInventory.getStackInSlot(n);
|
||||||
|
// if(syphonedStack == null)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// int size = syphonedStack.stackSize;
|
||||||
|
// ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection);
|
||||||
|
// if(size == newStack.stackSize)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// if(newStack != null && newStack.stackSize <= 0)
|
||||||
|
// {
|
||||||
|
// newStack = null;
|
||||||
|
// }
|
||||||
|
// bufferInventory.setInventorySlotContents(n, newStack);
|
||||||
|
//// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }else
|
||||||
|
// {
|
||||||
|
// if(!(outputChest instanceof IInventory))
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// IInventory outputChestInventory = (IInventory)outputChest;
|
||||||
|
//
|
||||||
|
// boolean lastItemWasFocus = true;
|
||||||
|
//
|
||||||
|
// for(int j=1; j<outputFocusInventory.getSizeInventory(); j++)
|
||||||
|
// {
|
||||||
|
// ItemStack keyStack = outputFocusInventory.getStackInSlot(j);
|
||||||
|
// if(keyStack == null)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if(keyStack.getItem() instanceof OutputRoutingFocus)
|
||||||
|
// {
|
||||||
|
// if(!lastItemWasFocus)
|
||||||
|
// {
|
||||||
|
// parad.clear();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// outputFocus = (OutputRoutingFocus)keyStack.getItem();
|
||||||
|
//
|
||||||
|
// parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(keyStack));
|
||||||
|
// parad.addLogic(outputFocus.getLogic(keyStack.getItemDamage()));
|
||||||
|
// lastItemWasFocus = true;
|
||||||
|
// continue;
|
||||||
|
// }else
|
||||||
|
// {
|
||||||
|
// lastItemWasFocus = false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for(RoutingFocusPosAndFacing posAndFacing : parad.locationList)
|
||||||
|
// {
|
||||||
|
// if(posAndFacing == null)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// inputDirection = posAndFacing.facing;
|
||||||
|
// if(outputChest == null || !posAndFacing.location.equals(new Int3(outputChest.xCoord, outputChest.yCoord, outputChest.zCoord)))
|
||||||
|
// {
|
||||||
|
// outputChest = world.getTileEntity(posAndFacing.location.xCoord, posAndFacing.location.yCoord, posAndFacing.location.zCoord);
|
||||||
|
// if(outputChest instanceof IInventory)
|
||||||
|
// {
|
||||||
|
// outputChestInventory = (IInventory)outputChest;
|
||||||
|
// }else
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for(int n=0; n<bufferInventory.getSizeInventory(); n++)
|
||||||
|
// {
|
||||||
|
// ItemStack checkStack = bufferInventory.getStackInSlot(n);
|
||||||
|
// if(checkStack == null)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if(parad.doesItemMatch(keyStack, checkStack))
|
||||||
|
// {
|
||||||
|
// int size = checkStack.stackSize;
|
||||||
|
// ItemStack newStack = SpellHelper.insertStackIntoInventory(checkStack, outputChestInventory, inputDirection);
|
||||||
|
// if(size == newStack.stackSize)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// if(newStack != null && newStack.stackSize <= 0)
|
||||||
|
// {
|
||||||
|
// newStack = null;
|
||||||
|
// }
|
||||||
|
// bufferInventory.setInventorySlotContents(n, newStack);
|
||||||
|
//// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Int3 getInputBufferChestLocation(int number)
|
public Int3 getInputBufferChestLocation(int number)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
aw.entry.Magnus.1=
|
aw.entry.Magnus.1=
|
||||||
aw.entry.Your classic tragic backstory.1= My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician
|
aw.entry.Your classic tragic backstory.1= My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some
|
||||||
aw.entry.Your classic tragic backstory.2=named Magus helped tend to my wounds. The magic that he used was something that I had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded
|
aw.entry.Your classic tragic backstory.2=travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes
|
||||||
aw.entry.Your classic tragic backstory.3=my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find
|
aw.entry.Your classic tragic backstory.3=were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach
|
||||||
aw.entry.Your classic tragic backstory.4=yourself taking a nice vacation in Tartarus." The thing was, I wanted to go there - I had some unfinished business with the demons. The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to
|
aw.entry.Your classic tragic backstory.4=me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find yourself taking a nice vacation in Tartarus." The thing was, I wanted to go there - I had some unfinished business with the demons. The process that Magus originally constructed
|
||||||
aw.entry.Your classic tragic backstory.5=construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight!
|
aw.entry.Your classic tragic backstory.5=required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight!
|
||||||
aw.entry.The Blood Altar.1= To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master
|
aw.entry.The Blood Altar.1= To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master
|
||||||
aw.entry.The Blood Altar.2=Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally
|
aw.entry.The Blood Altar.2=Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally
|
||||||
aw.entry.The Blood Altar.3=sat in the altar was a Weak Blood Orb.
|
aw.entry.The Blood Altar.3=sat in the altar was a Weak Blood Orb.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//TITLE Your classic tragic backstory
|
//TITLE Your classic tragic backstory
|
||||||
|
//SPECIAL 8
|
||||||
My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village.
|
My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village.
|
||||||
I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I had never seen before – it wasn’t Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips.
|
I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I had never seen before – it wasn’t Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips.
|
||||||
|
|
||||||
|
|
|
@ -57,11 +57,12 @@ aw.entry.Serenade of the Nether.1= The next ritual I created was "The Serenade
|
||||||
|
|
||||||
--Architect--
|
--Architect--
|
||||||
|
|
||||||
aw.entry.Your classic tragic backstory.1= My name is Tiberius. I was a kid when the demons came for my village during The Wars. They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician
|
aw.entry.Your classic tragic backstory.1= My name is Tiberius. I was a kid when the demons came for my village during The Wars.
|
||||||
aw.entry.Your classic tragic backstory.2=named Magus helped tend to my wounds. The magic that he used was something that I had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded
|
aw.entry.Your classic tragic backstory.2=They ransacked the houses and turned the shacks into splinters, wielding fire and water to blast the land asunder. I woke up to some travelling merchants that were passing by, equipping the warriors who were futily trying to drive off the demons that still clawed the village. I was brought to a village nearby, where a magician named Magus helped tend to my wounds. The magic that he used was something that I
|
||||||
aw.entry.Your classic tragic backstory.3=my research and put several wards and spells on this book. So welcome, apprentice. I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find
|
aw.entry.Your classic tragic backstory.3=had never seen before - it wasn't Thaumaturgy, nor Alchemy, and it was definitely not Botany. He winked at me once he saw that my eyes were open, holding his finger to his lips. Fast-forward several years, and I have learned almost everything from Master Magus, being his third student ever to master his arts. Against his wishes, I have recorded my research and put several wards and spells on this book. So welcome, apprentice.
|
||||||
aw.entry.Your classic tragic backstory.4=yourself taking a nice vacation in Tartarus." The thing was, I wanted to go there - I had some unfinished business with the demons. The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to
|
aw.entry.Your classic tragic backstory.4=I am known as The Architect, and I am a Blood Mage. It took several years of pestering before I managed to convince Magus to teach me. He kept on telling me that, "Magic that uses the life essence of living beings requires patience and preparation in order to master it. One false move, go a little past your natural endurance, and you may find yourself taking a nice vacation in Tartarus." The thing was, I wanted to go
|
||||||
aw.entry.Your classic tragic backstory.5=construct myself an altar that would transmute items inside of its basin into new powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight!
|
aw.entry.Your classic tragic backstory.5=there - I had some unfinished business with the demons. The process that Magus originally constructed required powerful artifacts that he constructed himself, but were rather lacking where teaching was concerned. After studying a bit of alchemy and the process of "Equivalent Exchange," I managed to construct myself an altar that would transmute items inside of its basin into new
|
||||||
|
aw.entry.Your classic tragic backstory.6=powerful forms. The only issue was that it needed a worthy catalyst, and so with a prick of the finger I set the Blood Altar alight!
|
||||||
aw.entry.The Blood Altar.1= To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master
|
aw.entry.The Blood Altar.1= To start any form of transmutation involving blood, you would need to construct a blood altar and a sacrificial knife, as well as have a solitary diamond in your possession. After placing the blood altar down, Magus advised me to be careful as I filled it slowly with my blood, and said that I would need to be really close to the altar (about a metre) for the knife to work. With about 2 buckets of blood in the altar, which Master
|
||||||
aw.entry.The Blood Altar.2=Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally
|
aw.entry.The Blood Altar.2=Magus reminds me is about 10 hearts worth, I placed the diamond inside of the altar by activating it with the diamond in hand. The blood dissipated in a cloud of red swirls as I waited for the atoms of the diamond to shift and reform. There were a few moments where the particles turned gray, which meant that the altar was empty and I had to hurry to fill it. After the diamond burst in a shower of red particles, what finally
|
||||||
aw.entry.The Blood Altar.3=sat in the altar was a Weak Blood Orb.
|
aw.entry.The Blood Altar.3=sat in the altar was a Weak Blood Orb.
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.8 KiB |
Loading…
Add table
Add a link
Reference in a new issue