Minor tweaks + experimenting with a reagent guage for Project: Omega
This commit is contained in:
parent
dd4c36b39c
commit
9ad3330e08
10 changed files with 259 additions and 189 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
#Fri Dec 05 14:08:30 EST 2014
|
#Sat Dec 06 10:00:16 EST 2014
|
||||||
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.0Beta
|
mod_version=1.3.0Beta
|
||||||
minetweaker_version=Dev-1.7.10-3.0.9B
|
minetweaker_version=Dev-1.7.10-3.0.9B
|
||||||
|
build_number=3
|
||||||
mc_version=1.7.10
|
mc_version=1.7.10
|
||||||
build_number=2
|
|
||||||
|
|
|
@ -1,21 +1,14 @@
|
||||||
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.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.List;
|
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;
|
||||||
|
@ -1135,8 +1128,8 @@ public class AlchemicalWizardry
|
||||||
|
|
||||||
DemonVillageLootRegistry.init();
|
DemonVillageLootRegistry.init();
|
||||||
|
|
||||||
if(parseTextFiles)
|
// if(parseTextFiles)
|
||||||
this.parseTextFile();
|
// this.parseTextFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initAlchemyPotionRecipes()
|
public static void initAlchemyPotionRecipes()
|
||||||
|
@ -1368,163 +1361,164 @@ public class AlchemicalWizardry
|
||||||
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.cobblestone), 64);
|
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.cobblestone), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void parseTextFile()
|
// @SideOnly(Side.CLIENT)
|
||||||
{
|
// public void parseTextFile()
|
||||||
File textFiles = new File("config/BloodMagic/bookDocs");
|
// {
|
||||||
//if(textFiles.exists())
|
// File textFiles = new File("config/BloodMagic/bookDocs");
|
||||||
{
|
// //if(textFiles.exists())
|
||||||
try {
|
// {
|
||||||
System.out.println("I am in an island of files!");
|
// try {
|
||||||
|
// 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);
|
// {
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
// DataInputStream in = new DataInputStream(input);
|
||||||
String strLine;
|
// BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||||
//Read File Line By Line
|
// String strLine;
|
||||||
|
// //Read File Line By Line
|
||||||
int maxWidth = 25;
|
//
|
||||||
int maxLines = 16;
|
// int maxWidth = 25;
|
||||||
|
// int maxLines = 16;
|
||||||
int currentPage = 0;
|
//
|
||||||
|
// int currentPage = 0;
|
||||||
int pageIndex = 1;
|
//
|
||||||
|
// int pageIndex = 1;
|
||||||
String currentTitle = "aw.entry.Magnus";
|
//
|
||||||
|
// String currentTitle = "aw.entry.Magnus";
|
||||||
String[] strings = new String[1];
|
//
|
||||||
strings[0] = "";
|
// String[] strings = new String[1];
|
||||||
|
// strings[0] = "";
|
||||||
while ((strLine = br.readLine()) != null)
|
//
|
||||||
{
|
// while ((strLine = br.readLine()) != null)
|
||||||
if(strLine.trim().isEmpty())
|
// {
|
||||||
{
|
// if(strLine.trim().isEmpty())
|
||||||
continue;
|
// {
|
||||||
}
|
// continue;
|
||||||
|
// }
|
||||||
if(strLine.startsWith("//TITLE "))
|
//
|
||||||
{
|
// if(strLine.startsWith("//TITLE "))
|
||||||
String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing
|
// {
|
||||||
for(int i=0; i<strings.length; i++)
|
// 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];
|
// {
|
||||||
}
|
// newStrings[i] = strings[i];
|
||||||
|
// }
|
||||||
currentPage++;
|
//
|
||||||
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
// currentPage++;
|
||||||
newStrings[currentPage] = "";
|
// newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
||||||
strings = newStrings;
|
// newStrings[currentPage] = "";
|
||||||
|
// strings = newStrings;
|
||||||
pageIndex = 1;
|
//
|
||||||
|
// pageIndex = 1;
|
||||||
String title = strLine.replaceFirst("//TITLE ", " ").trim();
|
//
|
||||||
currentTitle = "aw.entry." + title;
|
// String title = strLine.replaceFirst("//TITLE ", " ").trim();
|
||||||
|
// currentTitle = "aw.entry." + title;
|
||||||
continue;
|
//
|
||||||
}
|
// continue;
|
||||||
|
// }
|
||||||
strLine = strLine.replace('”', '"').replace('“','"');
|
//
|
||||||
|
// strLine = strLine.replace('”', '"').replace('“','"');
|
||||||
if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
|
//
|
||||||
{
|
// if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
|
||||||
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110);
|
// {
|
||||||
if(list != null)
|
// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110);
|
||||||
{
|
// if(list != null)
|
||||||
System.out.println("Number of lines: " + list.size());
|
// {
|
||||||
}
|
// System.out.println("Number of lines: " + list.size());
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
String[] cutStrings = strLine.split(" ");
|
//
|
||||||
|
// String[] cutStrings = strLine.split(" ");
|
||||||
for(String word : cutStrings)
|
//
|
||||||
{
|
// for(String word : cutStrings)
|
||||||
boolean changePage = false;
|
// {
|
||||||
int length = word.length();
|
// boolean changePage = false;
|
||||||
word = word.replace('\t', ' ');
|
// int length = word.length();
|
||||||
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
|
// word = word.replace('\t', ' ');
|
||||||
|
// List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);
|
||||||
// if(currentWidth != 0 && currentWidth + length + 1 > maxWidth)
|
//
|
||||||
|
//// if(currentWidth != 0 && currentWidth + length + 1 > maxWidth)
|
||||||
|
//// {
|
||||||
|
//// currentLine++;
|
||||||
|
//// currentWidth = 0;
|
||||||
|
//// }
|
||||||
|
// //if(currentLine > maxLines)
|
||||||
|
// if(list.size() > maxLines)
|
||||||
// {
|
// {
|
||||||
// currentLine++;
|
// changePage = true;
|
||||||
// currentWidth = 0;
|
|
||||||
// }
|
// }
|
||||||
//if(currentLine > maxLines)
|
// if(changePage)
|
||||||
if(list.size() > maxLines)
|
// {
|
||||||
{
|
// String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing
|
||||||
changePage = true;
|
// for(int i=0; i<strings.length; i++)
|
||||||
}
|
// {
|
||||||
if(changePage)
|
// newStrings[i] = strings[i];
|
||||||
{
|
// }
|
||||||
String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing
|
//
|
||||||
for(int i=0; i<strings.length; i++)
|
// currentPage++;
|
||||||
{
|
//
|
||||||
newStrings[i] = strings[i];
|
// newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
||||||
}
|
// newStrings[currentPage] = word;
|
||||||
|
// strings = newStrings;
|
||||||
currentPage++;
|
//
|
||||||
|
// pageIndex++;
|
||||||
newStrings[currentPage - 1] = currentTitle + "." + pageIndex + "=" + newStrings[currentPage - 1];
|
//
|
||||||
newStrings[currentPage] = word;
|
// changePage = false;
|
||||||
strings = newStrings;
|
// }else
|
||||||
|
// {
|
||||||
pageIndex++;
|
// strings[currentPage] = strings[currentPage] + " " + word;
|
||||||
|
// }
|
||||||
changePage = false;
|
// }
|
||||||
}else
|
//
|
||||||
{
|
// int currentLines = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage], 110).size();
|
||||||
strings[currentPage] = strings[currentPage] + " " + word;
|
// while(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines)
|
||||||
}
|
// {
|
||||||
}
|
// {
|
||||||
|
// strings[currentPage] = strings[currentPage] + " ";
|
||||||
int currentLines = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage], 110).size();
|
// }
|
||||||
while(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " ", 110).size() <= currentLines)
|
// }
|
||||||
{
|
//
|
||||||
{
|
// System.out.println("" + strLine);
|
||||||
strings[currentPage] = strings[currentPage] + " ";
|
// }
|
||||||
}
|
//
|
||||||
}
|
// strings[currentPage] = currentTitle + "." + pageIndex + "=" + strings[currentPage];
|
||||||
|
//
|
||||||
System.out.println("" + strLine);
|
// File bmDirectory = new File("src/main/resources/assets/alchemicalwizardryBooks");
|
||||||
}
|
// if(!bmDirectory.exists())
|
||||||
|
// {
|
||||||
strings[currentPage] = currentTitle + "." + pageIndex + "=" + strings[currentPage];
|
// bmDirectory.mkdirs();
|
||||||
|
// }
|
||||||
File bmDirectory = new File("src/main/resources/assets/alchemicalwizardryBooks");
|
//
|
||||||
if(!bmDirectory.exists())
|
// File file = new File(bmDirectory, "books.txt");
|
||||||
{
|
//// if (file.exists() && file.length() > 3L)
|
||||||
bmDirectory.mkdirs();
|
//// {
|
||||||
}
|
////
|
||||||
|
//// }else
|
||||||
File file = new File(bmDirectory, "books.txt");
|
|
||||||
// if (file.exists() && file.length() > 3L)
|
|
||||||
// {
|
// {
|
||||||
|
// PrintWriter writer = new PrintWriter(file);
|
||||||
|
// for(String stri : strings)
|
||||||
|
// {
|
||||||
|
// writer.println(stri);
|
||||||
|
// }
|
||||||
|
// writer.close();
|
||||||
|
// }
|
||||||
//
|
//
|
||||||
// }else
|
////
|
||||||
{
|
// }
|
||||||
PrintWriter writer = new PrintWriter(file);
|
|
||||||
for(String stri : strings)
|
|
||||||
{
|
|
||||||
writer.println(stri);
|
|
||||||
}
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
// Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||||
|
//
|
||||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
// } catch (FileNotFoundException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
} catch (FileNotFoundException e) {
|
// e.printStackTrace();
|
||||||
// TODO Auto-generated catch block
|
// } catch (IOException e) {
|
||||||
e.printStackTrace();
|
// // TODO Auto-generated catch block
|
||||||
} catch (IOException e) {
|
// e.printStackTrace();
|
||||||
// TODO Auto-generated catch block
|
// }
|
||||||
e.printStackTrace();
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,31 @@
|
||||||
package WayofTime.alchemicalWizardry.client.renderer;
|
package WayofTime.alchemicalWizardry.client.renderer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiChat;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.ModItems;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiChat;
|
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class RenderHelper
|
public class RenderHelper
|
||||||
{
|
{
|
||||||
|
@ -25,6 +34,8 @@ public class RenderHelper
|
||||||
public static boolean enabled = true;
|
public static boolean enabled = true;
|
||||||
public static boolean showInChat = true;
|
public static boolean showInChat = true;
|
||||||
|
|
||||||
|
public static int zLevel = 0;
|
||||||
|
|
||||||
private static int xOffsetDefault = +50;
|
private static int xOffsetDefault = +50;
|
||||||
public static int xOffset = xOffsetDefault;
|
public static int xOffset = xOffsetDefault;
|
||||||
private static int yOffsetDefault = 2;
|
private static int yOffsetDefault = 2;
|
||||||
|
@ -53,6 +64,7 @@ public class RenderHelper
|
||||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||||
displayArmorStatus(mc);
|
displayArmorStatus(mc);
|
||||||
|
renderTestHUD(mc);
|
||||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +154,68 @@ public class RenderHelper
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void renderTestHUD(Minecraft mc)
|
||||||
|
{
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
int l;
|
||||||
|
float f;
|
||||||
|
float f3;
|
||||||
|
float f4;
|
||||||
|
TextureManager p_77015_2_ = mc.getTextureManager();
|
||||||
|
ItemStack p_77015_3_ = new ItemStack(ModItems.activationCrystal);
|
||||||
|
|
||||||
|
Object object = p_77015_3_.getIconIndex();
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||||
|
ResourceLocation resourcelocation = p_77015_2_.getResourceLocation(p_77015_3_.getItemSpriteNumber());
|
||||||
|
p_77015_2_.bindTexture(resourcelocation);
|
||||||
|
|
||||||
|
if (object == null)
|
||||||
|
{
|
||||||
|
object = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||||
|
}
|
||||||
|
|
||||||
|
l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0);
|
||||||
|
f3 = (float)(l >> 16 & 255) / 255.0F;
|
||||||
|
f4 = (float)(l >> 8 & 255) / 255.0F;
|
||||||
|
f = (float)(l & 255) / 255.0F;
|
||||||
|
|
||||||
|
// if (this.renderWithColor)
|
||||||
|
// {
|
||||||
|
// GL11.glColor4f(f3, f4, f, 1.0F);
|
||||||
|
// }
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up.
|
||||||
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
|
||||||
|
renderIcon(x, y, (IIcon)object, 16, 16);
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
||||||
|
// if (renderEffect && p_77015_3_.hasEffect(0))
|
||||||
|
// {
|
||||||
|
// renderEffect(p_77015_2_, x, y);
|
||||||
|
// }
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_)
|
||||||
|
{
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.addVertexWithUV((double)(p_94149_1_ + 0), (double)(p_94149_2_ + p_94149_5_), (double)zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMaxV());
|
||||||
|
tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)(p_94149_2_ + p_94149_5_), (double)zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMaxV());
|
||||||
|
tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)(p_94149_2_ + 0), (double)zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMinV());
|
||||||
|
tessellator.addVertexWithUV((double)(p_94149_1_ + 0), (double)(p_94149_2_ + 0), (double)zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMinV());
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
private static void displayArmorStatus(Minecraft mc)
|
private static void displayArmorStatus(Minecraft mc)
|
||||||
{
|
{
|
||||||
List<HUDElement> elements = getHUDElements(mc);
|
List<HUDElement> elements = getHUDElements(mc);
|
||||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||||
|
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||||
import codechicken.multipart.MultipartHelper;
|
import codechicken.multipart.MultipartHelper;
|
||||||
|
@ -152,7 +153,7 @@ public class BlockTeleposer extends BlockContainer
|
||||||
return new TETeleposer();
|
return new TETeleposer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean swapBlocks(World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf)
|
public static boolean swapBlocks(Object caller, World worldI, World worldF, int xi, int yi, int zi, int xf, int yf, int zf)
|
||||||
{
|
{
|
||||||
TileEntity tileEntityI = worldI.getTileEntity(xi, yi, zi);
|
TileEntity tileEntityI = worldI.getTileEntity(xi, yi, zi);
|
||||||
TileEntity tileEntityF = worldF.getTileEntity(xf, yf, zf);
|
TileEntity tileEntityF = worldF.getTileEntity(xf, yf, zf);
|
||||||
|
@ -181,7 +182,7 @@ public class BlockTeleposer extends BlockContainer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockI instanceof BlockMobSpawner || blockF instanceof BlockMobSpawner || blockI instanceof BlockPortal || blockF instanceof BlockPortal)
|
if (blockI instanceof BlockMobSpawner || blockF instanceof BlockMobSpawner || caller instanceof TEDemonPortal ? false : blockI instanceof BlockPortal || blockF instanceof BlockPortal)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class EntityMinorDemonGruntWind extends EntityMinorDemonGrunt
|
||||||
@Override
|
@Override
|
||||||
public void onLivingUpdate()
|
public void onLivingUpdate()
|
||||||
{
|
{
|
||||||
|
super.onLivingUpdate();
|
||||||
this.fallDistance = 0;
|
this.fallDistance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1296,7 +1296,7 @@ public class TEDemonPortal extends TileEntity
|
||||||
int yDestination = yLevel + yOffset;
|
int yDestination = yLevel + yOffset;
|
||||||
if(yCoord != yDestination)
|
if(yCoord != yDestination)
|
||||||
{
|
{
|
||||||
BlockTeleposer.swapBlocks(worldObj, worldObj, xCoord, yCoord, zCoord, xCoord, yDestination, zCoord);
|
BlockTeleposer.swapBlocks(this, worldObj, worldObj, xCoord, yCoord, zCoord, xCoord, yDestination, zCoord);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
//Nuthin - just as a reminder that we can now increment properly
|
//Nuthin - just as a reminder that we can now increment properly
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class RitualEffectMagnetic extends RitualEffect
|
||||||
if (oreName.contains("ore"))
|
if (oreName.contains("ore"))
|
||||||
{
|
{
|
||||||
//Allow swapping code. This means the searched block is an ore.
|
//Allow swapping code. This means the searched block is an ore.
|
||||||
BlockTeleposer.swapBlocks(world, world, x + i, j, z + k, xRep, yRep, zRep);
|
BlockTeleposer.swapBlocks(this, world, world, x + i, j, z + k, xRep, yRep, zRep);
|
||||||
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
|
SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh());
|
||||||
|
|
||||||
if (hasPotentia)
|
if (hasPotentia)
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect
|
||||||
{
|
{
|
||||||
for (int j = 0; j < vertRadius; j++)
|
for (int j = 0; j < vertRadius; j++)
|
||||||
{
|
{
|
||||||
BlockTeleposer.swapBlocks(world, world, posX + i * zOff, posY + j, posZ + i * xOff, posX + i * zOff, posY + j - vertRadius, posZ + i * xOff);
|
BlockTeleposer.swapBlocks(this, world, world, posX + i * zOff, posY + j, posZ + i * xOff, posX + i * zOff, posY + j - vertRadius, posZ + i * xOff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class SelfDefaultEarth extends SelfSpellEffect
|
||||||
{
|
{
|
||||||
if (!world.isAirBlock(posX + i, posY + j, posZ + k) && !SpellHelper.isBlockFluid(world.getBlock(posX + i, posY + j, posZ + k)))
|
if (!world.isAirBlock(posX + i, posY + j, posZ + k) && !SpellHelper.isBlockFluid(world.getBlock(posX + i, posY + j, posZ + k)))
|
||||||
{
|
{
|
||||||
BlockTeleposer.swapBlocks(world, world, posX + i, posY, posZ + k, posX + i, posY + j, posZ + k);
|
BlockTeleposer.swapBlocks(this, world, world, posX + i, posY, posZ + k, posX + i, posY + j, posZ + k);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,7 +248,7 @@ public class TETeleposer extends TileEntity implements IInventory
|
||||||
for (int j = -(focusLevel - 1); j <= (focusLevel - 1); j++)
|
for (int j = -(focusLevel - 1); j <= (focusLevel - 1); j++)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
if (BlockTeleposer.swapBlocks(worldObj, worldF, xCoord + i, yCoord + 1 + k, zCoord + j, xf + i, yf + 1 + k, zf + j))
|
if (BlockTeleposer.swapBlocks(this, worldObj, worldF, xCoord + i, yCoord + 1 + k, zCoord + j, xf + i, yf + 1 + k, zf + j))
|
||||||
{
|
{
|
||||||
transportCount++;
|
transportCount++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue