mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +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();
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,10 @@ import net.minecraft.src.Material;
|
||||
|
||||
public class MockBlock extends Block
|
||||
{
|
||||
static
|
||||
{
|
||||
Thread.dumpStack();
|
||||
}
|
||||
@Instance("mod_testMod")
|
||||
public static Object tstInstance;
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ public class MockMod
|
||||
@Metadata
|
||||
private ModMetadata meta;
|
||||
|
||||
@Block(name="MyBlock", itemTypeClass=TestItem.class)
|
||||
private MockBlock myBlock;
|
||||
// @Block(name="MyBlock", itemTypeClass=TestItem.class)
|
||||
// private MockBlock myBlock;
|
||||
|
||||
@PreInit
|
||||
public void preinit(FMLPreInitializationEvent evt)
|
||||
|
||||
Reference in new issue
Block a user