Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Minecraftschurli committed Nov 29, 2023
1 parent 97eccfe commit 9aca096
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
+ }
+
+ @Nullable
+ SpriteContents loadSprite(ResourceLocation id, Resource resource, net.neoforged.neoforge.client.textures.SpriteContentConstructor constructor);
+ SpriteContents loadSprite(ResourceLocation id, Resource resource, net.neoforged.neoforge.client.textures.SpriteContentsConstructor constructor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import org.jetbrains.annotations.ApiStatus.Internal;

/**
* Fired to allow mods to register their own {@linkplain SpriteSourceType}. This event is fired once during the construction of the {@link Minecraft} instance or before datagen when client datagen is enabled.
* Fired to allow mods to register their own {@linkplain SpriteSourceType}.
* This event is fired once during the construction of the {@link Minecraft} instance or
* before datagen when client datagen is enabled.
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
* but nullable to support skipping based on metadata.
*/
@FunctionalInterface
public interface SpriteContentConstructor {
public interface SpriteContentsConstructor {
/**
* Construct an instance of SpriteContents or return null to not load the sprite.
*
* @param id the id of the sprite
* @param frameSize the frame size of the sprite
* @param nativeImage the image of the sprite
* @param resourceMetadata the metadata of the resource
* @return an instance of SpriteContents or return null to not load the sprite
*/
@Nullable
SpriteContents create(ResourceLocation id, FrameSize frameSize, NativeImage nativeImage, ResourceMetadata resourceMetadata);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;

/**
* A test creating a custom sprite source provider a sprite using it and an item using that sprite.
*/
@Mod(CustomSpriteSourceTest.MOD_ID)
public class CustomSpriteSourceTest {
private static final boolean ENABLED = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"id": "custom_sprite_source_test:test_item"
}
]
}
}

0 comments on commit 9aca096

Please sign in to comment.