Skip to content

Commit

Permalink
dont cull ender dragon / wither options
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Mar 11, 2024
1 parent fa2efbe commit 9cc6ed8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
16 changes: 15 additions & 1 deletion src/main/java/club/sk1er/patcher/config/PatcherConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.");
}
});

Expand Down Expand Up @@ -208,7 +210,9 @@ public void shouldRenderEntity(RenderLivingEvent.Pre<EntityLivingBase> 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
Expand Down

0 comments on commit 9cc6ed8

Please sign in to comment.