- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- get()
- registerEffectType(String, Class, BuilderCodec)
- registerConditionType(String, Class, BuilderCodec)
- registerRuleType(String, Class, BuilderCodec)
- registerEventType(String)
- registerAssetSource(String, AssetSourceProvider)
- registerAssetField(String, String, String)
- getPastePrefabPreviewState(UUID)
- setPastePrefabPreviewState(UUID, TriggerVolumesPlugin.PastePrefabPreviewState)
- clearPastePrefabPreviewState(UUID)
- getAssetSourceForField(String, String)
- getAssetIds(String)
- getManagerResourceType()
- getTriggerVolumeComponentType()
- getTriggerVolumeGroupComponentType()
- getIgnoreTriggerVolumesComponentType()
- collectAnimationIdsForApplyOn(String)
- collectApplyOnIdsForAnimation(String)
- isLoopingAnimation(String, String)
Class TriggerVolumesPlugin
- All Implemented Interfaces:
CommandOwner
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class PluginBase
METRICS_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearPastePrefabPreviewState(UUID playerUuid) collectAnimationIdsForApplyOn(String applyOn) Animation keys available for the given Apply On target.collectApplyOnIdsForAnimation(String animationKey) Apply On targets whose model can play the given animation key, used for the reverse-direction picker (animation chosen first).static TriggerVolumesPluginget()getAssetIds(String sourceId) getAssetSourceForField(String effectTypeId, String fieldKey) getPastePrefabPreviewState(UUID playerUuid) booleanisLoopingAnimation(String applyOn, String animationKey) Whether the given animation key has any looping animation on the Apply On target's model.voidregisterAssetField(String effectTypeId, String fieldKey, String sourceId) Maps a specific field on a registered effect type to an asset source, causing that field to render as an asset picker in the effect editor UI instead of a plain text input.voidregisterAssetSource(String sourceId, AssetSourceProvider provider) Registers an asset source that provides a set of asset IDs for the effect editor's asset picker UI.<T extends TriggerCondition>
voidregisterConditionType(String typeId, Class<T> clazz, BuilderCodec<T> codec) <T extends TriggerEffect>
voidregisterEffectType(String typeId, Class<T> clazz, BuilderCodec<T> codec) Registers a custom trigger effect type so it can be used in trigger volume JSON and appears in the in-game effect editor UI automatically.registerEventType(String typeId) Registers a custom event type so effects and conditions can listen for it and it appears in the in-game effect editor's event dropdown.<T extends TriggerRule>
voidregisterRuleType(String typeId, Class<T> clazz, BuilderCodec<T> codec) Registers a custom always-active rule type so it can be used in trigger volume JSON and appears in the in-game effect editor's "Always Active" list automatically.voidsetPastePrefabPreviewState(UUID playerUuid, TriggerVolumesPlugin.PastePrefabPreviewState state) Methods inherited from class JavaPlugin
getClassLoader, getFile, getTypeMethods inherited from class PluginBase
getAssetRegistry, getBasePermission, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad
-
Constructor Details
-
TriggerVolumesPlugin
-
-
Method Details
-
get
-
registerEffectType
public <T extends TriggerEffect> void registerEffectType(@Nonnull String typeId, @Nonnull Class<T> clazz, @Nonnull BuilderCodec<T> codec) Registers a custom trigger effect type so it can be used in trigger volume JSON and appears in the in-game effect editor UI automatically.Call this from your plugin's
setup()method. Your plugin must declare"Hytale:TriggerVolumes"as a dependency in itsmanifest.jsonto guarantee correct load ordering.The codec should chain from
TriggerEffect.BASE_CODECto inherit the standardEventandIntervalfields.- Parameters:
typeId- unique type identifier used as the"Type"discriminator in JSONclazz- the concrete effect classcodec- aBuilderCodecthat can serialize and deserialize the effect- Throws:
IllegalArgumentException- if typeId or clazz is null, or if typeId is already registered
-
registerConditionType
public <T extends TriggerCondition> void registerConditionType(@Nonnull String typeId, @Nonnull Class<T> clazz, @Nonnull BuilderCodec<T> codec) -
registerRuleType
public <T extends TriggerRule> void registerRuleType(@Nonnull String typeId, @Nonnull Class<T> clazz, @Nonnull BuilderCodec<T> codec) Registers a custom always-active rule type so it can be used in trigger volume JSON and appears in the in-game effect editor's "Always Active" list automatically.Rules are pure data: the registering plugin must also register its own enforcement system (typically an event system that queries
TriggerVolumeManager.hasActiveRule()and cancels the action).The codec should chain from
TriggerRule.BASE_CODEC. Provide aserver.customUI.triggerVolumeEffectEditor.ruleType.<typeId>lang key for the editor label. -
registerEventType
Registers a custom event type so effects and conditions can listen for it and it appears in the in-game effect editor's event dropdown.The returned
TriggerEventTypeis interned: hold onto it and pass it to one of the manager'senqueue*methods from the plugin's own system to fire the event. ENTER, TICK and EXIT are driven by the spatial tick loop and cannot be fired this way; custom events behave like the positional and signal events. Provide aserver.customUI.triggerVolumeEffectEditor.addEventType.<typeId>lang key for the dropdown label.- Throws:
IllegalArgumentException- if typeId is null or already registered
-
registerAssetSource
Registers an asset source that provides a set of asset IDs for the effect editor's asset picker UI. Multiple effect fields can reference the same source.- Parameters:
sourceId- unique identifier for this asset sourceprovider- supplies the current set of asset IDs when the picker is opened
-
registerAssetField
public void registerAssetField(@Nonnull String effectTypeId, @Nonnull String fieldKey, @Nonnull String sourceId) Maps a specific field on a registered effect type to an asset source, causing that field to render as an asset picker in the effect editor UI instead of a plain text input.- Parameters:
effectTypeId- the effect type ID as registered withregisterEffectType(String, Class, BuilderCodec)fieldKey- the codec field key (e.g."Effect","SoundEvent")sourceId- the asset source ID as registered withregisterAssetSource(String, AssetSourceProvider)
-
getPastePrefabPreviewState
@Nullable public TriggerVolumesPlugin.PastePrefabPreviewState getPastePrefabPreviewState(@Nonnull UUID playerUuid) -
setPastePrefabPreviewState
public void setPastePrefabPreviewState(@Nonnull UUID playerUuid, @Nonnull TriggerVolumesPlugin.PastePrefabPreviewState state) -
clearPastePrefabPreviewState
-
getAssetSourceForField
-
getAssetIds
-
getManagerResourceType
-
getTriggerVolumeComponentType
-
getTriggerVolumeGroupComponentType
-
getIgnoreTriggerVolumesComponentType
@Nonnull public ComponentType<EntityStore, IgnoreTriggerVolumes> getIgnoreTriggerVolumesComponentType() -
collectAnimationIdsForApplyOn
Animation keys available for the given Apply On target.Playerresolves to the player model,Everyoneto the keys shared by the player model and every resolvable role model, and a role name to that role's model. Falls back to the global union (collectAnimationIds()) for a blank or otherwise unresolvable target so the picker always has something to show. -
collectApplyOnIdsForAnimation
Apply On targets whose model can play the given animation key, used for the reverse-direction picker (animation chosen first). Targets whose model cannot be resolved are omitted. -
isLoopingAnimation
-