mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Fix Bucket rendering and add sound (#2865)
* Adjust generated quads from texture to take texture size into account #2858 * Fix universal bucket not passing through when rightclicking on a non-block Add proper sound events when picking up modded fluids #2821 * Have FluidUtil execute properly on both sides and sync as expected. Add default sounds to interacting with tanks * Save sound for filling/emptying in the fluid
This commit is contained in:
1 parent
87b0f7db99
commit
5d5c005aae
4 files changed
+210
-248
No files matched your search
@@ -47,6 +47,8 @@ public final class ItemTextureQuadConverter
|
||||
{
|
||||
int w = template.getIconWidth();
|
||||
int h = template.getIconHeight();
|
||||
float wScale = 16f / (float)w;
|
||||
float hScale = 16f / (float)h;
|
||||
int[] data = template.getFrameTextureData(0)[0];
|
||||
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
||||
|
||||
@@ -90,7 +92,12 @@ public final class ItemTextureQuadConverter
|
||||
}
|
||||
|
||||
// create the quad
|
||||
quads.add(genQuad(format, transform, start, y, x, endY, z, sprite, facing, color));
|
||||
quads.add(genQuad(format, transform,
|
||||
(float)start * wScale,
|
||||
(float)y * hScale,
|
||||
(float)x * wScale,
|
||||
(float)endY * hScale,
|
||||
z, sprite, facing, color));
|
||||
|
||||
// update Y if all the rows match. no need to rescan
|
||||
if (endY - y > 1)
|
||||
@@ -114,6 +121,8 @@ public final class ItemTextureQuadConverter
|
||||
{
|
||||
int w = template.getIconWidth();
|
||||
int h = template.getIconHeight();
|
||||
float wScale = 16f / (float)w;
|
||||
float hScale = 16f / (float)h;
|
||||
int[] data = template.getFrameTextureData(0)[0];
|
||||
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
||||
|
||||
@@ -157,7 +166,12 @@ public final class ItemTextureQuadConverter
|
||||
}
|
||||
|
||||
// create the quad
|
||||
quads.add(genQuad(format, transform, x, start, endX, y, z, sprite, facing, color));
|
||||
quads.add(genQuad(format, transform,
|
||||
(float)x * wScale,
|
||||
(float)start * hScale,
|
||||
(float)endX * wScale,
|
||||
(float)y * hScale,
|
||||
z, sprite, facing, color));
|
||||
|
||||
// update X if all the columns match. no need to rescan
|
||||
if (endX - x > 1)
|
||||
@@ -181,6 +195,7 @@ public final class ItemTextureQuadConverter
|
||||
|
||||
/**
|
||||
* Generates a Front/Back quad for an itemmodel. Therefore only supports facing NORTH and SOUTH.
|
||||
* Coordinates are [0,16] to match the usual coordinates used in TextureAtlasSprites
|
||||
*/
|
||||
public static UnpackedBakedQuad genQuad(VertexFormat format, TRSRTransformation transform, float x1, float y1, float x2, float y2, float z, TextureAtlasSprite sprite, EnumFacing facing, int color)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user