From 0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:56:42 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../java/gregtech/api/render/TextureFactory.java | 71 ++++++++++------------ 1 file changed, 31 insertions(+), 40 deletions(-) (limited to 'src/main/java/gregtech/api/render') diff --git a/src/main/java/gregtech/api/render/TextureFactory.java b/src/main/java/gregtech/api/render/TextureFactory.java index 4ff1a05707..1cc5b51717 100644 --- a/src/main/java/gregtech/api/render/TextureFactory.java +++ b/src/main/java/gregtech/api/render/TextureFactory.java @@ -1,28 +1,42 @@ package gregtech.api.render; +import net.minecraft.block.Block; +import net.minecraftforge.common.util.ForgeDirection; + import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.ITextureBuilder; import gregtech.common.render.GT_TextureBuilder; -import net.minecraft.block.Block; -import net.minecraftforge.common.util.ForgeDirection; /** - *

This class contains a collection of static factory methods to access the New Texture API.

- *

The {@link #of} methods directly returns ready-to-use instances of {@link ITexture} implementations.

- *

To get more specific implementations of {@link ITexture} instances, use the {@link #builder()} method.

- *

Example of the {@link #builder()}:

- *
{@code
+ * 

+ * This class contains a collection of static factory methods to access the New Texture API. + *

+ *

+ * The {@link #of} methods directly returns ready-to-use instances of {@link ITexture} implementations. + *

+ *

+ * To get more specific implementations of {@link ITexture} instances, use the {@link #builder()} method. + *

+ *

+ * Example of the {@link #builder()}: + *

+ * + *
+ * {@code
  *     // Texture that glows in the dark
  *     TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).glow().build());
  *
  *     // Texture with same bottom flipped orientation as vanilla
  *     TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build();
- * }
+ * } + *
+ * * See: the {@link ITextureBuilder} interface */ @SuppressWarnings("unused") public final class TextureFactory { + private TextureFactory() { throw new AssertionError("Non-instantiable class"); } @@ -49,19 +63,9 @@ public final class TextureFactory { * @param rgba The {@code short[]} RGBA tint for all sides. * @return The instance of an {@link ITexture} implementation */ - public static ITexture of( - final IIconContainer bottom, - final IIconContainer top, - final IIconContainer north, - final IIconContainer south, - final IIconContainer west, - final IIconContainer east, - final short[] rgba) { - return builder() - .addIcon(bottom, top, north, south, west, east) - .setRGBA(rgba) - .setAllowAlpha(true) - .build(); + public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer north, + final IIconContainer south, final IIconContainer west, final IIconContainer east, final short[] rgba) { + return builder().addIcon(bottom, top, north, south, west, east).setRGBA(rgba).setAllowAlpha(true).build(); } /** @@ -73,13 +77,9 @@ public final class TextureFactory { * @param rgba The {@code short[]} RGBA tint for all sides. * @return The instance of an {@link ITexture} implementation */ - public static ITexture of( - final IIconContainer bottom, final IIconContainer top, final IIconContainer sides, final short[] rgba) { - return builder() - .addIcon(bottom, top, sides, sides, sides, sides) - .setRGBA(rgba) - .setAllowAlpha(true) - .build(); + public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer sides, + final short[] rgba) { + return builder().addIcon(bottom, top, sides, sides, sides, sides).setRGBA(rgba).setAllowAlpha(true).build(); } /** @@ -91,11 +91,7 @@ public final class TextureFactory { * @return The instance of an {@link ITexture} implementation */ public static ITexture of(final IIconContainer iconContainer, final short[] rgba, final boolean allowAlpha) { - return builder() - .addIcon(iconContainer) - .setRGBA(rgba) - .setAllowAlpha(allowAlpha) - .build(); + return builder().addIcon(iconContainer).setRGBA(rgba).setAllowAlpha(allowAlpha).build(); } public static ITexture of(final IIconContainer iconContainer, final short[] rgba) { @@ -107,8 +103,7 @@ public final class TextureFactory { } /** - * Copied-Block {@link ITexture} factory - * that will render a texture copied from the side of a {@link Block}. + * Copied-Block {@link ITexture} factory that will render a texture copied from the side of a {@link Block}. * * @param block The {@link Block} that will provide the texture * @param meta The meta value for the Block @@ -117,11 +112,7 @@ public final class TextureFactory { * @return The instance of an {@link ITexture} implementation */ public static ITexture of(final Block block, final int meta, final ForgeDirection side, final short[] rgba) { - return builder() - .setFromBlock(block, meta) - .setFromSide(side) - .setRGBA(rgba) - .build(); + return builder().setFromBlock(block, meta).setFromSide(side).setRGBA(rgba).build(); } public static ITexture of(final Block block, final int meta, final ForgeDirection side) { -- cgit