Record Class ModelAssetsEvent
java.lang.Object
java.lang.Record
kr.toxicity.model.api.event.ModelAssetsEvent
- Record Components:
type- the renderer typeassets- the set of assets to be loaded
- All Implemented Interfaces:
ModelEvent
public record ModelAssetsEvent(ModelRenderer.Type type, @NotNull Set<ModelAsset> assets)
extends Record
implements ModelEvent
Triggered when model assets are being gathered.
This event allows plugins to register custom ModelAssets to be loaded by the engine.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionModelAssetsEvent(ModelRenderer.Type type, @NotNull Set<ModelAsset> assets) Creates an instance of aModelAssetsEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAsset(@NotNull ModelAsset asset) Adds a new model asset to the loading queue.@NotNull Set<ModelAsset> assets()Returns the value of theassetsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Methods inherited from interface ModelEvent
call
-
Constructor Details
-
Method Details
-
addAsset
Adds a new model asset to the loading queue.- Parameters:
asset- the asset to add- Throws:
IllegalArgumentException- if an asset with the same name already exists- Since:
- 2.0.0
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
assets
-