mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 00:07:45 +00:00
Fix up the event handler so it knows it's owned by forge
This commit is contained in:
1 parent
67d9dac16d
commit
9d919f8ac9
2 files changed
+40
-4
No files matched your search
@@ -8,6 +8,7 @@ import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
@@ -21,6 +22,7 @@ import net.minecraftforge.common.network.ForgeNetworkHandler;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.server.command.ForgeCommand;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
@@ -184,6 +186,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
@Subscribe
|
||||
public void preInit(FMLPreInitializationEvent evt)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER);
|
||||
ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory());
|
||||
}
|
||||
|
||||
@@ -231,7 +234,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
{
|
||||
Blocks.fire.rebuildFireInfo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public File getSource()
|
||||
@@ -250,4 +253,38 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
return FMLFileResourcePack.class;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getOwnedPackages()
|
||||
{
|
||||
// All the packages which are part of forge. Only needs updating if new logic is added
|
||||
// that requires event handlers
|
||||
return ImmutableList.of(
|
||||
"net.minecraftforge.classloading",
|
||||
"net.minecraftforge.client",
|
||||
"net.minecraftforge.client.event",
|
||||
"net.minecraftforge.client.event.sound",
|
||||
"net.minecraftforge.client.model",
|
||||
"net.minecraftforge.client.model.obj",
|
||||
"net.minecraftforge.client.model.techne",
|
||||
"net.minecraftforge.common",
|
||||
"net.minecraftforge.common.config",
|
||||
"net.minecraftforge.common.network",
|
||||
"net.minecraftforge.common.util",
|
||||
"net.minecraftforge.event",
|
||||
"net.minecraftforge.event.brewing",
|
||||
"net.minecraftforge.event.entity",
|
||||
"net.minecraftforge.event.entity.item",
|
||||
"net.minecraftforge.event.entity.living",
|
||||
"net.minecraftforge.event.entity.minecart",
|
||||
"net.minecraftforge.event.entity.player",
|
||||
"net.minecraftforge.event.terraingen",
|
||||
"net.minecraftforge.event.world",
|
||||
"net.minecraftforge.fluids",
|
||||
"net.minecraftforge.oredict",
|
||||
"net.minecraftforge.server",
|
||||
"net.minecraftforge.server.command",
|
||||
"net.minecraftforge.transformers"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import net.minecraftforge.common.ForgeHooks.SeedEntry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class MinecraftForge
|
||||
{
|
||||
{
|
||||
/**
|
||||
* The core Forge EventBusses, all events for Forge will be fired on these,
|
||||
* you should use this to register all your listeners.
|
||||
@@ -22,7 +22,7 @@ public class MinecraftForge
|
||||
public static final EventBus ORE_GEN_BUS = new EventBus();
|
||||
public static final String MC_VERSION = "1.7.2";
|
||||
|
||||
private static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||
static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||
|
||||
/**
|
||||
* Register a new seed to be dropped when breaking tall grass.
|
||||
@@ -43,7 +43,6 @@ public class MinecraftForge
|
||||
{
|
||||
FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());
|
||||
|
||||
EVENT_BUS.register(INTERNAL_HANDLER);
|
||||
OreDictionary.getOreName(0);
|
||||
|
||||
if (!ForgeModContainer.disableVersionCheck)
|
||||
|
||||
Reference in new issue
Block a user