API reference
Each Viewpoint release has viewpoint-api.jar, with a sources jar and a javadoc jar. The javadoc gives each public type
and member of viewpoint.api. It has:
- a description of each type and member;
- a
@threadtag on each method, which tells the thread that can call it; - the API version, the same as
Version.API.
Packages
Section titled “Packages”| Package | Contains | Guide |
|---|---|---|
viewpoint.api | Addon, AddonContext, Registration, Version, AddonRender, AddonShaders, AddonSnippets | Getting started |
viewpoint.api.patch | @Hook.Before, @Hook.After, HookCall | Managed patching |
viewpoint.api.view | ViewState, ViewListener | View state |
viewpoint.api.settings | AddonSettings, KeyAction, SettingsPage | Settings & keys |
viewpoint.api.files | AddonFiles, Pending | Files |
viewpoint.api.net | AddonDownloads, DownloadRequest, DownloadResult | Downloads |
viewpoint.api.assets | AddonAssets | Assets |
viewpoint.api.lua | @LuaExport, LuaTable, LuaHandle | Lua exports |
viewpoint.api.services | Services | Services |
viewpoint.api.camera | AddonCamera, CameraLayer, LookControl, CameraClaim, ViewControl, CursorClaim | Camera layers |
viewpoint.api.combat | AddonCombat, AimListener, AimState, ShotListener, ShotEvent, ShotHit, SwayProvider, Sway, ShotResolver, ResolverClaim, ReticleProvider, Reticle, ReticleImage, ReticleClaim | Aim & shots |
viewpoint.api.models | ModelProvider, AttachmentProvider, ModelRef | Model providers |
viewpoint.api.render | DrawPoint, DrawCallback, DrawContext, FrameView, Gpu (GpuProgram, GpuBuffer, GpuTexture, GpuMesh), Picture, Primitive, FrameInput, ShaderValues, ShaderValue, ShaderPulse, ValueKind, SnippetPoint | Draw callbacks, Shader values, Shader snippets |
The API uses only java.* and viewpoint.api.*. viewpoint-api.jar has the MIT licence.
| Function | Guide |
|---|---|
Viewpoint.Addons.viewState() | Lua mirror |
Viewpoint.Addons.terrainHeight(x, y) | Lua mirror |
Viewpoint.Addons.setting(addonId, name) | Lua mirror |
Viewpoint.Addons["<id>"] and the globals of lua.globals | Lua exports |
Viewpoint.ModelPacks.register(modId, path) | Legacy model packs |