Skip to content

Commit

Permalink
disable wither outline if frame buffers aren't supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdoru committed Aug 20, 2024
1 parent 0a11b4b commit 9e07060
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

import fr.alexdoru.mwe.asm.interfaces.IWitherColor;
import fr.alexdoru.mwe.asm.interfaces.RenderManagerAccessor;
import fr.alexdoru.mwe.chat.ChatUtil;
import fr.alexdoru.mwe.config.MWEConfig;
import fr.alexdoru.mwe.scoreboard.ScoreboardTracker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.client.shader.ShaderGroup;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.client.MinecraftForgeClient;

import java.util.List;
Expand Down Expand Up @@ -44,6 +47,12 @@ public static boolean renderWitherOutline(
hasRendered = false;
return false;
}
if (!OpenGlHelper.isFramebufferEnabled()) {
MWEConfig.renderWitherOutline = false;
MWEConfig.saveConfig();
ChatUtil.addChatMessage(ChatUtil.getTagMW() + EnumChatFormatting.RED + "Wither outline rendering has been disabled, frame buffers aren't supported!");
return false;
}
final List<Entity> list = mc.theWorld.getLoadedEntityList();
for (final Entity e : list) {
if (e instanceof IWitherColor && ((IWitherColor) e).getmwe$Color() != 0) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fr/alexdoru/mwe/config/MWEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@ public static void onColoredLeatherArmorSetting() {
@ConfigProperty(
category = MEGA_WALLS, subCategory = "Render",
name = "Render wither outline",
comment = "Renders a colored outline around withers")
comment = "Renders a colored outline around withers\n"
+ "§cThis doesn't work with Optifine's Fast Render")
public static boolean renderWitherOutline = true;

@ConfigProperty(
Expand Down

0 comments on commit 9e07060

Please sign in to comment.