RI should now work without multipart

This commit is contained in:
Calclavia 2013-10-09 14:11:00 +08:00
parent 883c0458da
commit 6195541693
2 changed files with 27 additions and 3 deletions

View file

@ -9,6 +9,12 @@ import codechicken.multipart.TMultiPart;
public class MultipartRI implements IPartFactory public class MultipartRI implements IPartFactory
{ {
public MultipartRI()
{
this.init();
}
@Override @Override
public TMultiPart createPart(String name, boolean client) public TMultiPart createPart(String name, boolean client)
{ {

View file

@ -41,7 +41,7 @@ import resonantinduction.wire.EnumWireMaterial;
import resonantinduction.wire.ItemBlockWire; import resonantinduction.wire.ItemBlockWire;
import resonantinduction.wire.TileEntityTickWire; import resonantinduction.wire.TileEntityTickWire;
import resonantinduction.wire.TileEntityWire; import resonantinduction.wire.TileEntityWire;
import resonantinduction.wire.multipart.ItemPartWire; import scala.collection.generic.BitOperations.Int;
import universalelectricity.compatibility.Compatibility; import universalelectricity.compatibility.Compatibility;
import universalelectricity.core.item.IItemElectric; import universalelectricity.core.item.IItemElectric;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
@ -189,7 +189,14 @@ public class ResonantInduction
if (Loader.isModLoaded("ForgeMultipart")) if (Loader.isModLoaded("ForgeMultipart"))
{ {
itemPartWire = new ItemPartWire(getNextItemID()); try
{
itemPartWire = (Item) Class.forName("resonantinduction.wire.multipart.ItemPartWire").getConstructor(Int.class).newInstance(getNextItemID());
}
catch (Exception e)
{
LOGGER.severe("Failed to load multipart wire.");
}
} }
// Blocks // Blocks
@ -279,7 +286,18 @@ public class ResonantInduction
metadata.credits = "Thanks to Archadia for the awesome assets!"; metadata.credits = "Thanks to Archadia for the awesome assets!";
metadata.autogenerated = false; metadata.autogenerated = false;
new MultipartRI().init(); if (itemPartWire != null)
{
try
{
Class.forName("resonantinduction.MultipartRI").newInstance();
}
catch (InstantiationException | IllegalAccessException | ClassNotFoundException e)
{
e.printStackTrace();
LOGGER.severe("Failed to initiate Resonant Induction multipart module.");
}
}
Compatibility.initiate(); Compatibility.initiate();
} }