public class FMLCommonHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
brandings |
private java.util.List<java.lang.String> |
brandingsNoMC |
private java.util.List<ICrashCallable> |
crashCallables |
private EventBus |
eventBus |
private java.util.concurrent.CountDownLatch |
exitLatch |
private java.util.Set<SaveHandler> |
handlerSet |
private java.lang.ref.WeakReference<SaveHandler> |
handlerToCheck |
private static FMLCommonHandler |
INSTANCE
The singleton
|
private boolean |
noForge |
private IFMLSidedHandler |
sidedDelegate
The delegate for side specific data and functions
|
Modifier | Constructor and Description |
---|---|
private |
FMLCommonHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addModToResourcePack(ModContainer container) |
java.util.List<java.lang.String> |
beginLoading(IFMLSidedHandler handler) |
void |
bootstrap() |
EventBus |
bus()
Deprecated.
|
static void |
callFuture(java.util.concurrent.FutureTask<?> task) |
void |
computeBranding() |
void |
confirmBackupLevelDatUse(SaveHandler handler) |
void |
enhanceCrashReport(CrashReport crashReport,
CrashReportCategory category) |
void |
exitJava(int exitCode,
boolean hardExit)
Used to exit from java, with system exit preventions in place.
|
void |
expectServerStopped()
Make handleExit() wait for handleServerStopped().
|
ModContainer |
findContainerFor(java.lang.Object mod)
Find the container that associates with the supplied mod object
|
void |
fireKeyInput() |
void |
fireMouseInput() |
void |
fireNetRegistrationEvent(NetworkManager manager,
java.util.Set<java.lang.String> channelSet,
java.lang.String channel,
Side side) |
void |
firePlayerChangedDimensionEvent(EntityPlayer player,
int fromDim,
int toDim) |
void |
firePlayerCraftingEvent(EntityPlayer player,
ItemStack crafted,
IInventory craftMatrix) |
void |
firePlayerItemPickupEvent(EntityPlayer player,
EntityItem item,
ItemStack clone) |
void |
firePlayerLoggedIn(EntityPlayer player) |
void |
firePlayerLoggedOut(EntityPlayer player) |
void |
firePlayerRespawnEvent(EntityPlayer player,
boolean endConquered) |
void |
firePlayerSmeltedEvent(EntityPlayer player,
ItemStack smelted) |
void |
fireServerConnectionEvent(NetworkManager manager) |
void |
fireSidedRegistryEvents() |
java.util.List<java.lang.String> |
getBrandings(boolean includeMC) |
INetHandler |
getClientPlayHandler() |
NetworkManager |
getClientToServerNetworkManager() |
java.lang.String |
getCurrentLanguage() |
CompoundDataFixer |
getDataFixer() |
Side |
getEffectiveSide()
Return the effective side for the context in the game.
|
org.apache.logging.log4j.Logger |
getFMLLogger()
Deprecated.
Not used in FML, Mods use your own logger, see
FMLPreInitializationEvent.getModLog() |
MinecraftServer |
getMinecraftServerInstance() |
java.lang.String |
getModName() |
java.io.File |
getSavesDirectory() |
Side |
getSide() |
IFMLSidedHandler |
getSidedDelegate() |
IThreadListener |
getWorldThread(INetHandler net) |
void |
handleExit(int retVal)
Delayed System.exit() until the server is actually stopped/done saving.
|
boolean |
handleServerAboutToStart(MinecraftServer server) |
boolean |
handleServerHandshake(C00Handshake packet,
NetworkManager manager)
Process initial Handshake packet, kicks players from the server if they are connecting while we are starting up.
|
void |
handleServerStarted() |
boolean |
handleServerStarting(MinecraftServer server) |
void |
handleServerStopped() |
void |
handleServerStopping() |
void |
handleWorldDataLoad(SaveHandler handler,
WorldInfo worldInfo,
NBTTagCompound tagCompound) |
void |
handleWorldDataSave(SaveHandler handler,
WorldInfo worldInfo,
NBTTagCompound tagCompound) |
static FMLCommonHandler |
instance() |
boolean |
isDisplayCloseRequested() |
boolean |
isDisplayVSyncForced() |
java.io.InputStream |
loadLanguage(java.util.Map<java.lang.String,java.lang.String> table,
java.io.InputStream inputstream)
Loads a lang file, first searching for a marker to enable the 'extended' format {escape characters}
If the marker is not found it simply returns and let the vanilla code load things.
|
void |
onPlayerPostTick(EntityPlayer player) |
void |
onPlayerPreTick(EntityPlayer player) |
void |
onPostClientTick() |
void |
onPostServerTick() |
void |
onPostWorldTick(World world)
Every tick just after world and other ticks occur
|
void |
onPreClientTick() |
void |
onPreServerTick() |
void |
onPreWorldTick(World world)
Every tick just before world and other ticks occur
|
void |
onRenderTickEnd(float timer) |
void |
onRenderTickStart(float timer) |
void |
onServerStart(MinecraftServer dedicatedServer) |
void |
onServerStarted() |
void |
processWindowMessages() |
void |
queryUser(StartupQuery query) |
void |
raiseException(java.lang.Throwable exception,
java.lang.String message,
boolean stopGame)
Raise an exception
|
void |
registerCrashCallable(ICrashCallable callable) |
void |
reloadCreativeSettings() |
void |
reloadRenderers() |
void |
reloadSearchTrees() |
void |
resetClientRecipeBook() |
boolean |
shouldAllowPlayerLogins() |
boolean |
shouldServerBeKilledQuietly() |
void |
showGuiScreen(java.lang.Object clientGuiElement) |
java.lang.String |
stripSpecialChars(java.lang.String message) |
private static final FMLCommonHandler INSTANCE
private IFMLSidedHandler sidedDelegate
private boolean noForge
private java.util.List<java.lang.String> brandings
private java.util.List<java.lang.String> brandingsNoMC
private java.util.List<ICrashCallable> crashCallables
private java.util.Set<SaveHandler> handlerSet
private java.lang.ref.WeakReference<SaveHandler> handlerToCheck
private EventBus eventBus
private volatile java.util.concurrent.CountDownLatch exitLatch
@Deprecated public EventBus bus()
public java.util.List<java.lang.String> beginLoading(IFMLSidedHandler handler)
public static FMLCommonHandler instance()
public ModContainer findContainerFor(java.lang.Object mod)
mod
- @Deprecated public org.apache.logging.log4j.Logger getFMLLogger()
FMLPreInitializationEvent.getModLog()
public Side getSide()
public Side getEffectiveSide()
public void raiseException(java.lang.Throwable exception, java.lang.String message, boolean stopGame)
public void computeBranding()
public java.util.List<java.lang.String> getBrandings(boolean includeMC)
public IFMLSidedHandler getSidedDelegate()
public void onPostServerTick()
public void onPostWorldTick(World world)
public void onPreServerTick()
public void onPreWorldTick(World world)
public boolean handleServerAboutToStart(MinecraftServer server)
public boolean handleServerStarting(MinecraftServer server)
public void handleServerStarted()
public void handleServerStopping()
public java.io.File getSavesDirectory()
public MinecraftServer getMinecraftServerInstance()
public void showGuiScreen(java.lang.Object clientGuiElement)
public void queryUser(StartupQuery query) throws java.lang.InterruptedException
java.lang.InterruptedException
public void onServerStart(MinecraftServer dedicatedServer)
public void onServerStarted()
public void onPreClientTick()
public void onPostClientTick()
public void onRenderTickStart(float timer)
public void onRenderTickEnd(float timer)
public void onPlayerPreTick(EntityPlayer player)
public void onPlayerPostTick(EntityPlayer player)
public void registerCrashCallable(ICrashCallable callable)
public void enhanceCrashReport(CrashReport crashReport, CrashReportCategory category)
public void handleWorldDataSave(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
public void confirmBackupLevelDatUse(SaveHandler handler)
public boolean isDisplayCloseRequested()
public boolean shouldServerBeKilledQuietly()
public void expectServerStopped()
public void handleExit(int retVal)
retVal
- Exit code for System.exit()public void handleServerStopped()
public java.lang.String getModName()
public void addModToResourcePack(ModContainer container)
public java.lang.String getCurrentLanguage()
public void bootstrap()
public NetworkManager getClientToServerNetworkManager()
public void fireMouseInput()
public void fireKeyInput()
public void firePlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim)
public void firePlayerLoggedIn(EntityPlayer player)
public void firePlayerLoggedOut(EntityPlayer player)
public void firePlayerRespawnEvent(EntityPlayer player, boolean endConquered)
public void firePlayerItemPickupEvent(EntityPlayer player, EntityItem item, ItemStack clone)
public void firePlayerCraftingEvent(EntityPlayer player, ItemStack crafted, IInventory craftMatrix)
public void firePlayerSmeltedEvent(EntityPlayer player, ItemStack smelted)
public INetHandler getClientPlayHandler()
public void fireNetRegistrationEvent(NetworkManager manager, java.util.Set<java.lang.String> channelSet, java.lang.String channel, Side side)
public boolean shouldAllowPlayerLogins()
public void fireServerConnectionEvent(NetworkManager manager)
public boolean handleServerHandshake(C00Handshake packet, NetworkManager manager)
packet
- Handshake Packetmanager
- Network connectionpublic void processWindowMessages()
public void exitJava(int exitCode, boolean hardExit)
exitCode
- The exit codehardExit
- Perform a halt instead of an exit (only use when the world is unsavable) - read the warnings at Runtime.halt(int)
public IThreadListener getWorldThread(INetHandler net)
public static void callFuture(java.util.concurrent.FutureTask<?> task)
@Nullable public java.io.InputStream loadLanguage(java.util.Map<java.lang.String,java.lang.String> table, java.io.InputStream inputstream) throws java.io.IOException
table
- The Map to load each key/value pair into.inputstream
- Input stream containing the lang file.java.io.IOException
public java.lang.String stripSpecialChars(java.lang.String message)
public void reloadRenderers()
public void fireSidedRegistryEvents()
public CompoundDataFixer getDataFixer()
public boolean isDisplayVSyncForced()
public void resetClientRecipeBook()
public void reloadSearchTrees()
public void reloadCreativeSettings()