diff options
Diffstat (limited to 'src/main/java/gregtech/api/render/TextureFactory.java')
-rw-r--r-- | src/main/java/gregtech/api/render/TextureFactory.java | 91 |
1 files changed, 35 insertions, 56 deletions
diff --git a/src/main/java/gregtech/api/render/TextureFactory.java b/src/main/java/gregtech/api/render/TextureFactory.java index 8c0c46f2c6..8c67cd6740 100644 --- a/src/main/java/gregtech/api/render/TextureFactory.java +++ b/src/main/java/gregtech/api/render/TextureFactory.java @@ -8,7 +8,7 @@ import net.minecraft.block.Block; import net.minecraftforge.common.util.ForgeDirection; /** - * This class contains a collection of static factory methods to help to use the New Texture API + * <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> @@ -24,11 +24,12 @@ import net.minecraftforge.common.util.ForgeDirection; @SuppressWarnings("unused") public final class TextureFactory { private TextureFactory() { - throw new AssertionError("Non instantiable class"); + throw new AssertionError("Non-instantiable class"); } /** * Multi-layered {@link ITexture} factory + * * @param textures The layers of {@link ITexture} from bottom to top * @return The instance of an {@link ITexture} implementation */ @@ -38,71 +39,53 @@ public final class TextureFactory { /** * All-Sided {@link ITexture} factory - * @param bottomIconContainers The {@link IIconContainer} Icon for the Bottom Side. - * @param topIconContainers The {@link IIconContainer} Icon for the Top Side. - * @param northIconContainers The {@link IIconContainer} Icon for the North Side. - * @param southIconContainers The {@link IIconContainer} Icon for the South Side. - * @param westIconContainers The {@link IIconContainer} Icon for the West Side. - * @param eastIconContainers The {@link IIconContainer} Icon for the East Side. - * @param rgba The {@code short[]} tint for all sides. + * + * @param bottom The {@link IIconContainer} Icon for the Bottom Side. + * @param top The {@link IIconContainer} Icon for the Top Side. + * @param north The {@link IIconContainer} Icon for the North Side. + * @param south The {@link IIconContainer} Icon for the South Side. + * @param west The {@link IIconContainer} Icon for the West Side. + * @param east The {@link IIconContainer} Icon for the East Side. + * @param rgba The {@code short[]} RGBA tint for all sides. * @return The instance of an {@link ITexture} implementation */ - public static ITexture of(final IIconContainer bottomIconContainers, - final IIconContainer topIconContainers, - final IIconContainer northIconContainers, - final IIconContainer southIconContainers, - final IIconContainer westIconContainers, - final IIconContainer eastIconContainers, + 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(bottomIconContainers, - topIconContainers, - northIconContainers, - southIconContainers, - westIconContainers, - eastIconContainers) - .setRGBA(rgba) - .setAllowAlpha(true) - .build(); + return builder().addIcon(bottom, top, north, south, west, east).setRGBA(rgba).setAllowAlpha(true).build(); } /** * Bottom-Top-Sides-Sided {@link ITexture} factory - * @param aBottomIconContainers The {@link IIconContainer} Icon for the Bottom Side. - * @param aTopIconContainers The {@link IIconContainer} Icon for the Top Side. - * @param aSideIconContainers The {@link IIconContainer} Icon for the North, South, West and East Sides. - * @param rgba The {@code short[]} tint for all sides. + * + * @param bottom The {@link IIconContainer} Icon for the Bottom Side. + * @param top The {@link IIconContainer} Icon for the Top Side. + * @param sides The {@link IIconContainer} Icon for the North, South, West and East Sides. + * @param rgba The {@code short[]} RGBA tint for all sides. * @return The instance of an {@link ITexture} implementation */ - public static ITexture of(IIconContainer aBottomIconContainers, - IIconContainer aTopIconContainers, - IIconContainer aSideIconContainers, short[] rgba) { - return builder().addIcon(aBottomIconContainers, - aTopIconContainers, - aSideIconContainers, - aSideIconContainers, - aSideIconContainers, - aSideIconContainers) - .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(); } /** * Rendered {@link ITexture} factory + * * @param iconContainer The {@link IIconContainer} to render - * @param rgba The {@code short[]} tint for the texture. - * @param allowAlpha Determine if texture will use alpha blending (Not yet implemented) + * @param rgba The {@code short[]} RGBA tint for the texture. + * @param allowAlpha Determine if texture will use alpha blending (Not yet implemented) * @return The instance of an {@link ITexture} implementation */ - public static ITexture of(IIconContainer iconContainer, short[] rgba, boolean allowAlpha) { + public static ITexture of(final IIconContainer iconContainer, final short[] rgba, final boolean allowAlpha) { return builder().addIcon(iconContainer).setRGBA(rgba).setAllowAlpha(allowAlpha).build(); } - public static ITexture of(IIconContainer iconContainer, short[] rgba) { + public static ITexture of(final IIconContainer iconContainer, final short[] rgba) { return builder().addIcon(iconContainer).setRGBA(rgba).build(); } - public static ITexture of(IIconContainer iconContainer) { + public static ITexture of(final IIconContainer iconContainer) { return builder().addIcon(iconContainer).build(); } @@ -116,29 +99,25 @@ public final class TextureFactory { * @param rgba The RGBA tint to apply * @return The instance of an {@link ITexture} implementation */ - public static ITexture of(Block block, int meta, ForgeDirection side, short[] rgba) { - return builder().setFromBlock(block, meta) - .setFromSide(side) - .setRGBA(rgba) - .build(); + 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(); } - public static ITexture of(Block block, int meta, ForgeDirection side) { - return builder().setFromBlock(block, meta) - .setFromSide(side) - .build(); + public static ITexture of(final Block block, final int meta, final ForgeDirection side) { + return builder().setFromBlock(block, meta).setFromSide(side).build(); } - public static ITexture of(Block block, int meta) { + public static ITexture of(final Block block, final int meta) { return builder().setFromBlock(block, meta).build(); } - public static ITexture of(Block block) { + public static ITexture of(final Block block) { return of(block, 0); } /** * {@link ITextureBuilder} factory + * * @return An instance of the {@link ITextureBuilder} implementation */ public static ITextureBuilder builder() { |