aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/render
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
commit0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a (patch)
tree1e2c649f3a6ce3f6b2babd0098a5f4819e9cd0b6 /src/main/java/gregtech/api/render
parentf8cc82edeb9810c45cba762d733a2c909a302faa (diff)
downloadGT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.gz
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.bz2
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.zip
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gregtech/api/render')
-rw-r--r--src/main/java/gregtech/api/render/TextureFactory.java71
1 files changed, 31 insertions, 40 deletions
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;
/**
- * <p>This class contains a collection of static factory methods to access the New Texture API.</p>
- * <p>The {@link #of} methods directly returns ready-to-use instances of {@link ITexture} implementations.</p>
- * <p>To get more specific implementations of {@link ITexture} instances, use the {@link #builder()} method.</p>
- * <p>Example of the {@link #builder()}:</p>
- * <pre>{@code
+ * <p>
+ * This class contains a collection of static factory methods to access the New Texture API.
+ * </p>
+ * <p>
+ * The {@link #of} methods directly returns ready-to-use instances of {@link ITexture} implementations.
+ * </p>
+ * <p>
+ * To get more specific implementations of {@link ITexture} instances, use the {@link #builder()} method.
+ * </p>
+ * <p>
+ * Example of the {@link #builder()}:
+ * </p>
+ *
+ * <pre>
+ * {@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();
- * }</pre>
+ * }
+ * </pre>
+ *
* 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) {