cMojangAPI
Index: Articles Classes Hooks Quick navigation: BannerPattern BossBarColor BossBarDivisionType cArrowEntity cBeaconEntity cBedEntity cBlockArea cBlockEntity cBlockEntityWithItems cBlockInfo cBoat cBoundingBox cBrewingstandEntity cChatColor cChestEntity cChunkDesc cClientHandle cColor cCommandBlockEntity cCompositeChat cCraftingGrid cCraftingRecipe cCryptoHash cCuboid cDispenserEntity cDropperEntity cDropSpenserEntity cEnchantments cEnderCrystal cEntity cEntityEffect cExpBottleEntity cExpOrb cFallingBlock cFile cFireChargeEntity cFireworkEntity cFloater cFlowerPotEntity cFurnaceEntity cGhastFireballEntity cHangingEntity cHopperEntity cIniFile cInventory cItem cItemFrame cItemGrid cItems cJson cJukeboxEntity cLeashKnot cLineBlockTracer cLuaWindow cMap cMapManager cMobHeadEntity cMobSpawnerEntity cMojangAPI cMonster cNetwork cNoteEntity cObjective cPainting cPawn cPickup cPlayer cPlugin cPluginLua cPluginManager cProjectileEntity cRankManager cRoot cScoreboard cServer cServerHandle cSignEntity cSplashPotionEntity cStringCompression cTCPLink cTeam cThrownEggEntity cThrownEnderPearlEntity cThrownSnowballEntity cTNTEntity cUDPEndpoint cUrlClient cUrlParser CustomStatistic cUUID cWebAdmin cWindow cWitherSkullEntity cWorld EffectID HTTPFormData HTTPRequest HTTPTemplateRequest ItemCategory lxp SmokeDirection sqlite3 StatisticsManager TakeDamageInfo tolua Vector3d Vector3f Vector3i Globals | ContentscMojangAPI classProvides interface to various API functions that Mojang provides through their servers. Note that some of these calls will wait for a response from the network, and so shouldn't be used while the server is fully running (or at least when there are players connected) to avoid percepted lag.
All the functions are static, call them using the Mojang uses two formats for UUIDs, short and dashed. Cuberite will accept either format for any functions taking a UUID. The MakeUUIDShort() and MakeUUIDDashed() functions are provided for plugins to use for conversion between the two formats. This class will cache values returned by the API service. The cache will hold the values for 7 days by default, after that, they will no longer be available. This is in order to not let the server get banned from using the API service, since they are rate-limited to 600 queries per 10 minutes. The cache contents also gets updated whenever a player successfully joins, since that makes the server contact the API service, too, and retrieve the relevant data. Functions
|