本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureAtlasSprite.getFrameCount方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureAtlasSprite.getFrameCount方法的具體用法?Java TextureAtlasSprite.getFrameCount怎麽用?Java TextureAtlasSprite.getFrameCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.texture.TextureAtlasSprite
的用法示例。
在下文中一共展示了TextureAtlasSprite.getFrameCount方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_178393_a
import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
private List<ItemModelGenerator.Span> func_178393_a(TextureAtlasSprite p_178393_1_)
{
int i = p_178393_1_.getIconWidth();
int j = p_178393_1_.getIconHeight();
List<ItemModelGenerator.Span> list = Lists.<ItemModelGenerator.Span>newArrayList();
for (int k = 0; k < p_178393_1_.getFrameCount(); ++k)
{
int[] aint = p_178393_1_.getFrameTextureData(k)[0];
for (int l = 0; l < j; ++l)
{
for (int i1 = 0; i1 < i; ++i1)
{
boolean flag = !this.func_178391_a(aint, i1, l, i, j);
this.func_178396_a(ItemModelGenerator.SpanFacing.UP, list, aint, i1, l, i, j, flag);
this.func_178396_a(ItemModelGenerator.SpanFacing.DOWN, list, aint, i1, l, i, j, flag);
this.func_178396_a(ItemModelGenerator.SpanFacing.LEFT, list, aint, i1, l, i, j, flag);
this.func_178396_a(ItemModelGenerator.SpanFacing.RIGHT, list, aint, i1, l, i, j, flag);
}
}
}
return list;
}
示例2: getSpans
import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
private List<ItemModelGenerator.Span> getSpans(TextureAtlasSprite p_178393_1_)
{
int i = p_178393_1_.getIconWidth();
int j = p_178393_1_.getIconHeight();
List<ItemModelGenerator.Span> list = Lists.<ItemModelGenerator.Span>newArrayList();
for (int k = 0; k < p_178393_1_.getFrameCount(); ++k)
{
int[] aint = p_178393_1_.getFrameTextureData(k)[0];
for (int l = 0; l < j; ++l)
{
for (int i1 = 0; i1 < i; ++i1)
{
boolean flag = !this.isTransparent(aint, i1, l, i, j);
this.checkTransition(ItemModelGenerator.SpanFacing.UP, list, aint, i1, l, i, j, flag);
this.checkTransition(ItemModelGenerator.SpanFacing.DOWN, list, aint, i1, l, i, j, flag);
this.checkTransition(ItemModelGenerator.SpanFacing.LEFT, list, aint, i1, l, i, j, flag);
this.checkTransition(ItemModelGenerator.SpanFacing.RIGHT, list, aint, i1, l, i, j, flag);
}
}
}
return list;
}
示例3: generateCustomMipmaps
import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
public static void generateCustomMipmaps(TextureAtlasSprite p_generateCustomMipmaps_0_, int p_generateCustomMipmaps_1_)
{
int i = p_generateCustomMipmaps_0_.getIconWidth();
int j = p_generateCustomMipmaps_0_.getIconHeight();
if (p_generateCustomMipmaps_0_.getFrameCount() < 1)
{
List<int[][]> list = new ArrayList();
int[][] aint = new int[p_generateCustomMipmaps_1_ + 1][];
int[] aint1 = new int[i * j];
aint[0] = aint1;
list.add(aint);
p_generateCustomMipmaps_0_.setFramesTextureData(list);
}
List<int[][]> list1 = new ArrayList();
int l = p_generateCustomMipmaps_0_.getFrameCount();
for (int i1 = 0; i1 < l; ++i1)
{
int[] aint2 = getFrameData(p_generateCustomMipmaps_0_, i1, 0);
if (aint2 == null || aint2.length < 1)
{
aint2 = new int[i * j];
}
if (aint2.length != i * j)
{
int k = (int)Math.round(Math.sqrt((double)aint2.length));
if (k * k != aint2.length)
{
aint2 = new int[1];
k = 1;
}
BufferedImage bufferedimage = new BufferedImage(k, k, 2);
bufferedimage.setRGB(0, 0, k, k, aint2, 0, k);
BufferedImage bufferedimage1 = scaleImage(bufferedimage, i);
int[] aint3 = new int[i * j];
bufferedimage1.getRGB(0, 0, i, j, aint3, 0, i);
aint2 = aint3;
}
int[][] aint4 = new int[p_generateCustomMipmaps_1_ + 1][];
aint4[0] = aint2;
list1.add(aint4);
}
p_generateCustomMipmaps_0_.setFramesTextureData(list1);
p_generateCustomMipmaps_0_.generateMipmaps(p_generateCustomMipmaps_1_);
}
示例4: getQuadsForSprite
import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
public static ImmutableList<BakedQuad> getQuadsForSprite(int tint, TextureAtlasSprite sprite, VertexFormat format, Optional<TRSRTransformation> transform)
{
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
int uMax = sprite.getIconWidth();
int vMax = sprite.getIconHeight();
BitSet faces = new BitSet((uMax + 1) * (vMax + 1) * 4);
for(int f = 0; f < sprite.getFrameCount(); f++)
{
int[] pixels = sprite.getFrameTextureData(f)[0];
boolean ptu;
boolean[] ptv = new boolean[uMax];
Arrays.fill(ptv, true);
for(int v = 0; v < vMax; v++)
{
ptu = true;
for(int u = 0; u < uMax; u++)
{
boolean t = isTransparent(pixels, uMax, vMax, u, v);
if(ptu && !t) // left - transparent, right - opaque
{
addSideQuad(builder, faces, format, transform, EnumFacing.WEST, tint, sprite, uMax, vMax, u, v);
}
if(!ptu && t) // left - opaque, right - transparent
{
addSideQuad(builder, faces, format, transform, EnumFacing.EAST, tint, sprite, uMax, vMax, u, v);
}
if(ptv[u] && !t) // up - transparent, down - opaque
{
addSideQuad(builder, faces, format, transform, EnumFacing.UP, tint, sprite, uMax, vMax, u, v);
}
if(!ptv[u] && t) // up - opaque, down - transparent
{
addSideQuad(builder, faces, format, transform, EnumFacing.DOWN, tint, sprite, uMax, vMax, u, v);
}
ptu = t;
ptv[u] = t;
}
if(!ptu) // last - opaque
{
addSideQuad(builder, faces, format, transform, EnumFacing.EAST, tint, sprite, uMax, vMax, uMax, v);
}
}
// last line
for(int u = 0; u < uMax; u++)
{
if(!ptv[u])
{
addSideQuad(builder, faces, format, transform, EnumFacing.DOWN, tint, sprite, uMax, vMax, u, vMax);
}
}
}
// front
builder.add(buildQuad(format, transform, EnumFacing.NORTH, sprite, tint,
0, 0, 7.5f / 16f, sprite.getMinU(), sprite.getMaxV(),
0, 1, 7.5f / 16f, sprite.getMinU(), sprite.getMinV(),
1, 1, 7.5f / 16f, sprite.getMaxU(), sprite.getMinV(),
1, 0, 7.5f / 16f, sprite.getMaxU(), sprite.getMaxV()
));
// back
builder.add(buildQuad(format, transform, EnumFacing.SOUTH, sprite, tint,
0, 0, 8.5f / 16f, sprite.getMinU(), sprite.getMaxV(),
1, 0, 8.5f / 16f, sprite.getMaxU(), sprite.getMaxV(),
1, 1, 8.5f / 16f, sprite.getMaxU(), sprite.getMinV(),
0, 1, 8.5f / 16f, sprite.getMinU(), sprite.getMinV()
));
return builder.build();
}