Finishing the darn Phantom Hands ritual

This commit is contained in:
WayofTime 2015-02-20 15:52:11 -05:00
parent f87da36775
commit dc7d9ebc06
45 changed files with 662 additions and 270 deletions

1
banned-ips.json Normal file
View file

@ -0,0 +1 @@
[]

1
banned-players.json Normal file
View file

@ -0,0 +1 @@
[]

View file

@ -1,5 +1,5 @@
# #
#Mon Feb 16 07:21:21 EST 2015 #Fri Feb 20 07:40:39 EST 2015
mod_name=BloodMagic mod_name=BloodMagic
forge_version=10.13.2.1232 forge_version=10.13.2.1232
ccc_version=1.0.4.29 ccc_version=1.0.4.29
@ -8,5 +8,5 @@ nei_version=1.0.3.64
package_group=com.wayoftime.bloodmagic package_group=com.wayoftime.bloodmagic
mod_version=1.3.1Beta1 mod_version=1.3.1Beta1
minetweaker_version=Dev-1.7.10-3.0.9B minetweaker_version=Dev-1.7.10-3.0.9B
build_number=4
mc_version=1.7.10 mc_version=1.7.10
build_number=7

3
eula.txt Normal file
View file

@ -0,0 +1,3 @@
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
#Thu Feb 19 14:13:34 EST 2015
eula=true

1
ops.json Normal file
View file

@ -0,0 +1 @@
[]

33
server.properties Normal file
View file

@ -0,0 +1,33 @@
#Minecraft server properties
#Thu Feb 19 17:21:32 EST 2015
generator-settings=
op-permission-level=4
allow-nether=true
level-name=world
enable-query=false
allow-flight=false
announce-player-achievements=true
server-port=25565
level-type=DEFAULT
enable-rcon=false
force-gamemode=false
level-seed=
server-ip=
max-build-height=256
spawn-npcs=true
white-list=false
spawn-animals=true
hardcore=false
snooper-enabled=true
online-mode=true
resource-pack=
pvp=true
difficulty=1
enable-command-block=false
gamemode=0
player-idle-timeout=0
max-players=20
spawn-monsters=true
generate-structures=true
view-distance=10
motd=A Minecraft Server

View file

@ -1,14 +1,8 @@
package WayofTime.alchemicalWizardry; package WayofTime.alchemicalWizardry;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -17,7 +11,6 @@ import java.util.List;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
@ -76,7 +69,6 @@ import WayofTime.alchemicalWizardry.common.achievements.ModAchievements;
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry; import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
import WayofTime.alchemicalWizardry.common.block.ArmourForge; import WayofTime.alchemicalWizardry.common.block.ArmourForge;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars; import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
import WayofTime.alchemicalWizardry.common.book.BUEntries;
import WayofTime.alchemicalWizardry.common.commands.CommandBind; import WayofTime.alchemicalWizardry.common.commands.CommandBind;
import WayofTime.alchemicalWizardry.common.commands.CommandSN; import WayofTime.alchemicalWizardry.common.commands.CommandSN;
import WayofTime.alchemicalWizardry.common.commands.CommandUnbind; import WayofTime.alchemicalWizardry.common.commands.CommandUnbind;
@ -141,7 +133,6 @@ import WayofTime.alchemicalWizardry.common.potion.PotionReciprocation;
import WayofTime.alchemicalWizardry.common.potion.PotionSoulFray; import WayofTime.alchemicalWizardry.common.potion.PotionSoulFray;
import WayofTime.alchemicalWizardry.common.potion.PotionSoulHarden; import WayofTime.alchemicalWizardry.common.potion.PotionSoulHarden;
import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer; import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAlphaPact;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAutoAlchemy; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAutoAlchemy;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectBiomeChanger; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectBiomeChanger;
@ -166,8 +157,6 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectMagnetic; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectMagnetic;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectOmegaStalling;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectOmegaTest;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSoulBound; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSoulBound;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSpawnWard; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSpawnWard;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor; import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor;
@ -290,8 +279,6 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.1", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") @Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.1", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
@ -941,6 +928,8 @@ public class AlchemicalWizardry
MeteorRegistry.registerMeteorParadigm(ironBlockStack, this.ironBlockMeteorArray, this.ironBlockMeteorRadius); MeteorRegistry.registerMeteorParadigm(ironBlockStack, this.ironBlockMeteorArray, this.ironBlockMeteorRadius);
MeteorRegistry.registerMeteorParadigm(new ItemStack(Items.nether_star), this.netherStarMeteorArray, this.netherStarMeteorRadius); MeteorRegistry.registerMeteorParadigm(new ItemStack(Items.nether_star), this.netherStarMeteorArray, this.netherStarMeteorRadius);
ItemStack stickStack = new ItemStack(Items.stick, 1, craftingConstant);
//Register spell component recipes //Register spell component recipes
ItemStack complexSpellCrystalStack = new ItemStack(ModItems.itemComplexSpellCrystal); ItemStack complexSpellCrystalStack = new ItemStack(ModItems.itemComplexSpellCrystal);
ItemStack quartzRodStack = new ItemStack(ModItems.baseItems, 1, 0); ItemStack quartzRodStack = new ItemStack(ModItems.baseItems, 1, 0);
@ -975,6 +964,8 @@ public class AlchemicalWizardry
ItemStack soulShardStack = new ItemStack(ModItems.baseItems, 1, 29); ItemStack soulShardStack = new ItemStack(ModItems.baseItems, 1, 29);
ItemStack soulRunicPlateStack = new ItemStack(ModItems.baseItems, 1, 30); ItemStack soulRunicPlateStack = new ItemStack(ModItems.baseItems, 1, 30);
ItemStack livingBraceStack = new ItemStack(ModItems.baseItems, 1, 31); ItemStack livingBraceStack = new ItemStack(ModItems.baseItems, 1, 31);
ItemStack enderShardStack = new ItemStack(ModItems.baseItems, 1, 32);
ItemStack enderShardCraftedStack = new ItemStack(ModItems.baseItems, 8, 32);
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystal), "lsl", "sls", "lsl", 'l', lifeShardStack, 's', soulShardStack); GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystal), "lsl", "sls", "lsl", 'l', lifeShardStack, 's', soulShardStack);
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystal, 4, 1), "ss", "ss", 's', new ItemStack(ModBlocks.blockCrystal, 1, 0)); GameRegistry.addRecipe(new ItemStack(ModBlocks.blockCrystal, 4, 1), "ss", "ss", 's', new ItemStack(ModBlocks.blockCrystal, 1, 0));
@ -1068,6 +1059,15 @@ public class AlchemicalWizardry
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfSupression), "wtl", "wvl", "wol", 'v', new ItemStack(ModItems.voidSigil), 't', new ItemStack(ModBlocks.blockTeleposer), 'o', masterBloodOrbStack, 'l', lavaBucketStack, 'w', waterBucketStack)); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfSupression), "wtl", "wvl", "wol", 'v', new ItemStack(ModItems.voidSigil), 't', new ItemStack(ModBlocks.blockTeleposer), 'o', masterBloodOrbStack, 'l', lavaBucketStack, 'w', waterBucketStack));
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfEnderSeverance), "ptp", "ese", "pop", 's', new ItemStack(ModItems.demonicSlate), 't', weakBloodShardStack, 'o', masterBloodOrbStack, 'e', new ItemStack(Items.ender_eye), 'p', new ItemStack(Items.ender_pearl))); GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.itemSigilOfEnderSeverance), "ptp", "ese", "pop", 's', new ItemStack(ModItems.demonicSlate), 't', weakBloodShardStack, 'o', masterBloodOrbStack, 'e', new ItemStack(Items.ender_eye), 'p', new ItemStack(Items.ender_pearl)));
GameRegistry.addShapelessRecipe(enderShardCraftedStack, weakBloodShardStack, new ItemStack(Items.ender_pearl));
GameRegistry.addRecipe(new ItemStack(ModItems.inputRoutingFocus), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', glassStack);
GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 0), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', stoneStack);
GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 1), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', new ItemStack(Blocks.sandstone));
GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 2), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', new ItemStack(Items.dye, 1, craftingConstant));
GameRegistry.addRecipe(new ItemStack(ModItems.outputRoutingFocus, 1, 3), "sgs", "geg", "sgs", 'e', enderShardStack, 's', stickStack, 'g', obsidianStack);
AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.flint, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.gravel), new ItemStack(Items.flint)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.flint, 2, 0), 1, new ItemStack[]{new ItemStack(Blocks.gravel), new ItemStack(Items.flint)}, 1);
AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.grass), 2, new ItemStack[]{new ItemStack(Blocks.dirt), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Blocks.grass), 2, new ItemStack[]{new ItemStack(Blocks.dirt), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.wheat_seeds), new ItemStack(Items.wheat_seeds)}, 1);
AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.leather, 3, 0), 2, new ItemStack[]{new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), waterBucketStack, new ItemStack(Items.flint)}, 1); AlchemyRecipeRegistry.registerRecipe(new ItemStack(Items.leather, 3, 0), 2, new ItemStack[]{new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), new ItemStack(Items.rotten_flesh), waterBucketStack, new ItemStack(Items.flint)}, 1);
@ -1087,8 +1087,7 @@ public class AlchemicalWizardry
@EventHandler @EventHandler
public void postInit(FMLPostInitializationEvent event) public void postInit(FMLPostInitializationEvent event)
{ {
BUEntries entries = new BUEntries(); proxy.registerPostSideObjects();
entries.postInit();
//TODO Thaumcraft Integration //TODO Thaumcraft Integration
if (Loader.isModLoaded("Thaumcraft")) if (Loader.isModLoaded("Thaumcraft"))
{ {
@ -1189,8 +1188,8 @@ public class AlchemicalWizardry
DemonVillageLootRegistry.init(); DemonVillageLootRegistry.init();
if(parseTextFiles) // if(parseTextFiles)
this.parseTextFile(); // this.parseTextFile();
// this.createItemTextureFiles(); // this.createItemTextureFiles();
} }
@ -1365,10 +1364,10 @@ public class AlchemicalWizardry
Rituals.registerRitual("AW029VeilOfEvil", 1, 150000, new RitualEffectVeilOfEvil(), "Veil of Evil", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); Rituals.registerRitual("AW029VeilOfEvil", 1, 150000, new RitualEffectVeilOfEvil(), "Veil of Evil", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false));
Rituals.registerRitual("AW030FullStomach", 1, 100000, new RitualEffectFullStomach(), "Requiem of the Satiated Stomach", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false)); Rituals.registerRitual("AW030FullStomach", 1, 100000, new RitualEffectFullStomach(), "Requiem of the Satiated Stomach", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false));
Rituals.registerRitual("AW031Convocation",isDemonRitualCreativeOnly ? 10 : 2, 15000000, new RitualEffectDemonPortal(), "Convocation of the Damned", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleDemon.png"), 220, 22, 22, 255, 0, 0.501, 0.501, 0, 5, false)); Rituals.registerRitual("AW031Convocation",isDemonRitualCreativeOnly ? 10 : 2, 15000000, new RitualEffectDemonPortal(), "Convocation of the Damned", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleDemon.png"), 220, 22, 22, 255, 0, 0.501, 0.501, 0, 5, false));
Rituals.registerRitual("AW032", 1, 100, new RitualEffectOmegaTest(), "Symmetry of the Omega"); // Rituals.registerRitual("AW032", 1, 100, new RitualEffectOmegaTest(), "Symmetry of the Omega");
Rituals.registerRitual("AW033", 2, 100, new RitualEffectOmegaStalling(), "Omega Stalling"); // Rituals.registerRitual("AW033", 2, 100, new RitualEffectOmegaStalling(), "Omega Stalling");
Rituals.registerRitual("AW034", 2, 100, new RitualEffectAlphaPact(), "Alpha Pact"); // Rituals.registerRitual("AW034", 2, 100, new RitualEffectAlphaPact(), "Alpha Pact");
Rituals.registerRitual("AW035", 1, 100, new RitualEffectItemRouting(), "Orchestra of the Phantom Hands"); Rituals.registerRitual("AW035", 1, 10000, new RitualEffectItemRouting(), "Orchestra of the Phantom Hands");
//Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock")); //Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
} }
@ -1572,187 +1571,187 @@ public class AlchemicalWizardry
return strings; return strings;
} }
@SideOnly(Side.CLIENT) // @SideOnly(Side.CLIENT)
public void parseTextFile() // public void parseTextFile()
{ // {
File textFiles = new File("config/BloodMagic/bookDocs"); // File textFiles = new File("config/BloodMagic/bookDocs");
//if(textFiles.exists()) // //if(textFiles.exists())
{ // {
try { // try {
System.out.println("I am in an island of files!"); // System.out.println("I am in an island of files!");
//
InputStream input = AlchemicalWizardry.class.getResourceAsStream("/assets/alchemicalwizardryBooks/books/book.txt"); // InputStream input = AlchemicalWizardry.class.getResourceAsStream("/assets/alchemicalwizardryBooks/books/book.txt");
//
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); // Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
//
if(input != null) // if(input != null)
{ // {
DataInputStream in = new DataInputStream(input); // DataInputStream in = new DataInputStream(input);
BufferedReader br = new BufferedReader(new InputStreamReader(in)); // BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine; // String strLine;
//Read File Line By Line // //Read File Line By Line
int defMaxLines = 16;
int maxLines = defMaxLines;
int currentPage = 0;
int pageIndex = 1;
String currentTitle = "aw.entry.Magnus";
String[] strings = new String[1];
strings[0] = "";
while ((strLine = br.readLine()) != null)
{
if(strLine.trim().isEmpty())
{
continue;
}
if(strLine.startsWith("//TITLE ")) //New entry~
{
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;
pageIndex = 1;
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<strings.length; i++)
{
newStrings[i] = strings[i];
}
currentPage++;
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
newStrings[currentPage] = "";
strings = newStrings;
}
continue;
}
strLine = strLine.replace('”', '"').replace('“','"').replace("", "...").replace('', '\'').replace('', '-');
if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
{
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110);
if(list != null)
{
System.out.println("Number of lines: " + list.size());
}
}
String[] cutStrings = strLine.split(" ");
for(String word : cutStrings)
{
boolean changePage = false;
int length = word.length();
word = word.replace('\t', ' ');
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
if(list.size() > maxLines)
{
changePage = true;
}
if(changePage) //Encode into current entry, then move to next entry
{
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] = word;
strings = newStrings;
pageIndex++;
maxLines = defMaxLines;
changePage = false;
}else
{
strings[currentPage] = strings[currentPage] + " " + word;
}
}
int currentLines = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage], 110).size();
while(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines)
{
{
strings[currentPage] = strings[currentPage] + " ";
}
}
System.out.println("" + strLine);
}
strings[currentPage] = currentTitle + "." + pageIndex + "=" + strings[currentPage];
File bmDirectory = new File("src/main/resources/assets/alchemicalwizardryBooks");
if(!bmDirectory.exists())
{
bmDirectory.mkdirs();
}
File file = new File(bmDirectory, "books.txt");
// if (file.exists() && file.length() > 3L)
// {
//
// }else
{
PrintWriter writer = new PrintWriter(file);
for(String stri : strings)
{
writer.println(stri);
}
writer.close();
}
// //
} // int defMaxLines = 16;
// int maxLines = defMaxLines;
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); //
// int currentPage = 0;
} catch (FileNotFoundException e) { //
// TODO Auto-generated catch block // int pageIndex = 1;
e.printStackTrace(); //
} catch (IOException e) { // String currentTitle = "aw.entry.Magnus";
// TODO Auto-generated catch block //
e.printStackTrace(); // String[] strings = new String[1];
} // strings[0] = "";
} //
} // while ((strLine = br.readLine()) != null)
// {
// if(strLine.trim().isEmpty())
// {
// continue;
// }
//
// if(strLine.startsWith("//TITLE ")) //New entry~
// {
// 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;
//
// pageIndex = 1;
//
// 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<strings.length; i++)
// {
// newStrings[i] = strings[i];
// }
//
// currentPage++;
// newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
// newStrings[currentPage] = "";
// strings = newStrings;
// }
//
// continue;
// }
//
// strLine = strLine.replace('”', '"').replace('“','"').replace("", "...").replace('', '\'').replace('', '-');
//
// if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
// {
// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110);
// if(list != null)
// {
// System.out.println("Number of lines: " + list.size());
// }
// }
//
// String[] cutStrings = strLine.split(" ");
//
// for(String word : cutStrings)
// {
// boolean changePage = false;
// int length = word.length();
// word = word.replace('\t', ' ');
// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
//
// if(list.size() > maxLines)
// {
// changePage = true;
// }
// if(changePage) //Encode into current entry, then move to next entry
// {
// 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] = word;
// strings = newStrings;
//
// pageIndex++;
//
// maxLines = defMaxLines;
//
// changePage = false;
// }else
// {
// strings[currentPage] = strings[currentPage] + " " + word;
// }
// }
//
// int currentLines = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage], 110).size();
// while(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines)
// {
// {
// strings[currentPage] = strings[currentPage] + " ";
// }
// }
//
// System.out.println("" + strLine);
// }
//
// strings[currentPage] = currentTitle + "." + pageIndex + "=" + strings[currentPage];
//
// File bmDirectory = new File("src/main/resources/assets/alchemicalwizardryBooks");
// if(!bmDirectory.exists())
// {
// bmDirectory.mkdirs();
// }
//
// File file = new File(bmDirectory, "books.txt");
//// if (file.exists() && file.length() > 3L)
//// {
////
//// }else
// {
// PrintWriter writer = new PrintWriter(file);
// for(String stri : strings)
// {
// writer.println(stri);
// }
// writer.close();
// }
//
////
// }
//
// Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
//
// } catch (FileNotFoundException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
// }
@Mod.EventHandler @Mod.EventHandler
public void initCommands(FMLServerStartingEvent event) public void initCommands(FMLServerStartingEvent event)

View file

@ -0,0 +1,6 @@
package WayofTime.alchemicalWizardry.api;
public interface ILimitingLogic
{
public int getRoutingLimit();
}

View file

@ -0,0 +1,9 @@
package WayofTime.alchemicalWizardry.api;
public class RoutingFocusLogicLimit extends RoutingFocusLogic implements ILimitingLogic
{
public int getRoutingLimit()
{
return 0;
}
}

View file

@ -0,0 +1,26 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.items.routing.ILimitedRoutingFocus;
public class RoutingFocusLogicLimitDefault extends RoutingFocusLogicLimit
{
public int limit = 0;
public RoutingFocusLogicLimitDefault(ItemStack stack)
{
if(stack != null && stack.getItem() instanceof ILimitedRoutingFocus)
{
limit = ((ILimitedRoutingFocus)stack.getItem()).getRoutingFocusLimit(stack);
}else
{
limit = 0;
}
}
@Override
public int getRoutingLimit()
{
return limit;
}
}

View file

@ -0,0 +1,26 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.items.routing.ILimitedRoutingFocus;
public class RoutingFocusLogicLimitIgnMeta extends RoutingFocusLogicIgnMeta implements ILimitingLogic
{
public int limit = 0;
public RoutingFocusLogicLimitIgnMeta(ItemStack stack)
{
if(stack != null && stack.getItem() instanceof ILimitedRoutingFocus)
{
limit = ((ILimitedRoutingFocus)stack.getItem()).getRoutingFocusLimit(stack);
}else
{
limit = 0;
}
}
@Override
public int getRoutingLimit()
{
return limit;
}
}

