Add missing patches for not lowering mipmap level for small textures (#8622)

This commit is contained in:
Take Weiland authored and GitHub committed 2022-05-23 20:02:51 +01:00
1 parent 4c09d8d774
commit 5410f9b532
3 files changed
+52

No files matched your search

@@ -30,6 +30,7 @@ import net.minecraft.network.Connection;
import net.minecraft.network.chat.*;
import net.minecraft.network.protocol.status.ServerStatus;
import net.minecraft.server.WorldStem;
import net.minecraft.util.Mth;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.inventory.tooltip.TooltipComponent;
@@ -1140,4 +1141,12 @@ public class ForgeHooksClient
Minecraft.getInstance().setScreen(screen);
}
public static int getMaxMipmapLevel(int width, int height)
{
return Math.min(
Mth.log2(Math.max(1, width)),
Mth.log2(Math.max(1, height))
);
}
}