public class FMLCommonHandler
extends java.lang.Object
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) |
void |
firePlayerLoggedIn(EntityPlayer player) |
void |
firePlayerLoggedOut(EntityPlayer player) |
void |
firePlayerRespawnEvent(EntityPlayer player,
boolean endConquered) |
void |
firePlayerSmeltedEvent(EntityPlayer player,
ItemStack smelted) |
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()
Get the forge mod loader logging instance (goes to the forgemodloader log file)
|
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() |
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 |
reloadRenderers() |
boolean |
shouldAllowPlayerLogins() |
boolean |
shouldServerBeKilledQuietly() |
void |
showGuiScreen(java.lang.Object clientGuiElement) |
java.lang.String |
stripSpecialChars(java.lang.String message) |
@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
- public org.apache.logging.log4j.Logger getFMLLogger()
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 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)
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 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()