From 9cc6ed820ccac31f5f9d85ed353bfe842a790722 Mon Sep 17 00:00:00 2001 From: Wyvest Date: Mon, 11 Mar 2024 14:20:20 +0700 Subject: [PATCH] dont cull ender dragon / wither options --- .../club/sk1er/patcher/config/PatcherConfig.java | 16 +++++++++++++++- .../util/world/render/culling/EntityCulling.java | 12 ++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java index 13beb98a8..055dc2fa3 100644 --- a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java +++ b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java @@ -798,7 +798,7 @@ private void modifyEverySound() { public static boolean unstackedItems; @Info( - text = "Due to the way OptiFine shaders work, we are unable to make Entity Culling compatible.", + text = "Due to the way OptiFine shaders work, we are unable to make Entity Culling compatible with them.", category = "Performance", subcategory = "Culling", type = InfoType.ERROR, size = 2 @@ -827,6 +827,20 @@ private void modifyEverySound() { ) public static boolean smartEntityCulling = true; + @Switch( + name = "Don't Cull Ender Dragons", + description = "Continue to render Ender Dragons when the entity is being occluded.", + category = "Performance", subcategory = "Culling" + ) + public static boolean dontCullEnderDragons = true; + + @Switch( + name = "Don't Cull Withers", + description = "Continue to render Withers when the entity is being occluded.", + category = "Performance", subcategory = "Culling" + ) + public static boolean dontCullWithers = true; + @Switch( name = "Don't Cull Player Nametags", description = "Continue to render Player Nametags when the entity is being occluded.", diff --git a/src/main/java/club/sk1er/patcher/util/world/render/culling/EntityCulling.java b/src/main/java/club/sk1er/patcher/util/world/render/culling/EntityCulling.java index 4359c8a57..9dee9ceb3 100644 --- a/src/main/java/club/sk1er/patcher/util/world/render/culling/EntityCulling.java +++ b/src/main/java/club/sk1er/patcher/util/world/render/culling/EntityCulling.java @@ -17,6 +17,8 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.scoreboard.Team; @@ -150,12 +152,12 @@ private static int getQuery() { Notifications.INSTANCE.send("Patcher", "Entity Culling has been disabled as your computer is too old and does not support the technology behind it.\n" + - "If you believe this is a mistake, please contact us at https://polyfrost.cc/discord or click this message", () -> { + "If you believe this is a mistake, please contact us at https://polyfrost.org/discord or click this message", () -> { try { - UDesktop.browse(new URI("https://polyfrost.cc/discord")); + UDesktop.browse(new URI("https://polyfrost.org/discord")); } catch (URISyntaxException e) { Patcher.instance.getLogger().error("Failed to open support discord.", e); - ChatUtilities.sendMessage("Failed to open https://polyfrost.cc/discord."); + ChatUtilities.sendMessage("Failed to open https://polyfrost.org/discord."); } }); @@ -208,7 +210,9 @@ public void shouldRenderEntity(RenderLivingEvent.Pre event) { boolean armorstand = entity instanceof EntityArmorStand; if (entity == mc.thePlayer || entity.worldObj != mc.thePlayer.worldObj || (PatcherConfig.checkArmorstandRules && armorstand && ((EntityArmorStand) entity).hasMarker()) || - (entity.isInvisibleToPlayer(mc.thePlayer) && !armorstand) + (entity.isInvisibleToPlayer(mc.thePlayer) && !armorstand) || + (PatcherConfig.dontCullWithers && entity instanceof EntityWither) || + (PatcherConfig.dontCullEnderDragons && entity instanceof EntityDragon) //#if MC==11202 //$$ || entity.isGlowing() //#endif