public class Minecraft extends java.lang.Object implements IThreadListener, ISnooperInfo
Constructor and Description |
---|
Minecraft(GameConfiguration gameConfig) |
Modifier and Type | Method and Description |
---|---|
CrashReport |
addGraphicsAndWorldToCrashReport(CrashReport theCrash)
adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report
|
<V> <any> |
addScheduledTask(java.util.concurrent.Callable<V> callableToSchedule) |
<any> |
addScheduledTask(java.lang.Runnable runnableToSchedule) |
void |
addServerStatsToSnooper(Snooper playerSnooper) |
void |
addServerTypeToSnooper(Snooper playerSnooper) |
protected void |
checkWindowResize() |
void |
crashed(CrashReport crash) |
void |
dispatchKeypresses() |
void |
displayCrashReport(CrashReport crashReportIn)
Wrapper around displayCrashReportInternal
|
void |
displayGuiScreen(GuiScreen guiScreenIn)
Sets the argument GuiScreen as the main (topmost visible) screen.
|
void |
displayInGameMenu()
Displays the ingame menu
|
void |
draw(int posX,
int posY,
int texU,
int texV,
int width,
int height,
int red,
int green,
int blue,
int alpha)
Draw with the WorldRenderer
|
void |
drawSplashScreen(TextureManager textureManagerInstance) |
void |
freeMemory()
Attempts to free as much memory as possible, including leaving the world and running the garbage collector.
|
MusicTicker.MusicType |
getAmbientMusicType() |
BlockColors |
getBlockColors() |
BlockRendererDispatcher |
getBlockRendererDispatcher() |
NetHandlerPlayClient |
getConnection() |
ServerData |
getCurrentServerData() |
DataFixer |
getDataFixer() |
static int |
getDebugFPS() |
Framebuffer |
getFramebuffer() |
FrameTimer |
getFrameTimer()
Return the FrameTimer's instance
|
static int |
getGLMaximumTextureSize()
Used in the usage snooper.
|
IntegratedServer |
getIntegratedServer()
Returns the currently running integrated server
|
ItemColors |
getItemColors() |
ItemRenderer |
getItemRenderer() |
LanguageManager |
getLanguageManager() |
int |
getLimitFramerate() |
static Minecraft |
getMinecraft()
Return the singleton Minecraft instance for the game
|
MusicTicker |
getMusicTicker()
Return the musicTicker's instance
|
Snooper |
getPlayerUsageSnooper()
Returns the PlayerUsageSnooper instance.
|
PropertyMap |
getProfileProperties()
Return the player's GameProfile properties
|
java.net.Proxy |
getProxy() |
RenderItem |
getRenderItem() |
RenderManager |
getRenderManager() |
float |
getRenderPartialTicks() |
Entity |
getRenderViewEntity() |
IResourceManager |
getResourceManager() |
ResourcePackRepository |
getResourcePackRepository() |
ISaveFormat |
getSaveLoader()
Returns the save loader that is currently being used
|
<T> ISearchTree<T> |
getSearchTree(SearchTreeManager.Key<T> key)
Gets the
ISearchTree for the given search tree key, returning null if no such tree exists. |
SearchTreeManager |
getSearchTreeManager() |
Session |
getSession() |
MinecraftSessionService |
getSessionService() |
SkinManager |
getSkinManager() |
SoundHandler |
getSoundHandler() |
static long |
getSystemTime()
Gets the system time in milliseconds.
|
TextureManager |
getTextureManager() |
TextureMap |
getTextureMapBlocks() |
float |
getTickLength() |
GuiToast |
getToastGui() |
Tutorial |
getTutorial() |
java.lang.String |
getVersion()
Gets the version that Minecraft was launched under (the name of a version JSON).
|
java.lang.String |
getVersionType()
Gets the type of version that Minecraft was launched under (as specified in the version JSON).
|
static boolean |
isAmbientOcclusionEnabled()
Returns if ambient occlusion is enabled
|
boolean |
isCallingFromMinecraftThread() |
boolean |
isConnectedToRealms()
Return true if the player is connected to a realms server
|
boolean |
isDemo()
Gets whether this is a demo or not.
|
static boolean |
isFancyGraphicsEnabled() |
boolean |
isFramerateLimitBelowMax() |
boolean |
isFullScreen()
Returns whether we're in full screen or not.
|
boolean |
isGamePaused() |
static boolean |
isGuiEnabled() |
boolean |
isIntegratedServerRunning() |
boolean |
isJava64bit() |
boolean |
isReducedDebug()
Whether to use reduced debug info
|
boolean |
isSingleplayer()
Returns true if there is only one player playing, and the current server is the integrated one.
|
boolean |
isSnooperEnabled()
Returns whether snooping is enabled or not.
|
boolean |
isUnicode() |
void |
launchIntegratedServer(java.lang.String folderName,
java.lang.String worldName,
WorldSettings worldSettingsIn)
Arguments: World foldername, World ingame name, WorldSettings
|
void |
loadWorld(WorldClient worldClientIn)
unloads the current world first
|
void |
loadWorld(WorldClient worldClientIn,
java.lang.String loadingMessage)
par2Str is displayed on the loading screen to the user unloads the current world first
|
void |
populateSearchTreeManager()
Fills
searchTreeManager with the current item and recipe registry contents. |
void |
refreshResources()
Deprecated.
|
void |
resize(int width,
int height)
Called to resize the current screen.
|
void |
run() |
void |
runTick()
Runs the current tick.
|
<any> |
scheduleResourcesRefresh()
Deprecated.
|
void |
setConnectedToRealms(boolean isConnected)
Set if the player is connected to a realms server
|
void |
setDimensionAndSpawnPlayer(int dimension) |
void |
setIngameFocus()
Will set the focus to ingame if the Minecraft window is the active with focus.
|
void |
setIngameNotInFocus()
Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor.
|
void |
setRenderViewEntity(Entity viewingEntity) |
void |
setServerData(ServerData serverDataIn)
Set the current ServerData instance.
|
void |
shutdown()
Called when the window is closing.
|
void |
shutdownMinecraftApplet()
Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the
application (or web page) is exited.
|
static void |
stopIntegratedServer() |
ItemStack |
storeTEInStack(ItemStack stack,
TileEntity te) |
void |
toggleFullscreen()
Toggles fullscreen mode.
|
void |
updateDisplay() |
public static final boolean IS_RUNNING_ON_MAC
public static byte[] memoryReserve
freeMemory()
public TextureManager renderEngine
public PlayerControllerMP playerController
public int displayWidth
public int displayHeight
public WorldClient world
public RenderGlobal renderGlobal
public EntityPlayerSP player
public Entity pointedEntity
public ParticleManager effectRenderer
public FontRenderer fontRenderer
public FontRenderer standardGalacticFontRenderer
public GuiScreen currentScreen
public LoadingScreenRenderer loadingScreen
public EntityRenderer entityRenderer
public DebugRenderer debugRenderer
public GuiIngame ingameGUI
public boolean skipRenderWorld
public RayTraceResult objectMouseOver
public GameSettings gameSettings
public CreativeSettings creativeSettings
public MouseHelper mouseHelper
public final java.io.File mcDataDir
public boolean inGameHasFocus
public final FrameTimer frameTimer
public final Profiler mcProfiler
public final DefaultResourcePack mcDefaultResourcePack
public java.lang.String debug
public boolean renderChunksMany
public Minecraft(GameConfiguration gameConfig)
public void run()
public void populateSearchTreeManager()
searchTreeManager
with the current item and recipe registry contents.public Framebuffer getFramebuffer()
public java.lang.String getVersion()
--
version
flag.public java.lang.String getVersionType()
--versionType
flag.public void crashed(CrashReport crash)
public void displayCrashReport(CrashReport crashReportIn)
public boolean isUnicode()
@Deprecated public void refreshResources()
public void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
LWJGLException
public void draw(int posX, int posY, int texU, int texV, int width, int height, int red, int green, int blue, int alpha)
public ISaveFormat getSaveLoader()
public void displayGuiScreen(GuiScreen guiScreenIn)
WARNING: This method is not thread-safe. Opening GUIs from a thread other than the main
thread may cause many different issues, including the GUI being rendered before it has initialized (leading to
unusual crashes). If on a thread other than the main thread, use addScheduledTask(java.util.concurrent.Callable<V>)
:
minecraft.addScheduledTask(() -> minecraft.displayGuiScreen(gui));
guiScreenIn
- The GuiScreen
to display. If it is null
, any open GUI will be closed.public void shutdownMinecraftApplet()
public void updateDisplay()
protected void checkWindowResize()
public int getLimitFramerate()
public boolean isFramerateLimitBelowMax()
public void freeMemory()
public void shutdown()
public void setIngameFocus()
public void setIngameNotInFocus()
public void displayInGameMenu()
public void toggleFullscreen()
public void resize(int width, int height)
public MusicTicker getMusicTicker()
public void runTick() throws java.io.IOException
java.io.IOException
public void launchIntegratedServer(java.lang.String folderName, java.lang.String worldName, WorldSettings worldSettingsIn)
public void loadWorld(WorldClient worldClientIn)
public void loadWorld(WorldClient worldClientIn, java.lang.String loadingMessage)
public void setDimensionAndSpawnPlayer(int dimension)
public final boolean isDemo()
public NetHandlerPlayClient getConnection()
public static boolean isGuiEnabled()
public static boolean isFancyGraphicsEnabled()
public static boolean isAmbientOcclusionEnabled()
public ItemStack storeTEInStack(ItemStack stack, TileEntity te)
public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash)
public static Minecraft getMinecraft()
@Deprecated public <any> scheduleResourcesRefresh()
public void addServerStatsToSnooper(Snooper playerSnooper)
addServerStatsToSnooper
in interface ISnooperInfo
public void addServerTypeToSnooper(Snooper playerSnooper)
addServerTypeToSnooper
in interface ISnooperInfo
public static int getGLMaximumTextureSize()
public boolean isSnooperEnabled()
isSnooperEnabled
in interface ISnooperInfo
public void setServerData(ServerData serverDataIn)
public ServerData getCurrentServerData()
public boolean isIntegratedServerRunning()
public boolean isSingleplayer()
public IntegratedServer getIntegratedServer()
public static void stopIntegratedServer()
public Snooper getPlayerUsageSnooper()
public static long getSystemTime()
public boolean isFullScreen()
public Session getSession()
public PropertyMap getProfileProperties()
public java.net.Proxy getProxy()
public TextureManager getTextureManager()
public IResourceManager getResourceManager()
public ResourcePackRepository getResourcePackRepository()
public LanguageManager getLanguageManager()
public TextureMap getTextureMapBlocks()
public boolean isJava64bit()
public boolean isGamePaused()
public SoundHandler getSoundHandler()
public MusicTicker.MusicType getAmbientMusicType()
public void dispatchKeypresses()
public MinecraftSessionService getSessionService()
public SkinManager getSkinManager()
public Entity getRenderViewEntity()
public void setRenderViewEntity(Entity viewingEntity)
public <V> <any> addScheduledTask(java.util.concurrent.Callable<V> callableToSchedule)
public <any> addScheduledTask(java.lang.Runnable runnableToSchedule)
addScheduledTask
in interface IThreadListener
public boolean isCallingFromMinecraftThread()
isCallingFromMinecraftThread
in interface IThreadListener
public BlockRendererDispatcher getBlockRendererDispatcher()
public RenderManager getRenderManager()
public RenderItem getRenderItem()
public ItemRenderer getItemRenderer()
public <T> ISearchTree<T> getSearchTree(SearchTreeManager.Key<T> key)
ISearchTree
for the given search tree key, returning null if no such tree exists.key
- "The search tree's key"public static int getDebugFPS()
public FrameTimer getFrameTimer()
public boolean isConnectedToRealms()
public void setConnectedToRealms(boolean isConnected)
public DataFixer getDataFixer()
public float getRenderPartialTicks()
public float getTickLength()
public BlockColors getBlockColors()
public ItemColors getItemColors()
public boolean isReducedDebug()
public GuiToast getToastGui()
public Tutorial getTutorial()
public SearchTreeManager getSearchTreeManager()