Package kr.toxicity.model.api.event
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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface kr.toxicity.model.api.event.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
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
assets
Returns the value of theassetsrecord component.- Returns:
- the value of the
assetsrecord component
-