diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 923236f1..fc816938 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -1508,8 +1508,8 @@ public class AlchemicalWizardry String strLine; //Read File Line By Line - int maxWidth = 25; - int maxLines = 16; + int defMaxLines = 16; + int maxLines = defMaxLines; int currentPage = 0; @@ -1545,6 +1545,31 @@ public class AlchemicalWizardry String title = strLine.replaceFirst("//TITLE ", " ").trim(); 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 maxWidth) -// { -// currentLine++; -// currentWidth = 0; -// } - //if(currentLine > maxLines) if(list.size() > maxLines) { changePage = true; @@ -1593,7 +1612,9 @@ public class AlchemicalWizardry strings = newStrings; pageIndex++; - + + maxLines = defMaxLines; + changePage = false; }else { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java index e3b61b8f..16facc02 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java @@ -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; } + + @Override + public int hashCode() + { + return this.xCoord + this.yCoord << 8 + this.zCoord << 16; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java index 301d6398..dc648f36 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java @@ -11,6 +11,8 @@ public class RoutingFocusParadigm public List locationList = new LinkedList(); + public int maximumAmount = 0; + public void addRoutingFocusPosAndFacing(RoutingFocusPosAndFacing facing) { locationList.add(facing); @@ -38,4 +40,14 @@ public class RoutingFocusParadigm logicList.clear(); locationList.clear(); } + + public void setMaximumAmount(int amt) + { + this.maximumAmount = amt; + } + + public int getMaximumAmount() + { + return this.maximumAmount; + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java index 79fd36fc..40c3170e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java @@ -1,6 +1,7 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.eventhandler.Cancelable; import cpw.mods.fml.common.eventhandler.Event; diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java index 94fda191..5843876d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java +++ b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java @@ -49,7 +49,7 @@ public class EntryImage implements IEntry{ if(this.entryName == null) 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; y = (top + 15) + 65; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java index 62474998..bdd7fa13 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/AlchemicalWizardryEventHooks.java @@ -685,8 +685,18 @@ public class AlchemicalWizardryEventHooks } @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; + + } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java index 36e40691..167285b8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java @@ -1,5 +1,8 @@ package WayofTime.alchemicalWizardry.common.book; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import WayofTime.alchemicalWizardry.ModBlocks; @@ -41,9 +44,10 @@ public class BUEntries public void initEntries() { + HashMap aIntroMap = new HashMap(); + aIntroMap.put(0, new EntryImage("bloodutils:textures/misc/screenshots/t1.png", 854, 480)); /* The Architect */ - - aIntro = this.getPureTextEntry(5, "Your classic tragic backstory", 1); + aIntro = this.getMixedTextEntry(6, "Your classic tragic backstory", 1, aIntroMap); aBloodAltar = this.getPureTextEntry(3, "The Blood Altar", 1); aSoulNetwork = this.getPureTextEntry(3, "The Soul Network", 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); } + public Entry getMixedTextEntry(int numberOfPages, String name, int pageNumber, Map map) + { + IEntry[] entries = new IEntry[numberOfPages]; + for(int i=0; i ent : map.entrySet()) + { + if(ent.getKey() < entries.length) + { + entries[ent.getKey()] = ent.getValue(); + } + } + + return new Entry(entries, name, pageNumber); + } + /* Architect */ public static Entry aIntro; public static Entry aBloodAltar; @@ -310,4 +333,4 @@ public class BUEntries /** Debug */ EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.debug); } -} +} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java index 18a997e7..582efe26 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java @@ -1,7 +1,9 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Random; import net.minecraft.inventory.IInventory; @@ -51,26 +53,44 @@ public class RitualEffectItemRouting extends RitualEffect { return; } - + + Map tileMap = new HashMap(); + IInventory bufferInventory = (IInventory)bufferTile; + List 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++) { Int3 inputFocusChest = this.getInputBufferChestLocation(i); TileEntity inputFocusInv = world.getTileEntity(x + inputFocusChest.xCoord, y + inputFocusChest.yCoord, z + inputFocusChest.zCoord); 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); - if(stack != null && stack.getItem() instanceof InputRoutingFocus) + ItemStack inputFocusStack = ((IInventory) inputFocusInv).getStackInSlot(ji); + if(inputFocusStack != null && inputFocusStack.getItem() instanceof InputRoutingFocus) { - InputRoutingFocus inputFocus = (InputRoutingFocus)stack.getItem(); - TileEntity inputChest = world.getTileEntity(inputFocus.xCoord(stack), inputFocus.yCoord(stack), inputFocus.zCoord(stack)); + InputRoutingFocus inputFocus = (InputRoutingFocus)inputFocusStack.getItem(); + TileEntity inputChest = world.getTileEntity(inputFocus.xCoord(inputFocusStack), inputFocus.yCoord(inputFocusStack), inputFocus.zCoord(inputFocusStack)); if(inputChest instanceof IInventory) { IInventory inputChestInventory = (IInventory)inputChest; - ForgeDirection syphonDirection = inputFocus.getSetDirection(stack); + ForgeDirection syphonDirection = inputFocus.getSetDirection(inputFocusStack); boolean[] canSyphonList = new boolean[inputChestInventory.getSizeInventory()]; if(inputChest instanceof ISidedInventory) { @@ -81,33 +101,187 @@ public class RitualEffectItemRouting extends RitualEffect } }else { - for(int n=0; n