mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Some functionality fixes for @Instance injection.
This commit is contained in:
1 parent
8bef512803
commit
483667c919
3 files changed
+14
-3
No files matched your search
@@ -291,7 +291,14 @@ public class FMLModContainer implements ModContainer
|
|||||||
Class<?> clz = modInstance.getClass();
|
Class<?> clz = modInstance.getClass();
|
||||||
if (!Strings.isNullOrEmpty(targetMod))
|
if (!Strings.isNullOrEmpty(targetMod))
|
||||||
{
|
{
|
||||||
mc = Loader.instance().getIndexedModList().get(targetMod);
|
if (Loader.isModLoaded(targetMod))
|
||||||
|
{
|
||||||
|
mc = Loader.instance().getIndexedModList().get(targetMod);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mc = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mc != null)
|
if (mc != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ import net.minecraft.src.Material;
|
|||||||
|
|
||||||
public class MockBlock extends Block
|
public class MockBlock extends Block
|
||||||
{
|
{
|
||||||
|
static
|
||||||
|
{
|
||||||
|
Thread.dumpStack();
|
||||||
|
}
|
||||||
@Instance("mod_testMod")
|
@Instance("mod_testMod")
|
||||||
public static Object tstInstance;
|
public static Object tstInstance;
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ public class MockMod
|
|||||||
@Metadata
|
@Metadata
|
||||||
private ModMetadata meta;
|
private ModMetadata meta;
|
||||||
|
|
||||||
@Block(name="MyBlock", itemTypeClass=TestItem.class)
|
// @Block(name="MyBlock", itemTypeClass=TestItem.class)
|
||||||
private MockBlock myBlock;
|
// private MockBlock myBlock;
|
||||||
|
|
||||||
@PreInit
|
@PreInit
|
||||||
public void preinit(FMLPreInitializationEvent evt)
|
public void preinit(FMLPreInitializationEvent evt)
|
||||||
|
|||||||
Reference in new issue
Block a user