Fix accidently caching an invalid texture atlas

This commit is contained in:
KnightMiner committed 2020-07-27 21:45:18 -05:00
1 parent 812bbe23fd
commit fe0f3297d9
1 file changed
+1 -8
@@ -20,7 +20,6 @@ import slimeknights.mantle.client.model.fluid.FluidCuboid;
import slimeknights.mantle.client.model.fluid.FluidCuboid.FluidFace;
import java.util.List;
import java.util.function.Function;
@SuppressWarnings({"WeakerAccess", "unused"})
public class FluidRenderer {
@@ -35,19 +34,13 @@ public class FluidRenderer {
.transparency(RenderType.TRANSLUCENT_TRANSPARENCY)
.build(false));
/** Cached sprite getter instance */
private static Function<ResourceLocation, TextureAtlasSprite> blockSpriteGetter;
/**
* Gets a block sprite from the given location
* @param sprite Sprite name
* @return Sprite location
*/
public static TextureAtlasSprite getBlockSprite(ResourceLocation sprite) {
if (blockSpriteGetter == null) {
blockSpriteGetter = Minecraft.getInstance().getAtlasSpriteGetter(PlayerContainer.LOCATION_BLOCKS_TEXTURE);
}
return blockSpriteGetter.apply(sprite);
return Minecraft.getInstance().getModelManager().getAtlasTexture(PlayerContainer.LOCATION_BLOCKS_TEXTURE).getSprite(sprite);
}
/* Fluid cuboids */