Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c12e95d07a
29 changed files with 1153 additions and 356 deletions
|
@ -9,14 +9,14 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.*;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.rituals.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -141,6 +141,41 @@ import WayofTime.alchemicalWizardry.common.potion.PotionReciprocation;
|
|||
import WayofTime.alchemicalWizardry.common.potion.PotionSoulFray;
|
||||
import WayofTime.alchemicalWizardry.common.potion.PotionSoulHarden;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAlphaPact;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAutoAlchemy;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectBiomeChanger;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectContainment;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectCrushing;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectEllipsoid;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectEvaporation;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectExpulsion;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredEarth;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredKnife;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFlight;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFullStomach;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHarvest;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemRouting;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit;
|
||||
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.RitualEffectSpawnWard;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSupression;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectUnbinding;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectVeilOfEvil;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWater;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWellOfSuffering;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.cse.earth.CSEMeleeDefaultEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.cse.earth.CSEMeleeDefensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.cse.earth.CSEMeleeEnvironmentalEarth;
|
||||
|
@ -240,8 +275,18 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
|||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
@ -252,7 +297,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class AlchemicalWizardry
|
||||
{
|
||||
public static boolean parseTextFiles = true;
|
||||
public static boolean parseTextFiles = false;
|
||||
|
||||
public static boolean doMeteorsDestroyBlocks = true;
|
||||
public static String[] diamondMeteorArray;
|
||||
|
@ -342,6 +387,7 @@ public class AlchemicalWizardry
|
|||
public static boolean respawnWithDebuff;
|
||||
public static boolean lockdownAltar;
|
||||
public static boolean causeHungerWithRegen;
|
||||
public static boolean causeHungerChatMessage = true;
|
||||
|
||||
public static List<Class> wellBlacklist;
|
||||
|
||||
|
@ -1565,7 +1611,7 @@ public class AlchemicalWizardry
|
|||
continue;
|
||||
}
|
||||
|
||||
if(strLine.startsWith("//TITLE "))
|
||||
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++)
|
||||
|
@ -1611,7 +1657,7 @@ public class AlchemicalWizardry
|
|||
continue;
|
||||
}
|
||||
|
||||
strLine = strLine.replace('', '"').replace('','"').replace("
", "...").replace('', '\'').replace('', '-');
|
||||
strLine = strLine.replace('”', '"').replace('“','"').replace("…", "...").replace('’', '\'').replace('–', '-');
|
||||
|
||||
if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
|
||||
{
|
||||
|
@ -1635,7 +1681,7 @@ public class AlchemicalWizardry
|
|||
{
|
||||
changePage = true;
|
||||
}
|
||||
if(changePage)
|
||||
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++)
|
||||
|
|
|
@ -84,8 +84,8 @@ public class BloodMagicConfiguration
|
|||
AlchemicalWizardry.customPotionSoulHardenID = config.get("Potion ID", "SoulHarden", 112).getInt();
|
||||
AlchemicalWizardry.customPotionDeafID = config.get("Potion ID", "Deaf", 113).getInt();
|
||||
AlchemicalWizardry.customPotionFeatherFallID = config.get("Potion ID", "FeatherFall", 114).getInt();
|
||||
AlchemicalWizardry.customPotionDemonCloakID = config.get("Potion ID", "DemonCloak", 114).getInt();
|
||||
AlchemicalWizardry.customPotionAmphibianID = config.get("Potion ID", "Amphibian", 115).getInt();
|
||||
AlchemicalWizardry.customPotionDemonCloakID = config.get("Potion ID", "DemonCloak", 115).getInt();
|
||||
AlchemicalWizardry.customPotionAmphibianID = config.get("Potion ID", "Amphibian", 116).getInt();
|
||||
|
||||
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
|
||||
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AltarRecipeRegistry
|
||||
{
|
||||
public static List<AltarRecipe> altarRecipes = new LinkedList();
|
||||
public static Map<Integer, ItemStack> orbMap = new HashMap();
|
||||
|
||||
public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
|
||||
{
|
||||
|
@ -21,6 +24,10 @@ public class AltarRecipeRegistry
|
|||
|
||||
public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate)
|
||||
{
|
||||
if(!orbMap.containsKey(minTier))
|
||||
{
|
||||
orbMap.put(minTier, orbStack);
|
||||
}
|
||||
registerAltarRecipe(null, orbStack, minTier, 0, consumptionRate, 0, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
|
||||
|
||||
public interface IFadedRune
|
||||
{
|
||||
public int getAltarTierLimit(int meta);
|
||||
}
|
|
@ -8,7 +8,10 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
@ -16,6 +19,7 @@ import net.minecraft.util.Vec3;
|
|||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class APISpellHelper
|
||||
{
|
||||
|
@ -247,4 +251,75 @@ public class APISpellHelper
|
|||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public static Item getItemForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findItem(modId, name);
|
||||
}
|
||||
|
||||
public static ItemStack getItemStackForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
int meta = 0;
|
||||
if(parts.length >= 3)
|
||||
{
|
||||
meta = Integer.decode(parts[2]);
|
||||
}else if(parts.length < 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
|
||||
String itemString = modId + ":" + name;
|
||||
Item item = APISpellHelper.getItemForString(itemString);
|
||||
if(item != null)
|
||||
{
|
||||
return new ItemStack(item, 1, meta);
|
||||
}
|
||||
|
||||
Block block = APISpellHelper.getBlockForString(itemString);
|
||||
if(block != null)
|
||||
{
|
||||
return new ItemStack(block, 1, meta);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IRecipe getRecipeForItemStack(ItemStack reqStack) //Does not match NBT. Durrr! -smack-
|
||||
{
|
||||
if(reqStack == null)
|
||||
{
|
||||
return null; //Why are you even doing this to yourself!? You know this can't be healthy!
|
||||
}
|
||||
List craftingList = CraftingManager.getInstance().getRecipeList();
|
||||
for(Object posRecipe : craftingList)
|
||||
{
|
||||
if(posRecipe instanceof IRecipe)
|
||||
{
|
||||
ItemStack outputStack = ((IRecipe) posRecipe).getRecipeOutput();
|
||||
if(outputStack != null)
|
||||
{
|
||||
if(outputStack.getItem() == reqStack.getItem() && (outputStack.getItem().getHasSubtypes() ? outputStack.getItemDamage() == reqStack.getItemDamage() : true))
|
||||
{
|
||||
return (IRecipe)posRecipe;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.lwjgl.opengl.GL11;
|
|||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
|
@ -63,7 +64,11 @@ public class EntryCraftingRecipe implements IEntry{
|
|||
ItemStack s = null;
|
||||
if(rec.getInput()[i] instanceof ItemStack){
|
||||
s = (ItemStack)rec.getInput()[i];
|
||||
}else if(rec.getInput()[i] instanceof Integer)
|
||||
{
|
||||
s = AltarRecipeRegistry.orbMap.get((Integer)rec.getInput()[i]);
|
||||
}else if(rec.getInput()[i] instanceof Object){
|
||||
System.out.println(rec.getInput()[i].getClass());
|
||||
s = new ItemStack(ModItems.masterBloodOrb);
|
||||
}else{
|
||||
s = ((ArrayList<ItemStack>)rec.getInput()[i]).get(0);
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
public class EntryCraftingRecipeCustomText extends EntryCraftingRecipe implements IEntryCustomText
|
||||
{
|
||||
|
||||
public EntryCraftingRecipeCustomText(IRecipe recipes)
|
||||
{
|
||||
super(recipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str){}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryImageCustomText extends EntryImage implements IEntryCustomText
|
||||
{
|
||||
public EntryImageCustomText(String resource, int iconWidth, int iconHeight)
|
||||
{
|
||||
super(resource, iconWidth, iconHeight);
|
||||
}
|
||||
|
||||
public EntryImageCustomText(String resource, int iconWidth, int iconHeight, String entryName)
|
||||
{
|
||||
super(resource, iconWidth, iconHeight, entryName);
|
||||
}
|
||||
|
||||
public String str = "";
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str)
|
||||
{
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = this.str;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15) + 65;
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryItemCustomText extends EntryItemText implements IEntryCustomText
|
||||
{
|
||||
|
||||
public EntryItemCustomText(ItemStack stack)
|
||||
{
|
||||
super(stack);
|
||||
}
|
||||
|
||||
public EntryItemCustomText(ItemStack stack, String title)
|
||||
{
|
||||
super(stack, title);
|
||||
}
|
||||
|
||||
public String str = "";
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str)
|
||||
{
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = this.str;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryTextCustomText extends EntryText implements IEntryCustomText
|
||||
{
|
||||
public String str = "";
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str)
|
||||
{
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = this.str;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
public interface IEntryCustomText extends IEntry
|
||||
{
|
||||
public String getText();
|
||||
public void setText(String str);
|
||||
}
|
|
@ -43,6 +43,7 @@ public class EntryRegistry
|
|||
public static HashMap<String, Entry> basics = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> rituals = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> bloodUtils = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> test = new HashMap();
|
||||
|
||||
public static Entry[] getEntriesInOrderForCategory(Category category)
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ public class AlchemicalWizardryEventHooks
|
|||
@SubscribeEvent
|
||||
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
|
||||
{
|
||||
if (AlchemicalWizardry.respawnWithDebuff)
|
||||
if (AlchemicalWizardry.respawnWithDebuff && event.player != null)
|
||||
{
|
||||
event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20 * 60 * 5, 0));
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.block.BloodRune;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.IFadedRune;
|
||||
import WayofTime.alchemicalWizardry.common.block.BloodRune;
|
||||
|
||||
public class UpgradedAltars
|
||||
{
|
||||
public static List<AltarComponent> secondTierAltar = new ArrayList();
|
||||
|
@ -170,6 +171,10 @@ public class UpgradedAltars
|
|||
|
||||
public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
AltarUpgradeComponent upgrades = new AltarUpgradeComponent();
|
||||
List<AltarComponent> list = UpgradedAltars.getAltarUpgradeListForTier(altarTier);
|
||||
|
||||
|
@ -180,49 +185,52 @@ public class UpgradedAltars
|
|||
//Currently checks the getRuneEffect.
|
||||
//TODO Change so that it uses the metadata instead, with the BlockID.
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
int meta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (testBlock instanceof BloodRune)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
if (testBlock instanceof IFadedRune && altarTier > ((IFadedRune)testBlock).getAltarTierLimit(meta))
|
||||
{
|
||||
switch (((BloodRune) testBlock).getRuneEffect(world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
case 1:
|
||||
upgrades.addSpeedUpgrade();
|
||||
break;
|
||||
return UpgradedAltars.getUpgrades(world, x, y, z, ((IFadedRune)testBlock).getAltarTierLimit(meta));
|
||||
}
|
||||
|
||||
switch (((BloodRune) testBlock).getRuneEffect(meta))
|
||||
{
|
||||
case 1:
|
||||
upgrades.addSpeedUpgrade();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
upgrades.addEfficiencyUpgrade();
|
||||
break;
|
||||
case 2:
|
||||
upgrades.addEfficiencyUpgrade();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
upgrades.addSacrificeUpgrade();
|
||||
break;
|
||||
case 3:
|
||||
upgrades.addSacrificeUpgrade();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
upgrades.addSelfSacrificeUpgrade();
|
||||
break;
|
||||
case 4:
|
||||
upgrades.addSelfSacrificeUpgrade();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
upgrades.addaltarCapacitiveUpgrade();
|
||||
break;
|
||||
case 5:
|
||||
upgrades.addaltarCapacitiveUpgrade();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
upgrades.addDisplacementUpgrade();
|
||||
break;
|
||||
case 6:
|
||||
upgrades.addDisplacementUpgrade();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
upgrades.addorbCapacitiveUpgrade();
|
||||
break;
|
||||
case 7:
|
||||
upgrades.addorbCapacitiveUpgrade();
|
||||
break;
|
||||
|
||||
case 8:
|
||||
upgrades.addBetterCapacitiveUpgrade();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
upgrades.addAccelerationUpgrade();
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
upgrades.addBetterCapacitiveUpgrade();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
upgrades.addAccelerationUpgrade();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.book;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,16 +31,20 @@ public class BUEntries
|
|||
categoryRituals = new Category("Rituals", new ItemStack(ModItems.itemRitualDiviner), EnumType.ITEM);
|
||||
catagoryArchitect = new Category("The Architect", new ItemStack(ModBlocks.blockAltar), EnumType.BLOCK);
|
||||
|
||||
categoryTest = new Category("Test", new ItemStack(ModItems.aether), EnumType.ITEM);
|
||||
|
||||
registerCategories();
|
||||
}
|
||||
public static Category categoryBasics;
|
||||
public static Category categoryRituals;
|
||||
public static Category catagoryArchitect;
|
||||
public static Category categoryTest;
|
||||
|
||||
public void registerCategories(){
|
||||
EntryRegistry.registerCategories(BUEntries.categoryBasics);
|
||||
EntryRegistry.registerCategories(BUEntries.categoryRituals);
|
||||
EntryRegistry.registerCategories(BUEntries.catagoryArchitect);
|
||||
EntryRegistry.registerCategories(BUEntries.categoryTest);
|
||||
}
|
||||
|
||||
public void initEntries()
|
||||
|
@ -133,6 +138,7 @@ public class BUEntries
|
|||
|
||||
/** Debug */
|
||||
debug = new Entry(new IEntry[]{new EntryText("Debug"), new EntryImage("bloodutils:textures/misc/screenshots/t1.png", 854, 480, "Debug")}, EnumChatFormatting.AQUA + "De" + EnumChatFormatting.RED + "bug", 1);
|
||||
|
||||
registerEntries();
|
||||
}
|
||||
|
||||
|
@ -332,5 +338,17 @@ public class BUEntries
|
|||
|
||||
/** Debug */
|
||||
EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.debug);
|
||||
|
||||
|
||||
|
||||
this.registerCategory(BUEntries.categoryTest, EntryRegistry.test, BookParser.parseTextFile("/assets/alchemicalwizardryBooks/books/book.txt"));
|
||||
}
|
||||
|
||||
public void registerCategory(Category cat, HashMap<String, Entry> entryMap, List<Entry> entries)
|
||||
{
|
||||
for(Entry entry : entries)
|
||||
{
|
||||
EntryRegistry.registerEntry(cat, entryMap, entry);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,334 @@
|
|||
package WayofTime.alchemicalWizardry.common.book;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||
import WayofTime.alchemicalWizardry.book.compact.Entry;
|
||||
import WayofTime.alchemicalWizardry.book.entries.EntryCraftingRecipeCustomText;
|
||||
import WayofTime.alchemicalWizardry.book.entries.EntryImageCustomText;
|
||||
import WayofTime.alchemicalWizardry.book.entries.EntryItemCustomText;
|
||||
import WayofTime.alchemicalWizardry.book.entries.EntryTextCustomText;
|
||||
import WayofTime.alchemicalWizardry.book.entries.IEntryCustomText;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BookParser
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static List<Entry> parseTextFile(String location)
|
||||
{
|
||||
File textFiles = new File("config/BloodMagic/bookDocs");
|
||||
ArrayList<Entry> entryList = new ArrayList();
|
||||
//if(textFiles.exists())
|
||||
{
|
||||
try {
|
||||
System.out.println("I am in an island of files!");
|
||||
|
||||
InputStream input = AlchemicalWizardry.class.getResourceAsStream(location);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
|
||||
if(input != null)
|
||||
{
|
||||
DataInputStream in = new DataInputStream(input);
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||
String strLine;
|
||||
//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] = "";
|
||||
|
||||
//New entry stuff
|
||||
ArrayList<IEntryCustomText> iEntryList = new ArrayList();
|
||||
IEntryCustomText currentIEntry = new EntryTextCustomText();
|
||||
|
||||
boolean lastPageWasSpecial = true;
|
||||
|
||||
int entriesPerPage = 14;
|
||||
|
||||
while ((strLine = br.readLine()) != null)
|
||||
{
|
||||
if(strLine.trim().isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(strLine.startsWith("//TITLE ")) //New entry~
|
||||
{
|
||||
lastPageWasSpecial = false;
|
||||
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];
|
||||
}
|
||||
|
||||
if(currentPage != 0) /* New stuff */
|
||||
{
|
||||
currentIEntry.setText(strings[currentPage]);
|
||||
iEntryList.add(currentIEntry);
|
||||
|
||||
Entry entry = new Entry(BookParser.getArrayForList(iEntryList), currentTitle, entryList.size() / entriesPerPage + 1);
|
||||
entryList.add(entry);
|
||||
iEntryList.clear();
|
||||
|
||||
currentIEntry = new EntryTextCustomText();
|
||||
}
|
||||
|
||||
currentPage++;
|
||||
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
||||
newStrings[currentPage] = "";
|
||||
strings = newStrings;
|
||||
|
||||
pageIndex = 1;
|
||||
|
||||
String title = strLine.replaceFirst("//TITLE ", " ").trim();
|
||||
currentTitle = title;
|
||||
|
||||
continue;
|
||||
}else if(BookParser.containsSpecialInfo(strLine))
|
||||
{
|
||||
if(!strings[currentPage].isEmpty() || lastPageWasSpecial)
|
||||
{
|
||||
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];
|
||||
}
|
||||
|
||||
currentIEntry.setText(strings[currentPage]);
|
||||
iEntryList.add(currentIEntry);
|
||||
|
||||
currentPage++;
|
||||
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
||||
newStrings[currentPage] = "";
|
||||
strings = newStrings;
|
||||
}
|
||||
|
||||
currentIEntry = BookParser.getEntryForStringTitle(strLine);
|
||||
maxLines = BookParser.getlineLimitForStringTitle(strLine, defMaxLines);
|
||||
|
||||
lastPageWasSpecial = true;
|
||||
|
||||
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)
|
||||
{
|
||||
lastPageWasSpecial = true;
|
||||
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];
|
||||
}
|
||||
|
||||
currentIEntry.setText(strings[currentPage]);
|
||||
iEntryList.add(currentIEntry);
|
||||
|
||||
currentIEntry = new EntryTextCustomText();
|
||||
|
||||
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] = strings[currentPage];
|
||||
|
||||
//
|
||||
currentIEntry.setText(strings[currentPage]);
|
||||
iEntryList.add(currentIEntry);
|
||||
|
||||
Entry entry = new Entry(BookParser.getArrayForList(iEntryList), currentTitle, entryList.size() / entriesPerPage + 1);
|
||||
entryList.add(entry);
|
||||
iEntryList.clear();
|
||||
//
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
return entryList;
|
||||
}
|
||||
|
||||
public static IEntryCustomText[] getArrayForList(List<IEntryCustomText> list)
|
||||
{
|
||||
Object[] tempArray = list.toArray();
|
||||
IEntryCustomText[] customTextArray = new IEntryCustomText[tempArray.length];
|
||||
for(int i=0; i<tempArray.length; i++)
|
||||
{
|
||||
if(tempArray[i] instanceof IEntryCustomText)
|
||||
{
|
||||
customTextArray[i] = (IEntryCustomText)tempArray[i];
|
||||
}
|
||||
}
|
||||
return customTextArray;
|
||||
}
|
||||
|
||||
public static boolean containsSpecialInfo(String unparsedString)
|
||||
{
|
||||
return unparsedString.startsWith("//IMAGE") || unparsedString.startsWith("//CRAFTING") || unparsedString.startsWith("//ITEM");
|
||||
}
|
||||
|
||||
public static IEntryCustomText getEntryForStringTitle(String unparsedString)
|
||||
{
|
||||
if(unparsedString.startsWith("//IMAGE ")) //Format is //IMAGE maxLines xSize ySize ImageString (optional)Title
|
||||
{
|
||||
String lines = unparsedString.replaceFirst("//IMAGE ", "");
|
||||
String[] arguments = lines.split(" ");
|
||||
if(arguments.length < 4)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int xSize = Integer.decode(arguments[1]);
|
||||
int ySize = Integer.decode(arguments[2]);
|
||||
if(arguments.length >= 5)
|
||||
{
|
||||
return new EntryImageCustomText(arguments[3], xSize, ySize, arguments[4]);
|
||||
}else
|
||||
{
|
||||
return new EntryImageCustomText(arguments[3], xSize, ySize);
|
||||
}
|
||||
}else if(unparsedString.startsWith("//CRAFTING "))
|
||||
{
|
||||
String lines = unparsedString.replaceFirst("//CRAFTING ", "");
|
||||
ItemStack stack = APISpellHelper.getItemStackForString(lines);
|
||||
IRecipe recipe = APISpellHelper.getRecipeForItemStack(stack);
|
||||
if(recipe != null)
|
||||
{
|
||||
return new EntryCraftingRecipeCustomText(recipe);
|
||||
}
|
||||
}else if(unparsedString.startsWith("//ITEM "))
|
||||
{
|
||||
String lines = unparsedString.replaceFirst("//ITEM ", "");
|
||||
ItemStack stack = APISpellHelper.getItemStackForString(lines);
|
||||
if(stack != null)
|
||||
{
|
||||
return new EntryItemCustomText(stack);
|
||||
}
|
||||
}
|
||||
|
||||
return new EntryTextCustomText();
|
||||
}
|
||||
|
||||
public static int getlineLimitForStringTitle(String unparsedString, int def)
|
||||
{
|
||||
if(unparsedString.startsWith("//IMAGE "))
|
||||
{
|
||||
String lines = unparsedString.replaceFirst("//IMAGE ", "");
|
||||
String[] arguments = lines.split(" ");
|
||||
if(arguments.length < 4)
|
||||
{
|
||||
return def;
|
||||
}
|
||||
|
||||
return Integer.decode(arguments[0]);
|
||||
}else if(unparsedString.startsWith("//CRAFTING "))
|
||||
{
|
||||
return 0;
|
||||
}else if(unparsedString.startsWith("//ITEM "))
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.book;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import WayofTime.alchemicalWizardry.book.registries.RecipeRegistry;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
public class SpecialEntryRegistry
|
||||
{
|
||||
public static Map<String, IRecipe> recipeStringMap = new HashMap();
|
||||
|
||||
public static void registerIRecipeKey(IRecipe recipe, String key)
|
||||
{
|
||||
recipeStringMap.put(key, recipe);
|
||||
}
|
||||
|
||||
public static IRecipe getIRecipeForKey(String str)
|
||||
{
|
||||
return recipeStringMap.get(str);
|
||||
}
|
||||
|
||||
public static void registerLatestIRecipe(String key)
|
||||
{
|
||||
SpecialEntryRegistry.registerIRecipeKey(RecipeRegistry.getLatestCraftingRecipe(), key);
|
||||
}
|
||||
}
|
|
@ -154,7 +154,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
{
|
||||
int direction = this.getDirection(par1ItemStack);
|
||||
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer);
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) return false;
|
||||
ItemStack[] playerInventory = par2EntityPlayer.inventory.mainInventory;
|
||||
TileEntity tileEntity = par3World.getTileEntity(par4, par5, par6);
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
{
|
||||
if (par3World.isAirBlock(par4 + rc.getX(direction), par5 + rc.getY(), par6 + rc.getZ(direction)))
|
||||
{
|
||||
if (playerInvRitualStoneLocation >= 0)
|
||||
if (playerInvRitualStoneLocation >= 0 || par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(par1ItemStack))
|
||||
{
|
||||
|
@ -243,7 +243,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
}
|
||||
}
|
||||
}
|
||||
}else if(!(par3World.getBlock(par4, par5, par6) instanceof IRitualStone))
|
||||
}else if(!(par3World.getBlock(par4, par5, par6) instanceof IRitualStone) && !par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if(par3World.isRemote)
|
||||
{
|
||||
|
@ -251,6 +251,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
}
|
||||
this.cycleDirection(par1ItemStack);
|
||||
par2EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(this.getDirection(par1ItemStack))));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -259,18 +260,9 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) && par3EntityPlayer.isSneaking())
|
||||
{
|
||||
int maxRitualID = Rituals.getNumberOfRituals();
|
||||
String currentRitualID = this.getCurrentRitual(par1ItemStack);
|
||||
|
||||
this.setCurrentRitual(par1ItemStack, Rituals.getNextRitualKey(currentRitualID));
|
||||
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack)));
|
||||
par3EntityPlayer.addChatComponentMessage(chatmessagecomponent);
|
||||
}
|
||||
rotateRituals(par2World,par3EntityPlayer, par1ItemStack, true);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
|
@ -283,17 +275,23 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
{
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
|
||||
if (player.isSneaking() && !player.isSwingInProgress)
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack,player)) return true;
|
||||
|
||||
if (!player.isSwingInProgress)
|
||||
{
|
||||
int maxRitualID = Rituals.getNumberOfRituals();
|
||||
String currentRitualID = this.getCurrentRitual(stack);
|
||||
|
||||
this.setCurrentRitual(stack, Rituals.getPreviousRitualKey(currentRitualID));
|
||||
|
||||
if (entityLiving.worldObj.isRemote)
|
||||
if (player.isSneaking())
|
||||
{
|
||||
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack)));
|
||||
player.addChatComponentMessage(chatmessagecomponent);
|
||||
rotateRituals(player.worldObj, player, stack, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
int direction = this.getDirection(stack) - 1;
|
||||
if (direction == 0) direction = 4;
|
||||
this.setDirection(stack, direction);
|
||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(direction)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -301,6 +299,20 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
return false;
|
||||
}
|
||||
|
||||
public void rotateRituals(World world, EntityPlayer player, ItemStack stack, boolean next)
|
||||
{
|
||||
int maxRitualID = Rituals.getNumberOfRituals();
|
||||
String currentRitualID = this.getCurrentRitual(stack);
|
||||
|
||||
this.setCurrentRitual(stack, next? Rituals.getNextRitualKey(currentRitualID):Rituals.getPreviousRitualKey(currentRitualID));
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack)));
|
||||
player.addChatComponentMessage(chatmessagecomponent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrentRitual(ItemStack par1ItemStack)
|
||||
{
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LavaCrystal extends EnergyItems
|
||||
{
|
||||
|
@ -84,7 +86,13 @@ public class LavaCrystal extends EnergyItems
|
|||
return false;
|
||||
}
|
||||
|
||||
World world = MinecraftServer.getServer().worldServers[0];
|
||||
// World world = MinecraftServer.getServer().worldServers[0];
|
||||
WorldProvider provider = DimensionManager.getProvider(0);
|
||||
if(provider == null || provider.worldObj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
World world = provider.worldObj;
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
|
||||
if (data == null)
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.potion;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PotionSoulFray extends Potion
|
||||
{
|
||||
public PotionSoulFray(int par1, boolean par2, int par3)
|
||||
|
@ -15,4 +19,16 @@ public class PotionSoulFray extends Potion
|
|||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entityLivingBase, int level)
|
||||
{
|
||||
entityLivingBase.getActivePotionEffect(this).setCurativeItems(new ArrayList<ItemStack>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady(int duration, int level)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RitualEffectDemonPortal extends RitualEffect
|
|||
if(reagentAmount < neededAmount)
|
||||
{
|
||||
reagentsFulfilled = false;
|
||||
System.out.println("Reagents not fulfilled. Missing: " + ReagentRegistry.getKeyForReagent(reagent));
|
||||
// System.out.println("Reagents not fulfilled. Missing: " + ReagentRegistry.getKeyForReagent(reagent));
|
||||
int drainAmount = Math.min(drainRate, neededAmount - reagentAmount);
|
||||
|
||||
if(drainAmount <= 0)
|
||||
|
|
|
@ -619,6 +619,10 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
if (regenEffect != null && regenEffect.getAmplifier() > 0)
|
||||
{
|
||||
if(AlchemicalWizardry.causeHungerChatMessage && player.getActivePotionEffect(Potion.hunger) == null)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger")));
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue