diff --git a/src/resonantinduction/MultipartRI.java b/src/resonantinduction/MultipartRI.java index f2654e7a..ea8332c1 100644 --- a/src/resonantinduction/MultipartRI.java +++ b/src/resonantinduction/MultipartRI.java @@ -9,6 +9,12 @@ import codechicken.multipart.TMultiPart; public class MultipartRI implements IPartFactory { + + public MultipartRI() + { + this.init(); + } + @Override public TMultiPart createPart(String name, boolean client) { diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index 07fd1a57..027b07c7 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -41,7 +41,7 @@ import resonantinduction.wire.EnumWireMaterial; import resonantinduction.wire.ItemBlockWire; import resonantinduction.wire.TileEntityTickWire; import resonantinduction.wire.TileEntityWire; -import resonantinduction.wire.multipart.ItemPartWire; +import scala.collection.generic.BitOperations.Int; import universalelectricity.compatibility.Compatibility; import universalelectricity.core.item.IItemElectric; import universalelectricity.core.vector.Vector3; @@ -189,7 +189,14 @@ public class ResonantInduction 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 @@ -279,7 +286,18 @@ public class ResonantInduction metadata.credits = "Thanks to Archadia for the awesome assets!"; 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(); }