View file

@ -0,0 +1,26 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.items.routing.ILimitedRoutingFocus;
public class RoutingFocusLogicLimitMatchNBT extends RoutingFocusLogicMatchNBT implements ILimitingLogic
{
public int limit = 0;
public RoutingFocusLogicLimitMatchNBT(ItemStack stack)
{
if(stack != null && stack.getItem() instanceof ILimitedRoutingFocus)
{
limit = ((ILimitedRoutingFocus)stack.getItem()).getRoutingFocusLimit(stack);
}else
{
limit = 0;
}
}
@Override
public int getRoutingLimit()
{
return limit;
}
}

View file

@ -0,0 +1,26 @@
package WayofTime.alchemicalWizardry.api;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.items.routing.ILimitedRoutingFocus;
public class RoutingFocusLogicLimitModItems extends RoutingFocusLogicModItems implements ILimitingLogic
{
public int limit = 0;
public RoutingFocusLogicLimitModItems(ItemStack stack)
{
if(stack != null && stack.getItem() instanceof ILimitedRoutingFocus)
{
limit = ((ILimitedRoutingFocus)stack.getItem()).getRoutingFocusLimit(stack);
}else
{
limit = 0;
}
}
@Override
public int getRoutingLimit()
{
return limit;
}
}

View file

