Massive rework of configs, items and blocks.
I redone where the items/blocsks are stored and how the configs are handled to clean up it and give space. You can change the config line to AWWayofTime if you want to keep the compatibility with old configs. Now you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
parent
8601e9faff
commit
e3644f2d2b
304 changed files with 3941 additions and 5108 deletions
|
@ -1,8 +1,6 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
@ -12,15 +10,16 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class ThaumcraftApiHelper
|
||||
{
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ThaumcraftApiHelper {
|
||||
public static AspectList cullTags(AspectList temp)
|
||||
{
|
||||
AspectList temp2 = new AspectList();
|
||||
|
||||
for (Aspect tag: temp.getAspects())
|
||||
for (Aspect tag : temp.getAspects())
|
||||
{
|
||||
if (tag != null)
|
||||
{
|
||||
|
@ -33,7 +32,7 @@ public class ThaumcraftApiHelper
|
|||
Aspect lowest = null;
|
||||
int low = Integer.MAX_VALUE;
|
||||
|
||||
for (Aspect tag: temp2.getAspects())
|
||||
for (Aspect tag : temp2.getAspects())
|
||||
{
|
||||
if (tag == null)
|
||||
{
|
||||
|
@ -58,8 +57,7 @@ public class ThaumcraftApiHelper
|
|||
if (s1.isItemStackDamageable() && s2.isItemStackDamageable())
|
||||
{
|
||||
return s1.itemID == s2.itemID;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return s1.itemID == s2.itemID && s1.getItemDamage() == s2.getItemDamage();
|
||||
}
|
||||
|
@ -69,6 +67,7 @@ public class ThaumcraftApiHelper
|
|||
static Method getObjectTags;
|
||||
static Method getBonusTags;
|
||||
static Method generateTags;
|
||||
|
||||
public static boolean isResearchComplete(String username, String researchkey)
|
||||
{
|
||||
boolean ot = false;
|
||||
|
@ -82,8 +81,7 @@ public class ThaumcraftApiHelper
|
|||
}
|
||||
|
||||
ot = (Boolean) isResearchComplete.invoke(null, username, researchkey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
} catch (Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.research.ResearchManager method isResearchComplete");
|
||||
}
|
||||
|
@ -100,8 +98,7 @@ public class ThaumcraftApiHelper
|
|||
Class fake = Class.forName("thaumcraft.common.tiles.TileMagicWorkbench");
|
||||
Method getStackInRowAndColumn = fake.getMethod("getStackInRowAndColumn", int.class, int.class);
|
||||
ot = (ItemStack) getStackInRowAndColumn.invoke(instance, row, column);
|
||||
}
|
||||
catch (Exception ex)
|
||||
} catch (Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.tiles.TileMagicWorkbench method getStackInRowAndColumn");
|
||||
}
|
||||
|
@ -122,8 +119,7 @@ public class ThaumcraftApiHelper
|
|||
}
|
||||
|
||||
ot = (AspectList) getObjectTags.invoke(null, is);
|
||||
}
|
||||
catch (Exception ex)
|
||||
} catch (Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method getObjectTags");
|
||||
}
|
||||
|
@ -142,8 +138,7 @@ public class ThaumcraftApiHelper
|
|||
}
|
||||
|
||||
ot = (AspectList) getBonusTags.invoke(null, is, ot);
|
||||
}
|
||||
catch (Exception ex)
|
||||
} catch (Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method getBonusTags");
|
||||
}
|
||||
|
@ -162,8 +157,7 @@ public class ThaumcraftApiHelper
|
|||
}
|
||||
|
||||
return (AspectList) generateTags.invoke(null, id, meta);
|
||||
}
|
||||
catch (Exception ex)
|
||||
} catch (Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.ThaumcraftCraftingManager method generateTags");
|
||||
}
|
||||
|
@ -201,11 +195,10 @@ public class ThaumcraftApiHelper
|
|||
{
|
||||
TileEntity te = world.getBlockTileEntity(x + face.offsetX, y + face.offsetY, z + face.offsetZ);
|
||||
|
||||
if (te instanceof IEssentiaTransport && ((IEssentiaTransport)te).isConnectable(face.getOpposite()))
|
||||
if (te instanceof IEssentiaTransport && ((IEssentiaTransport) te).isConnectable(face.getOpposite()))
|
||||
{
|
||||
return te;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -215,18 +208,17 @@ public class ThaumcraftApiHelper
|
|||
{
|
||||
TileEntity te = world.getBlockTileEntity(x + face.offsetX, y + face.offsetY, z + face.offsetZ);
|
||||
|
||||
if (te instanceof IEssentiaTransport && ((IEssentiaTransport)te).isConnectable(face.getOpposite()))
|
||||
if (te instanceof IEssentiaTransport && ((IEssentiaTransport) te).isConnectable(face.getOpposite()))
|
||||
{
|
||||
return te;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static HashMap<Integer, AspectList> allAspects = new HashMap<Integer, AspectList>();
|
||||
private static HashMap<Integer, AspectList> allCompoundAspects = new HashMap<Integer, AspectList>();
|
||||
private static HashMap<Integer,AspectList> allAspects = new HashMap<Integer,AspectList>();
|
||||
private static HashMap<Integer,AspectList> allCompoundAspects = new HashMap<Integer,AspectList>();
|
||||
|
||||
public static AspectList getAllAspects(int amount)
|
||||
{
|
||||
|
@ -234,7 +226,7 @@ public class ThaumcraftApiHelper
|
|||
{
|
||||
AspectList al = new AspectList();
|
||||
|
||||
for (Aspect aspect: Aspect.aspects.values())
|
||||
for (Aspect aspect : Aspect.aspects.values())
|
||||
{
|
||||
al.add(aspect, amount);
|
||||
}
|
||||
|
@ -251,7 +243,7 @@ public class ThaumcraftApiHelper
|
|||
{
|
||||
AspectList al = new AspectList();
|
||||
|
||||
for (Aspect aspect: Aspect.getCompoundAspects())
|
||||
for (Aspect aspect : Aspect.getCompoundAspects())
|
||||
{
|
||||
al.add(aspect, amount);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue