Record Class URLTextureProvider
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.texture.type.URLTextureProvider
- Record Components:
url
- target URLtargetLocation
- target resource location
- All Implemented Interfaces:
TextureProvider
public record URLTextureProvider(String url, net.minecraft.resources.ResourceLocation targetLocation)
extends Record
implements TextureProvider
The URL texture provider that takes a URL, downloads the image,
adds it to the resource manager and stores it at the provided
target location
-
Field Summary
Fields inherited from interface com.pixelmonmod.pixelmon.api.texture.TextureProvider
DIRECT_CODEC
-
Constructor Summary
ConstructorDescriptionURLTextureProvider
(String url, net.minecraft.resources.ResourceLocation targetLocation) Creates an instance of aURLTextureProvider
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addScreenButtons
(net.minecraft.client.gui.Font font, net.minecraft.client.gui.layouts.GridLayout.RowHelper rowHelper, Consumer<TextureProvider> updateHandler) com.mojang.serialization.Codec<? extends TextureProvider>
codec()
The codec for reading the texture providerfinal boolean
Indicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceLocation
The resource location of the texture that will be renderedfinal int
hashCode()
Returns a hash code value for this object.boolean
isCached()
net.minecraft.resources.ResourceLocation
Returns the value of thetargetLocation
record component.final String
toString()
Returns a string representation of this record class.url()
Returns the value of theurl
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.texture.TextureProvider
isNone, usingFallback
-
Field Details
-
CODEC
-
-
Constructor Details
-
URLTextureProvider
Creates an instance of aURLTextureProvider
record class.- Parameters:
url
- the value for theurl
record componenttargetLocation
- the value for thetargetLocation
record component
-
-
Method Details
-
codec
Description copied from interface:TextureProvider
The codec for reading the texture provider- Specified by:
codec
in interfaceTextureProvider
- Returns:
- The codec
-
addScreenButtons
public void addScreenButtons(net.minecraft.client.gui.Font font, net.minecraft.client.gui.layouts.GridLayout.RowHelper rowHelper, Consumer<TextureProvider> updateHandler) - Specified by:
addScreenButtons
in interfaceTextureProvider
-
getTexture
public net.minecraft.resources.ResourceLocation getTexture()Description copied from interface:TextureProvider
The resource location of the texture that will be rendered- Specified by:
getTexture
in interfaceTextureProvider
- Returns:
- The resource location
-
isCached
public boolean isCached() -
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)
. -
url
Returns the value of theurl
record component.- Returns:
- the value of the
url
record component
-
targetLocation
public net.minecraft.resources.ResourceLocation targetLocation()Returns the value of thetargetLocation
record component.- Returns:
- the value of the
targetLocation
record component
-