@ -20,6 +20,10 @@ public class RoutingFocusParadigm
public void addLogic(RoutingFocusLogic logic) public void addLogic(RoutingFocusLogic logic)
{ {
if(logic instanceof ILimitingLogic)
{
maximumAmount += ((ILimitingLogic)logic).getRoutingLimit();
}
logicList.add(logic); logicList.add(logic);
} }

View file

@ -7,6 +7,7 @@ import net.minecraftforge.common.MinecraftForge;
import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile; import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.common.CommonProxy; import WayofTime.alchemicalWizardry.common.CommonProxy;
import WayofTime.alchemicalWizardry.common.book.BUEntries;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntEarth; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntEarth;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntFire; import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGruntFire;
@ -105,6 +106,13 @@ public class ClientProxy extends CommonProxy
public static int renderPass; public static int renderPass;
public static int altarRenderType; public static int altarRenderType;
@Override
public void registerPostSideObjects()
{
BUEntries entries = new BUEntries();
entries.postInit();
}
@Override @Override
public void registerRenderers() public void registerRenderers()
{ {

View file

@ -35,6 +35,11 @@ public class CommonProxy
{ {
// Nothing here as the server doesn't render graphics! // Nothing here as the server doesn't render graphics!
} }
public void registerPostSideObjects()
{
}
public void registerEntities() public void registerEntities()
{ {

View file

@ -17,6 +17,8 @@ import WayofTime.alchemicalWizardry.book.entries.EntryText;
import WayofTime.alchemicalWizardry.book.entries.IEntry; import WayofTime.alchemicalWizardry.book.entries.IEntry;
import WayofTime.alchemicalWizardry.book.enums.EnumType; import WayofTime.alchemicalWizardry.book.enums.EnumType;
import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; import WayofTime.alchemicalWizardry.book.registries.EntryRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BUEntries public class BUEntries
{ {
@ -47,6 +49,7 @@ public class BUEntries
EntryRegistry.registerCategories(BUEntries.categoryTest); EntryRegistry.registerCategories(BUEntries.categoryTest);
} }
@SideOnly(Side.CLIENT)
public void initEntries() public void initEntries()
{ {
HashMap<Integer, IEntry> aIntroMap = new HashMap(); HashMap<Integer, IEntry> aIntroMap = new HashMap();

View file

@ -16,7 +16,7 @@ import java.util.List;
public class ItemComponents extends Item public class ItemComponents extends Item
{ {
private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace"}; private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace", "EnderShard"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon[] icons; private IIcon[] icons;

View file

@ -0,0 +1,10 @@
package WayofTime.alchemicalWizardry.common.items.routing;
import net.minecraft.item.ItemStack;
public interface ILimitedRoutingFocus
{
public int getRoutingFocusLimit(ItemStack stack);
public void setRoutingFocusLimit(ItemStack stack, int limit);
}

View file

@ -4,30 +4,54 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicIgnMeta; import WayofTime.alchemicalWizardry.api.RoutingFocusLogicLimitDefault;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicMatchNBT; import WayofTime.alchemicalWizardry.api.RoutingFocusLogicLimitIgnMeta;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicModItems; import WayofTime.alchemicalWizardry.api.RoutingFocusLogicLimitMatchNBT;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogicLimitModItems;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class OutputRoutingFocus extends RoutingFocus public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingFocus
{ {
IIcon modItemIcon; IIcon modItemIcon;
IIcon ignMetaIcon;
IIcon matchNBTIcon;
public OutputRoutingFocus() public OutputRoutingFocus()
{ {
super(); super();
} }
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
if (!(par1ItemStack.getTagCompound() == null))
{
int limit = this.getRoutingFocusLimit(par1ItemStack);
if(limit > 0)
{
par3List.add(StatCollector.translateToLocal("tooltip.routingFocus.limit") + " " + limit);
}
}
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) public void registerIcons(IIconRegister iconRegister)
{ {
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus"); this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus");
this.modItemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusModItems"); this.modItemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusModItems");
this.ignMetaIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusIgnMeta");
this.matchNBTIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusMatchNBT");
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@ -39,6 +63,10 @@ public class OutputRoutingFocus extends RoutingFocus
return this.itemIcon; return this.itemIcon;
case 1: case 1:
return this.modItemIcon; return this.modItemIcon;
case 2:
return this.ignMetaIcon;
case 3:
return this.matchNBTIcon;
} }
return this.itemIcon; return this.itemIcon;
} }
@ -78,19 +106,49 @@ public class OutputRoutingFocus extends RoutingFocus
} }
@Override @Override
public RoutingFocusLogic getLogic(int damage) public RoutingFocusLogic getLogic(ItemStack itemStack)
{ {
switch(damage) if(itemStack != null)
{ {
case 0: switch(itemStack.getItemDamage())
return new RoutingFocusLogic(); {
case 1: case 0:
return new RoutingFocusLogicModItems(); return new RoutingFocusLogicLimitDefault(itemStack);
case 2: case 1:
return new RoutingFocusLogicIgnMeta(); return new RoutingFocusLogicLimitModItems(itemStack);
case 3: case 2:
return new RoutingFocusLogicMatchNBT(); return new RoutingFocusLogicLimitIgnMeta(itemStack);
case 3:
return new RoutingFocusLogicLimitMatchNBT(itemStack);
}
} }
return new RoutingFocusLogic(); return new RoutingFocusLogic();
} }
public int getDefaultStackLimit(int damage)
{
return 0;
}
public int getRoutingFocusLimit(ItemStack itemStack)
{
if (!(itemStack.getTagCompound() == null))
{
return itemStack.getTagCompound().getInteger("stackLimit");
} else
{
return getDefaultStackLimit(itemStack.getItemDamage());
}
}
public void setRoutingFocusLimit(ItemStack itemStack, int amt)
{
if ((itemStack.getTagCompound() == null))
{
itemStack.setTagCompound(new NBTTagCompound());
}
itemStack.getTagCompound().setInteger("stackLimit", amt);
}
} }

View file

@ -8,6 +8,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@ -15,6 +16,7 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.Int3; import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing; import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RoutingFocus extends Item public class RoutingFocus extends Item
{ {
@ -30,25 +32,25 @@ public class RoutingFocus extends Item
return new RoutingFocusPosAndFacing(new Int3(this.xCoord(itemStack), this.yCoord(itemStack), this.zCoord(itemStack)), this.getSetDirection(itemStack)); return new RoutingFocusPosAndFacing(new Int3(this.xCoord(itemStack), this.yCoord(itemStack), this.zCoord(itemStack)), this.getSetDirection(itemStack));
} }
@Override // @Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) // public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{ // {
this.cycleDirection(itemStack); // this.cycleDirection(itemStack);
return itemStack; // return itemStack;
} // }
//
public void cycleDirection(ItemStack itemStack) // public void cycleDirection(ItemStack itemStack)
{ // {
ForgeDirection dir = this.getSetDirection(itemStack); // ForgeDirection dir = this.getSetDirection(itemStack);
int direction = dir.ordinal(); // int direction = dir.ordinal();
direction++; // direction++;
if(direction >= ForgeDirection.VALID_DIRECTIONS.length) // if(direction >= ForgeDirection.VALID_DIRECTIONS.length)
{ // {
direction = 0; // direction = 0;
} // }
//
this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction)); // this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction));
} // }
public ForgeDirection getSetDirection(ItemStack itemStack) public ForgeDirection getSetDirection(ItemStack itemStack)
{ {
@ -77,7 +79,7 @@ public class RoutingFocus extends Item
@Override @Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{ {
par3List.add(this.getFocusDescription()); par3List.add(StatCollector.translateToLocal(this.getFocusDescription()));
if (!(par1ItemStack.getTagCompound() == null)) if (!(par1ItemStack.getTagCompound() == null))
{ {
@ -96,15 +98,35 @@ public class RoutingFocus extends Item
@Override @Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{ {
if(world.isRemote)
{
return false;
}
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof IInventory) if(tile instanceof IInventory)
{ {
if(player.isSneaking())
{
if(this instanceof ILimitedRoutingFocus)
{
int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack);
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, ForgeDirection.getOrientation(side));
if(amount != pastAmount)
{
((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount);
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.routerfocus.limit") + amount));
}
}
}
this.setCoordinates(stack, x, y, z); this.setCoordinates(stack, x, y, z);
this.setSetDirection(stack, ForgeDirection.getOrientation(side));
return true; return true;
} }
return false; return true;
} }
public void setCoordinates(ItemStack itemStack, int x, int y, int z) public void setCoordinates(ItemStack itemStack, int x, int y, int z)
@ -154,34 +176,8 @@ public class RoutingFocus extends Item
} }
} }
public RoutingFocusLogic getLogic(int damage) public RoutingFocusLogic getLogic(ItemStack itemStack)
{ {
return new RoutingFocusLogic(); return new RoutingFocusLogic();
} }
public int getDefaultStackLimit(int damage)
{
return 0;
}
public int getStackLimitAmount(ItemStack itemStack)
{
if (!(itemStack.getTagCompound() == null))
{
return itemStack.getTagCompound().getInteger("stackLimit");
} else
{
return getDefaultStackLimit(itemStack.getItemDamage());
}
}
public void setStackLimitAmount(ItemStack itemStack, int amt)
{
if ((itemStack.getTagCompound() == null))
{
itemStack.setTagCompound(new NBTTagCompound());
}
itemStack.getTagCompound().setInteger("stackLimit", amt);
}
} }

