Class AssetEditorPlugin
java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
com.hypixel.hytale.server.core.plugin.JavaPlugin
com.hypixel.hytale.builtin.asseteditor.AssetEditorPlugin
- All Implemented Interfaces:
CommandOwner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class(package private) static enum(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, DataSource> private final AssetTypeRegistryprivate final Map<EditorClient, AssetPath> private final Set<EditorClient> private final StampedLockprivate final StampedLockprivate final Set<EditorClient> private AssetEditorPlugin.InitStateprivate static AssetEditorPluginprivate ScheduledFuture<?> private ScheduledFuture<?> private AssetEditorSetupSchemasprivate final UndoRedoManagerprivate final Map<UUID, Set<EditorClient>> Fields inherited from class com.hypixel.hytale.server.core.plugin.PluginBase
METRICS_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.bson.BsonDocumentapplyCommandsToAsset(byte[] bytes, AssetPath path, JsonUpdateCommand[] commands, AssetUpdateQuery.RebuildCacheBuilder rebuildCache) private voidbroadcastPackAddedOrUpdated(String packId, PluginManifest manifest) private AssetEditorLastModifiedAssetsstatic AssetEditorPluginget()private List<EditorClient> getDataSourceForPack(String assetPack) getEditorClients(UUID uuid) getOpenAssetPath(EditorClient editorClient) voidhandleAssetUpdate(EditorClient editorClient, AssetPath assetPath, byte[] data, int requestToken) voidhandleCreateAsset(EditorClient editorClient, AssetPath assetPath, byte[] data, AssetEditorRebuildCaches rebuildCaches, String buttonId, int requestToken) voidhandleCreateAssetPack(EditorClient editorClient, AssetPackManifest packetManifest, int requestToken) voidhandleCreateDirectory(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleDeleteAsset(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleDeleteAssetPack(EditorClient editorClient, String packId) voidhandleDeleteDirectory(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleEditorClientDisconnected(EditorClient editorClient, PacketHandler.DisconnectReason disconnectReason) voidhandleExportAssets(EditorClient editorClient, List<AssetPath> paths) voidhandleFetchAsset(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleFetchJsonAssetWithParents(EditorClient editorClient, AssetPath assetPath, boolean isFromOpenedTab, int requestToken) voidhandleFetchLastModifiedAssets(EditorClient editorClient) voidhandleInitializeClient(EditorClient editorClient) voidhandleInitializeEditor(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) voidhandleJsonAssetUpdate(EditorClient editorClient, AssetPath assetPath, String assetType, int assetIndex, JsonUpdateCommand[] commands, int requestToken) voidhandleRedo(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleRenameAsset(EditorClient editorClient, AssetPath oldAssetPath, AssetPath newAssetPath, int requestToken) voidhandleRenameDirectory(EditorClient editorClient, AssetPath path, AssetPath newPath, int requestToken) voidhandleRequestChildIds(EditorClient editorClient, AssetPath assetPath) voidhandleSelectAsset(EditorClient editorClient, AssetPath assetPath) voidhandleSubscribeToModifiedAssetsChanges(EditorClient editorClient) voidhandleUndo(EditorClient editorClient, AssetPath assetPath, int requestToken) voidhandleUnsubscribeFromModifiedAssetsChanges(EditorClient editorClient) voidhandleUpdateAssetPack(EditorClient editorClient, String packId, AssetPackManifest packetManifest) private voidinitializeAssetEditor(boolean updateLoadedAssets) private voidinitializeClient(EditorClient editorClient) (package private) booleanisValidPath(DataSource dataSource, AssetPath assetPath) private voidonAssetMonitor(AssetMonitorEvent<Void> event) private voidprivate voidprivate voidprivate voidprivate void(package private) DataSourceregisterDataSourceForPack(AssetPack assetPack) private voidprivate voidsendPacketToAllEditorUsers(Packet packet) private voidsendPacketToAllEditorUsersExcept(Packet packet, EditorClient ignoreEditorClient) private voidprotected voidsetup()protected voidshutdown()protected voidstart()private static AssetPackManifesttoManifestPacket(PluginManifest manifest) private voidprivate voidupdateAssetForConnectedClients(AssetPath assetPath) private voidupdateAssetForConnectedClients(AssetPath assetPath, byte[] bytes, EditorClient ignoreEditorClient) private voidupdateAssetForConnectedClients(AssetPath assetPath, EditorClient ignoreEditorClient) private voidupdateJsonAssetForConnectedClients(AssetPath assetPath, JsonUpdateCommand[] commands) private voidupdateJsonAssetForConnectedClients(AssetPath assetPath, JsonUpdateCommand[] commands, EditorClient ignoreEditorClient) Methods inherited from class com.hypixel.hytale.server.core.plugin.JavaPlugin
getClassLoader, getFile, getType, start0Methods inherited from class com.hypixel.hytale.server.core.plugin.PluginBase
getAssetRegistry, getBasePermission, getBlockStateRegistry, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad, setup0, shutdown0, withConfig, withConfig
-
Field Details
-
instance
-
globalEditLock
-
uuidToEditorClients
-
clientOpenAssetPathMapping
-
clientsSubscribedToModifiedAssetsChanges
-
schemas
-
setupSchemasPacket
-
initLock
-
initQueue
-
initState
-
scheduledReinitFuture
-
assetPackDataSources
-
assetTypeRegistry
-
undoRedoManager
-
pingClientsTask
-
-
Constructor Details
-
AssetEditorPlugin
-
-
Method Details
-
get
-
registerDataSourceForPack
-
setup
protected void setup()- Overrides:
setupin classPluginBase
-
start
protected void start()- Overrides:
startin classPluginBase
-
shutdown
protected void shutdown()- Overrides:
shutdownin classPluginBase
-
getDataSourceForPath
-
getDataSourceForPack
-
getDataSources
-
getAssetTypeRegistry
-
getSchema
-
getClientOpenAssetPathMapping
-
getEditorClients
-
sendPingPackets
private void sendPingPackets() -
getClientsWithOpenAssetPath
-
getOpenAssetPath
-
onRegisterAssetPack
-
onUnregisterAssetPack
-
onI18nMessagesUpdated
-
onRegisterAssetStore
-
onUnregisterAssetStore
-
tryReinitializeAssetEditor
private void tryReinitializeAssetEditor() -
onAssetMonitor
-
handleInitializeEditor
public void handleInitializeEditor(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
handleInitializeClient
-
initializeAssetEditor
private void initializeAssetEditor(boolean updateLoadedAssets) -
initializeClient
-
handleEditorClientDisconnected
public void handleEditorClientDisconnected(@Nonnull EditorClient editorClient, PacketHandler.DisconnectReason disconnectReason) -
handleDeleteAssetPack
-
handleUpdateAssetPack
public void handleUpdateAssetPack(@Nonnull EditorClient editorClient, @Nonnull String packId, @Nonnull AssetPackManifest packetManifest) -
handleCreateAssetPack
public void handleCreateAssetPack(@Nonnull EditorClient editorClient, @Nonnull AssetPackManifest packetManifest, int requestToken) -
toManifestPacket
-
broadcastPackAddedOrUpdated
-
handleExportAssets
-
handleSelectAsset
-
handleFetchLastModifiedAssets
-
handleAssetUpdate
public void handleAssetUpdate(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, @Nonnull byte[] data, int requestToken) -
handleJsonAssetUpdate
public void handleJsonAssetUpdate(@Nonnull EditorClient editorClient, AssetPath assetPath, @Nonnull String assetType, int assetIndex, @Nonnull JsonUpdateCommand[] commands, int requestToken) -
handleUndo
public void handleUndo(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleRedo
public void handleRedo(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleFetchAsset
public void handleFetchAsset(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleFetchJsonAssetWithParents
public void handleFetchJsonAssetWithParents(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, boolean isFromOpenedTab, int requestToken) -
handleRequestChildIds
-
handleDeleteAsset
public void handleDeleteAsset(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleSubscribeToModifiedAssetsChanges
-
handleUnsubscribeFromModifiedAssetsChanges
-
handleRenameAsset
public void handleRenameAsset(@Nonnull EditorClient editorClient, @Nonnull AssetPath oldAssetPath, @Nonnull AssetPath newAssetPath, int requestToken) -
handleDeleteDirectory
public void handleDeleteDirectory(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleRenameDirectory
public void handleRenameDirectory(@Nonnull EditorClient editorClient, AssetPath path, AssetPath newPath, int requestToken) -
handleCreateDirectory
public void handleCreateDirectory(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, int requestToken) -
handleCreateAsset
public void handleCreateAsset(@Nonnull EditorClient editorClient, @Nonnull AssetPath assetPath, @Nonnull byte[] data, @Nonnull AssetEditorRebuildCaches rebuildCaches, String buttonId, int requestToken) -
applyCommandsToAsset
private org.bson.BsonDocument applyCommandsToAsset(@Nonnull byte[] bytes, AssetPath path, @Nonnull JsonUpdateCommand[] commands, @Nonnull AssetUpdateQuery.RebuildCacheBuilder rebuildCache) -
sendModifiedAssetsUpdateToConnectedUsers
private void sendModifiedAssetsUpdateToConnectedUsers() -
sendPacketToAllEditorUsers
-
sendPacketToAllEditorUsersExcept
private void sendPacketToAllEditorUsersExcept(@Nonnull Packet packet, EditorClient ignoreEditorClient) -
updateAssetForConnectedClients
-
updateAssetForConnectedClients
private void updateAssetForConnectedClients(@Nonnull AssetPath assetPath, EditorClient ignoreEditorClient) -
updateAssetForConnectedClients
private void updateAssetForConnectedClients(@Nonnull AssetPath assetPath, byte[] bytes, EditorClient ignoreEditorClient) -
updateJsonAssetForConnectedClients
private void updateJsonAssetForConnectedClients(@Nonnull AssetPath assetPath, JsonUpdateCommand[] commands) -
updateJsonAssetForConnectedClients
private void updateJsonAssetForConnectedClients(@Nonnull AssetPath assetPath, JsonUpdateCommand[] commands, EditorClient ignoreEditorClient) -
buildAssetEditorLastModifiedAssetsPacket
-
isValidPath
-