public class AssetEditorPlugin extends JavaPlugin
The main plugin class for Asseteditor. This plugin provides gameplay features for the Hytale server. Extend this class to create a plugin.
java.lang.Object > JavaPlugin > AssetEditorPlugin
Field Summary
setupSchemasPacket
Field setupSchemasPacket.
initState
Field initState.
scheduledReinitFuture
Field scheduledReinitFuture.
pingClientsTask
Field pingClientsTask.
manifest
Field manifest.
dataSource
Field dataSource.
message
Field message.
list
Field list.
tempAssetTree
Field tempAssetTree.
globalEditStamp
Field globalEditStamp.
i18nModule
Field i18nModule.
languageKey
Field languageKey.
stamp
Field stamp.
packet
Field packet.
newFiles
Field newFiles.
deletions
Field deletions.
iterator
Field iterator.
relativePath
Field relativePath.
assetFile
Field assetFile.
relativePath3
Field relativePath3.
relativePath2
Field relativePath2.
addedAsset
Field addedAsset.
relativePath4
Field relativePath4.
addedAsset2
Field addedAsset2.
assetPath
Field assetPath.
globalEditStamp2
Field globalEditStamp2.
clientsWithOpenAssetPath
Field clientsWithOpenAssetPath.
updatePacket
Field updatePacket.
playerRefComponent
Field playerRefComponent.
username
Field username.
start
Field start.
bytes
Field bytes.
initStamp
Field initStamp.
defaultDataSource
Field defaultDataSource.
canDiscard
Field canDiscard.
canEditAssets
Field canEditAssets.
canEditAssetPacks
Field canEditAssetPacks.
canCreateAssetPacks
Field canCreateAssetPacks.
canDeleteAssetPacks
Field canDeleteAssetPacks.
packSetupPacket
Field packSetupPacket.
authors
Field authors.
author
Field author.
manifestPath
Field manifestPath.
newPackId
Field newPackId.
packPath
Field packPath.
assetModule
Field assetModule.
packId
Field packId.
modsPath
Field modsPath.
dirName
Field dirName.
normalized
Field normalized.
authorInfo
Field authorInfo.
manifestPacket
Field manifestPacket.
exportedAssets
Field exportedAssets.
asset
Field asset.
parts
Field parts.
packets
Field packets.
timestamp
Field timestamp.
currentPath
Field currentPath.
currentAssetTypeHandler
Field currentAssetTypeHandler.
assetTypeHandler
Field assetTypeHandler.
assetStore
Field assetStore.
assetMap
Field assetMap.
keyString
Field keyString.
key
Field key.
storedPath
Field storedPath.
storedAssetPack
Field storedAssetPack.
fileExtension
Field fileExtension.
rebuildCacheBuilder
Field rebuildCacheBuilder.
json
Field json.
undoRedo
Field undoRedo.
command
Field command.
undoCommand
Field undoCommand.
bson
Field bson.
children
Field children.
childrenIds
Field childrenIds.
entry
Field entry.
fileExtensionNew
Field fileExtensionNew.
oldAsset
Field oldAsset.
oldEntry
Field oldEntry.
newEntry
Field newEntry.
parentDirectoryPath
Field parentDirectoryPath.
rebuildCache
Field rebuildCache.
value
Field value.
lastModifiedAssetsPacket
Field lastModifiedAssetsPacket.
allAssets
Field allAssets.
standardDataSource
Field standardDataSource.
assetPathString
Field assetPathString.
rootPath
Field rootPath.
absolutePath
Field absolutePath.
schemaContext
Field schemaContext.
Method Detail
StandardDataSource
new
StandardDataSource
(assetPack.getName()
Method StandardDataSource.
- Parameters:
assetPack.getName(assetPack.getName(
setup
void
setup
()
Method setup.
AssetStoreTypeHandler
new
AssetStoreTypeHandler
(assetStore)
Method AssetStoreTypeHandler.
- Parameters:
assetStoreassetStore
CommonAssetTypeHandler
new
CommonAssetTypeHandler
("Texture", "Texture.png", ".png", AssetEditorEditorType.Texture)
Method CommonAssetTypeHandler.
- Parameters:
"Texture""Texture""Texture.png""Texture.png"".png"".png"AssetEditorEditorType.TextureAssetEditorEditorType.Texture
start
void
start
()
Method start.
shutdown
void
shutdown
()
Method shutdown.
getDataSourceForPack
Method getDataSourceForPack.
- Parameters:
final StringassetPack
getDataSources
Collection
getDataSources
()
Method getDataSources.
getClientOpenAssetPathMapping
AssetPath>
getClientOpenAssetPathMapping
()
Method getClientOpenAssetPathMapping.
getEditorClients
Set
getEditorClients
(final UUID uuid)
Method getEditorClients.
- Parameters:
final UUIDuuid
sendPingPackets
void
sendPingPackets
()
Method sendPingPackets.
onUnregisterAssetPack
Method onUnregisterAssetPack.
- Parameters:
final AssetPackUnregisterEventevent
AssetEditorDeleteAssetPack
new
AssetEditorDeleteAssetPack
(event.getAssetPack()
Method AssetEditorDeleteAssetPack.
- Parameters:
event.getAssetPack(event.getAssetPack(
onI18nMessagesUpdated
Method onI18nMessagesUpdated.
- Parameters:
@Nonnull final MessagesUpdatedevent
onRegisterAssetStore
Method onRegisterAssetStore.
- Parameters:
@Nonnull final RegisterAssetStoreEventevent
onUnregisterAssetStore
Method onUnregisterAssetStore.
- Parameters:
@Nonnull final RemoveAssetStoreEventevent
tryReinitializeAssetEditor
void
tryReinitializeAssetEditor
()
Method tryReinitializeAssetEditor.
AssetPath
new
AssetPath
(event.getAssetPack()
Method AssetPath.
- Parameters:
event.getAssetPack(event.getAssetPack(
if
else
if
(!dataSource.shouldReloadAssetFromDisk(relativePath4)
Method if.
- Parameters:
!dataSource.shouldReloadAssetFromDisk(relativePath4!dataSource.shouldReloadAssetFromDisk(relativePath4
AssetEditorAssetUpdated
new
AssetEditorAssetUpdated
(assetPath.toPacket()
Method AssetEditorAssetUpdated.
- Parameters:
assetPath.toPacket(assetPath.toPacket(
handleInitializeEditor
void
handleInitializeEditor
(@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)
Method handleInitializeEditor.
- Parameters:
@Nonnull final Refref@Nonnull final ComponentAccessorcomponentAccessor
handleInitializeClient
Method handleInitializeClient.
- Parameters:
@Nonnull final EditorClienteditorClient
initializeAssetEditor
void
initializeAssetEditor
(final boolean updateLoadedAssets)
Method initializeAssetEditor.
- Parameters:
final booleanupdateLoadedAssets
SchemaContext
new
SchemaContext
()
Method SchemaContext.
BsonDocument
new
BsonDocument
()
Method BsonDocument.
AssetEditorSetupSchemas
new
AssetEditorSetupSchemas
(new SchemaFile[schemas.size()
Method AssetEditorSetupSchemas.
- Parameters:
newSchemaFile[schemas.size(
AssetEditorCapabilities
new
AssetEditorCapabilities
(false, canEditAssets, canCreateAssetPacks, canEditAssetPacks, canDeleteAssetPacks)
Method AssetEditorCapabilities.
- Parameters:
falsefalsecanEditAssetscanEditAssetscanCreateAssetPackscanCreateAssetPackscanEditAssetPackscanEditAssetPackscanDeleteAssetPackscanDeleteAssetPacks
handleEditorClientDisconnected
void
handleEditorClientDisconnected
(@Nonnull final EditorClient editorClient, final PacketHandler.DisconnectReason disconnectReason)
Method handleEditorClientDisconnected.
- Parameters:
@Nonnull final EditorClienteditorClientfinal PacketHandler.DisconnectReasondisconnectReason
AssetEditorClientDisconnectEvent
new
AssetEditorClientDisconnectEvent
(editorClient, disconnectReason)
Method AssetEditorClientDisconnectEvent.
- Parameters:
editorClienteditorClientdisconnectReasondisconnectReason
handleDeleteAssetPack
void
handleDeleteAssetPack
(@Nonnull final EditorClient editorClient, @Nonnull final String packId)
Method handleDeleteAssetPack.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final StringpackId
RuntimeException
new
RuntimeException
("Failed to resolve the real path for asset pack directory while deleting asset pack '" + packId + "'.", (Throwable)
Method RuntimeException.
- Parameters:
"Failed to resolve the real path for asset pack directory while deleting asset pack '" + packId +"'."(Throwable(Throwable
handleUpdateAssetPack
void
handleUpdateAssetPack
(@Nonnull final EditorClient editorClient, @Nonnull final String packId, @Nonnull final AssetPackManifest packetManifest)
Method handleUpdateAssetPack.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final StringpackId@Nonnull final AssetPackManifestpacketManifest
PluginIdentifier
new
PluginIdentifier
(manifest)
Method PluginIdentifier.
- Parameters:
manifestmanifest
handleCreateAssetPack
void
handleCreateAssetPack
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPackManifest packetManifest, final int requestToken)
Method handleCreateAssetPack.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPackManifestpacketManifestfinal intrequestToken
broadcastPackAddedOrUpdated
Method broadcastPackAddedOrUpdated.
- Parameters:
final StringpackIdfinal PluginManifestmanifest
AssetEditorUpdateAssetPack
new
AssetEditorUpdateAssetPack
(packId, manifestPacket)
Method AssetEditorUpdateAssetPack.
- Parameters:
packIdpackIdmanifestPacketmanifestPacket
handleExportAssets
void
handleExportAssets
(@Nonnull final EditorClient editorClient, @Nonnull final List paths)
Method handleExportAssets.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final Listpaths
AssetEditorAsset
new
AssetEditorAsset
(null, assetPath.toPacket()
Method AssetEditorAsset.
- Parameters:
nullnullassetPath.toPacket(assetPath.toPacket(
AssetEditorExportAssetInitialize
new
AssetEditorExportAssetInitialize
(asset, null, 0, true)
Method AssetEditorExportAssetInitialize.
- Parameters:
assetassetnullnull00truetrue
AssetEditorExportDeleteAssets
new
AssetEditorExportDeleteAssets
(new AssetEditorAsset[] { new AssetEditorAsset(null, assetPath.toPacket()
Method AssetEditorExportDeleteAssets.
- Parameters:
new AssetEditorAsset[] { newAssetEditorAsset(nullassetPath.toPacket(assetPath.toPacket(
TimestampedAssetReference
new
TimestampedAssetReference
(assetPath.toPacket()
Method TimestampedAssetReference.
- Parameters:
assetPath.toPacket(assetPath.toPacket(
AssetEditorExportComplete
new
AssetEditorExportComplete
(exportedAssets.toArray(TimestampedAssetReference[]::new)
Method AssetEditorExportComplete.
- Parameters:
exportedAssets.toArray(TimestampedAssetReference[]::newexportedAssets.toArray(TimestampedAssetReference[]::new
handleSelectAsset
void
handleSelectAsset
(@Nonnull final EditorClient editorClient, @Nullable final AssetPath assetPath)
Method handleSelectAsset.
- Parameters:
@Nonnull final EditorClienteditorClient@Nullable final AssetPathassetPath
AssetEditorSelectAssetEvent
new
AssetEditorSelectAssetEvent
(editorClient, assetType, assetPath, currentAssetType, currentPath)
Method AssetEditorSelectAssetEvent.
- Parameters:
editorClienteditorClientassetTypeassetTypeassetPathassetPathcurrentAssetTypecurrentAssetTypecurrentPathcurrentPath
handleFetchLastModifiedAssets
Method handleFetchLastModifiedAssets.
- Parameters:
@Nonnull final EditorClienteditorClient
handleAssetUpdate
void
handleAssetUpdate
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, @Nonnull final byte[] data, final int requestToken)
Method handleAssetUpdate.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPath@Nonnull final byte[]datafinal intrequestToken
handleJsonAssetUpdate
void
handleJsonAssetUpdate
(@Nonnull final EditorClient editorClient, AssetPath assetPath, @Nonnull final String assetType, final int assetIndex, @Nonnull final JsonUpdateCommand[] commands, final int requestToken)
Method handleJsonAssetUpdate.
- Parameters:
@Nonnull final EditorClienteditorClientAssetPathassetPath@Nonnull final StringassetTypefinal intassetIndex@Nonnull final JsonUpdateCommand[]commandsfinal intrequestToken
AssetUpdateQuery
new
AssetUpdateQuery
(rebuildCacheBuilder.build()
Method AssetUpdateQuery.
- Parameters:
rebuildCacheBuilder.build(rebuildCacheBuilder.build(
handleUndo
void
handleUndo
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleUndo.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
AssetEditorUndoRedoReply
new
AssetEditorUndoRedoReply
(requestToken, undoCommand)
Method AssetEditorUndoRedoReply.
- Parameters:
requestTokenrequestTokenundoCommandundoCommand
handleRedo
void
handleRedo
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleRedo.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
handleFetchAsset
void
handleFetchAsset
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleFetchAsset.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
AssetEditorFetchAssetReply
new
AssetEditorFetchAssetReply
(requestToken, asset)
Method AssetEditorFetchAssetReply.
- Parameters:
requestTokenrequestTokenassetasset
handleFetchJsonAssetWithParents
void
handleFetchJsonAssetWithParents
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final boolean isFromOpenedTab, final int requestToken)
Method handleFetchJsonAssetWithParents.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal booleanisFromOpenedTabfinal intrequestToken
String
new
String
(asset, StandardCharsets.UTF_8)
Method String.
- Parameters:
assetassetStandardCharsets.UTF_8StandardCharsets.UTF_8
AssetEditorFetchJsonAssetWithParentsReply
new
AssetEditorFetchJsonAssetWithParentsReply
(requestToken, assets)
Method AssetEditorFetchJsonAssetWithParentsReply.
- Parameters:
requestTokenrequestTokenassetsassets
handleRequestChildIds
void
handleRequestChildIds
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath)
Method handleRequestChildIds.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPath
AssetEditorRequestChildrenListReply
new
AssetEditorRequestChildrenListReply
(assetPath.toPacket()
Method AssetEditorRequestChildrenListReply.
- Parameters:
assetPath.toPacket(assetPath.toPacket(
handleDeleteAsset
void
handleDeleteAsset
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleDeleteAsset.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
handleSubscribeToModifiedAssetsChanges
Method handleSubscribeToModifiedAssetsChanges.
- Parameters:
final EditorClienteditorClient
handleUnsubscribeFromModifiedAssetsChanges
Method handleUnsubscribeFromModifiedAssetsChanges.
- Parameters:
final EditorClienteditorClient
handleRenameAsset
void
handleRenameAsset
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath oldAssetPath, @Nonnull final AssetPath newAssetPath, final int requestToken)
Method handleRenameAsset.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPatholdAssetPath@Nonnull final AssetPathnewAssetPathfinal intrequestToken
handleDeleteDirectory
void
handleDeleteDirectory
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleDeleteDirectory.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
handleRenameDirectory
void
handleRenameDirectory
(@Nonnull final EditorClient editorClient, final AssetPath path, final AssetPath newPath, final int requestToken)
Method handleRenameDirectory.
- Parameters:
@Nonnull final EditorClienteditorClientfinal AssetPathpathfinal AssetPathnewPathfinal intrequestToken
handleCreateDirectory
void
handleCreateDirectory
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, final int requestToken)
Method handleCreateDirectory.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPathfinal intrequestToken
handleCreateAsset
void
handleCreateAsset
(@Nonnull final EditorClient editorClient, @Nonnull final AssetPath assetPath, @Nonnull final byte[] data, @Nonnull final AssetEditorRebuildCaches rebuildCaches, final String buttonId, final int requestToken)
Method handleCreateAsset.
- Parameters:
@Nonnull final EditorClienteditorClient@Nonnull final AssetPathassetPath@Nonnull final byte[]data@Nonnull final AssetEditorRebuildCachesrebuildCachesfinal StringbuttonIdfinal intrequestToken
AssetEditorAssetCreatedEvent
new
AssetEditorAssetCreatedEvent
(editorClient, assetTypeHandler.getConfig()
Method AssetEditorAssetCreatedEvent.
- Parameters:
editorClienteditorClientassetTypeHandler.getConfig(assetTypeHandler.getConfig(
applyCommandsToAsset
BsonDocument
applyCommandsToAsset
(@Nonnull final byte[] bytes, final AssetPath path, @Nonnull final JsonUpdateCommand[] commands, @Nonnull final AssetUpdateQuery.RebuildCacheBuilder rebuildCache)
Method applyCommandsToAsset.
- Parameters:
@Nonnull final byte[]bytesfinal AssetPathpath@Nonnull final JsonUpdateCommand[]commands@Nonnull final AssetUpdateQuery.RebuildCacheBuilderrebuildCache
sendModifiedAssetsUpdateToConnectedUsers
void
sendModifiedAssetsUpdateToConnectedUsers
()
Method sendModifiedAssetsUpdateToConnectedUsers.
sendPacketToAllEditorUsers
Method sendPacketToAllEditorUsers.
- Parameters:
@Nonnull final Packetpacket
sendPacketToAllEditorUsersExcept
void
sendPacketToAllEditorUsersExcept
(@Nonnull final Packet packet, final EditorClient ignoreEditorClient)
Method sendPacketToAllEditorUsersExcept.
- Parameters:
@Nonnull final Packetpacketfinal EditorClientignoreEditorClient
updateAssetForConnectedClients
Method updateAssetForConnectedClients.
- Parameters:
@Nonnull final AssetPathassetPath
updateJsonAssetForConnectedClients
void
updateJsonAssetForConnectedClients
(@Nonnull final AssetPath assetPath, final JsonUpdateCommand[] commands)
Method updateJsonAssetForConnectedClients.
- Parameters:
@Nonnull final AssetPathassetPathfinal JsonUpdateCommand[]commands
AssetEditorJsonAssetUpdated
new
AssetEditorJsonAssetUpdated
(assetPath.toPacket()
Method AssetEditorJsonAssetUpdated.
- Parameters:
assetPath.toPacket(assetPath.toPacket(
buildAssetEditorLastModifiedAssetsPacket
Method buildAssetEditorLastModifiedAssetsPacket.
AssetEditorLastModifiedAssets
new
AssetEditorLastModifiedAssets
(allAssets.toArray(new AssetInfo[0])
Method AssetEditorLastModifiedAssets.
- Parameters:
allAssets.toArray(newAssetInfo[0]
isValidPath
boolean
isValidPath
(@Nonnull final DataSource dataSource, @Nonnull final AssetPath assetPath)
Method isValidPath.
- Parameters:
@Nonnull final DataSourcedataSource@Nonnull final AssetPathassetPath
AssetToDiscard
Method AssetToDiscard.
- Parameters:
final AssetPathpath@Nullable final StringlastModificationDate