View file

@ -199,7 +199,7 @@ public class RitualEffectItemRouting extends RitualEffect
outputFocus = (OutputRoutingFocus)keyStack.getItem(); outputFocus = (OutputRoutingFocus)keyStack.getItem();
parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(keyStack)); parad.addRoutingFocusPosAndFacing(outputFocus.getPosAndFacing(keyStack));
parad.addLogic(outputFocus.getLogic(keyStack.getItemDamage())); parad.addLogic(outputFocus.getLogic(keyStack));
lastItemWasFocus = true; lastItemWasFocus = true;
continue; continue;
}else }else
@ -228,7 +228,14 @@ public class RitualEffectItemRouting extends RitualEffect
if(parad.doesItemMatch(keyStack, syphonedStack)) if(parad.doesItemMatch(keyStack, syphonedStack))
{ {
ItemStack newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection); ItemStack newStack = null;
if(parad.maximumAmount <= 0)
{
newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection);
}else
{
newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection, parad.maximumAmount);
}
if(size == newStack.stackSize) if(size == newStack.stackSize)
{ {
continue; continue;

View file

@ -479,6 +479,37 @@ public class SpellHelper
return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage() && Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize) > 0; return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage() && Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize) > 0;
} }
/**
* @param stack1 Stack that is placed into a slot
* @param stack2 Slot content that stack1 is placed into
* @return Stacks after stacking
*/
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2, int transferMax)
{
ItemStack[] returned = new ItemStack[2];
if (canCombine(stack1, stack2))
{
int transferedAmount = Math.min(transferMax, stack2 == null ? stack1.stackSize : Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize));
if (transferedAmount > 0)
{
ItemStack copyStack = stack1.splitStack(transferedAmount);
if (stack2 == null)
{
stack2 = copyStack;
} else
{
stack2.stackSize += transferedAmount;
}
}
}
returned[0] = stack1;
returned[1] = stack2;
return returned;
}
/** /**
* @param stack1 Stack that is placed into a slot * @param stack1 Stack that is placed into a slot
* @param stack2 Slot content that stack1 is placed into * @param stack2 Slot content that stack1 is placed into
@ -553,6 +584,115 @@ public class SpellHelper
return stack; return stack;
} }
public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory, ForgeDirection dir, int limit)
{
if (stack == null)
{
return stack;
}
boolean[] canBeInserted = new boolean[inventory.getSizeInventory()];
if(inventory instanceof ISidedInventory)
{
int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal());
for(int in : array)
{
canBeInserted[in] = ((ISidedInventory)inventory).canInsertItem(in, stack, dir.ordinal());
}
}else
{
for(int i=0; i<canBeInserted.length; i++)
{
canBeInserted[i] = true;
}
}
int numberMatching = 0;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
if(!canBeInserted[i])
{
continue;
}
ItemStack invStack = inventory.getStackInSlot(i);
if(invStack != null && canCombine(stack, invStack))
{
numberMatching += invStack.stackSize;
}
}
if(numberMatching >= limit)
{
return stack;
}
int newLimit = limit - numberMatching;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
if(!canBeInserted[i])
{
continue;
}
int prevStackSize = stack.stackSize;
ItemStack[] combinedStacks = combineStacks(stack, inventory.getStackInSlot(i), newLimit);
stack = combinedStacks[0];
inventory.setInventorySlotContents(i, combinedStacks[1]);
newLimit -= (prevStackSize - stack.stackSize);
if (newLimit <= 0 || stack.stackSize <= 0)
{
return stack;
}
}
return stack;
}
public static int getNumberOfItemsInInventory(IInventory inventory, ForgeDirection dir)
{
boolean[] canBeInserted = new boolean[inventory.getSizeInventory()];
if(inventory instanceof ISidedInventory)
{
int[] array = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(dir.ordinal());
for(int in : array)
{
canBeInserted[in] = true;
}
}else
{
for(int i=0; i<canBeInserted.length; i++)
{
canBeInserted[i] = true;
}
}
int amountOfItems = 0;
for(int i=0; i<canBeInserted.length; i++)
{
if(canBeInserted[i])
{
ItemStack stack = inventory.getStackInSlot(i);
if(stack != null)
{
amountOfItems += stack.stackSize;
}
}
}
return amountOfItems;
}
public static boolean hydrateSoil(World world, int x, int y, int z) public static boolean hydrateSoil(World world, int x, int y, int z)
{ {

View file

@ -378,6 +378,7 @@ tooltip.tanksegmenter.desc2=reagents can go into a container
tooltip.telepositionfocus.desc=An Enderpearl imbued with blood tooltip.telepositionfocus.desc=An Enderpearl imbued with blood
tooltip.voidsigil.desc=Better than a Swiffer! tooltip.voidsigil.desc=Better than a Swiffer!
tooltip.watersigil.desc=Infinite water, anyone? tooltip.watersigil.desc=Infinite water, anyone?
tooltip.routingFocus.limit=Limit:
#Messages #Messages
message.altar.capacity=Capacity: %s LP message.altar.capacity=Capacity: %s LP
@ -416,6 +417,7 @@ message.ritualdemonportal.missingjar=A jar on one of the pillars appears to be m
message.tanksegmenter.nowhas=Tank now has message.tanksegmenter.nowhas=Tank now has
message.tanksegmenter.setto=Tank Segmenter now set to: message.tanksegmenter.setto=Tank Segmenter now set to:
message.tanksegmenter.tankssetto=tank(s) set to: message.tanksegmenter.tankssetto=tank(s) set to:
message.routerfocus.limit=Focus' Item Limit set to:
#Achievements #Achievements
achievement.firstPrick=Your first prick! achievement.firstPrick=Your first prick!

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

1
usercache.json Normal file
View file

@ -0,0 +1 @@
[]

1
whitelist.json Normal file
View file

@ -0,0 +1 @@
[]

Binary file not shown.

Binary file not shown.

BIN
world/DIM-1/multipart.dat Normal file

Binary file not shown.

Binary file not shown.

BIN
world/DIM1/forcedchunks.dat Normal file

Binary file not shown.

BIN
world/DIM1/multipart.dat Normal file

Binary file not shown.

BIN
world/data/villages.dat Normal file

Binary file not shown.

BIN
world/forcedchunks.dat Normal file

Binary file not shown.

BIN
world/level.dat Normal file

Binary file not shown.

BIN
world/level.dat_old Normal file

Binary file not shown.

BIN
world/multipart.dat Normal file

Binary file not shown.

BIN
world/region/r.-1.-1.mca Normal file

Binary file not shown.

BIN
world/region/r.-1.0.mca Normal file

Binary file not shown.

BIN
world/region/r.0.-1.mca Normal file

Binary file not shown.

BIN
world/region/r.0.0.mca Normal file

Binary file not shown.

BIN
world/session.lock Normal file

Binary file not shown.