NoRender module

NoRender: Minecraft 26.3 cheat module, full source for every implementation (5 clients: MelaHack (ThunderHack fork), OfflineClient, Combatant, …).

5 implementationsRENDERVISUALSRender

Full module source: 5 implementations

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

MelaHack (ThunderHack fork)RENDERsrc/main/java/thunder/hack/features/modules/render/NoRender.javaJava · 139 lines · 7.3 KB

Removes unwanted laggy things.

SettingsnoGuiBackGroundNoHandSwingAutoHurtCamPotionsXPArrowsEggsGuardianVignettePortalExplosionsCampFireFireworksArmorBossbarFireOverlayWaterOverlayBlockOverlayNauseaBlindnessFogDarknessItemsCrystalsFireEntityBreakParticlesAntiTitleAntiPlayerCollisionNoScoreBoardSignTextNoWeatherNoArmorStandsSpawnerEntityHotbarItemName
NoRender.javaJava · Minecraft 26.2 · 139 lines · 7.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.render;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.network.protocol.game.ClientboundSetTitleTextPacket;
5
import net.minecraft.world.entity.Entity;
6
import net.minecraft.world.entity.boss.enderdragon.EndCrystal;
7
import net.minecraft.world.entity.decoration.ArmorStand;
8
import net.minecraft.world.entity.item.ItemEntity;
9
import net.minecraft.world.entity.projectile.arrow.Arrow;
10
import net.minecraft.world.entity.projectile.throwableitemprojectile.AbstractThrownPotion;
11
import net.minecraft.world.entity.projectile.throwableitemprojectile.ThrownEgg;
12
import net.minecraft.world.entity.projectile.throwableitemprojectile.ThrownExperienceBottle;
13
import thunder.hack.core.Managers;
14
import thunder.hack.events.impl.EventSync;
15
import thunder.hack.events.impl.PacketEvent;
16
import thunder.hack.features.modules.Module;
17
import thunder.hack.gui.notification.Notification;
18
import thunder.hack.setting.Setting;
19
20
import java.util.ArrayList;
21
import java.util.List;
22
23
import static thunder.hack.features.modules.client.ClientSettings.isRu;
24
25
public class NoRender extends Module {
26
    public NoRender() {
27
        super("NoRender", Category.RENDER);
28
    }
29
30
    public final Setting<Boolean> disableGuiBackGround = new Setting<>("noGuiBackGround", true);
31
    public final Setting<Boolean> noSwing = new Setting<>("NoHandSwing", false);
32
    public final Setting<Boolean> auto = new Setting<>("Auto", false);
33
    public final Setting<Boolean> hurtCam = new Setting<>("HurtCam", true);
34
    public final Setting<Boolean> potions = new Setting<>("Potions", false);
35
    public final Setting<Boolean> xp = new Setting<>("XP", false);
36
    public final Setting<Boolean> arrows = new Setting<>("Arrows", false);
37
    public final Setting<Boolean> eggs = new Setting<>("Eggs", false);
38
    public final Setting<Boolean> elderGuardian = new Setting<>("Guardian", false);
39
    public final Setting<Boolean> vignette = new Setting<>("Vignette", true);
40
    public final Setting<Boolean> portal = new Setting<>("Portal", true);
41
    public final Setting<Boolean> explosions = new Setting<>("Explosions", false);
42
    public final Setting<Boolean> campFire = new Setting<>("CampFire", false);
43
    public final Setting<Boolean> fireworks = new Setting<>("Fireworks", false);
44
    public final Setting<Boolean> armor = new Setting<>("Armor", false);
45
    public final Setting<Boolean> bossbar = new Setting<>("Bossbar", false);
46
    public final Setting<Boolean> fireOverlay = new Setting<>("FireOverlay", false);
47
    public final Setting<Boolean> waterOverlay = new Setting<>("WaterOverlay", false);
48
    public final Setting<Boolean> blockOverlay = new Setting<>("BlockOverlay", false);
49
    public final Setting<Boolean> nausea = new Setting<>("Nausea", false);
50
    public final Setting<Boolean> blindness = new Setting<>("Blindness", false);
51
    public final Setting<Boolean> fog = new Setting<>("Fog", false);
52
    public final Setting<Boolean> darkness = new Setting<>("Darkness", false);
53
    public final Setting<Boolean> items = new Setting<>("Items", false);
54
    public final Setting<Boolean> crystals = new Setting<>("Crystals", false);
55
    public final Setting<Boolean> fireEntity = new Setting<>("FireEntity", true);
56
    public final Setting<Boolean> breakParticles = new Setting<>("BreakParticles", true);
57
    public final Setting<Boolean> antiTitle = new Setting<>("AntiTitle", false);
58
    public final Setting<Boolean> antiPlayerCollision = new Setting<>("AntiPlayerCollision", true);
59
    public final Setting<Boolean> noScoreBoard = new Setting<>("NoScoreBoard", true);
60
    public final Setting<Boolean> signText = new Setting<>("SignText", false);
61
    public final Setting<Boolean> noWeather = new Setting<>("NoWeather", false);
62
    public final Setting<Boolean> noArmorStands = new Setting<>("NoArmorStands", false);
63
    public final Setting<Boolean> spawnerEntity = new Setting<>("SpawnerEntity", false);
64
    public final Setting<Boolean> hotbarItemName = new Setting<>("HotbarItemName", false);
65
66
    private int potionCouter, xpCounter, arrowCounter, itemsCounter;
67
68
    @EventHandler
69
    public void onPacketReceive(PacketEvent.Receive e) {
70
        if (e.getPacket() instanceof ClientboundSetTitleTextPacket && antiTitle.getValue())
71
            e.cancel();
72
    }
73
74
    @EventHandler
75
    public void onSync(EventSync e) {
76
        for (Entity ent : Managers.ASYNC.getAsyncEntities()) {
77
            if (ent instanceof AbstractThrownPotion) {
78
                potionCouter++;
79
                if (potions.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
80
            }
81
            if (ent instanceof ThrownExperienceBottle) {
82
                xpCounter++;
83
                if (xp.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
84
            }
85
            if (ent instanceof EndCrystal) {
86
                if (crystals.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
87
            }
88
            if (ent instanceof Arrow) {
89
                arrowCounter++;
90
                if (arrows.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
91
            }
92
            if (ent instanceof ThrownEgg) {
93
                if (eggs.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
94
            }
95
            if (ent instanceof ItemEntity) {
96
                itemsCounter++;
97
                if (items.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
98
            }
99
            if (ent instanceof ArmorStand){
100
                if(noArmorStands.getValue()) mc.level.removeEntity(ent.getId(), Entity.RemovalReason.KILLED);
101
            }
102
        }
103
104
        if (auto.getValue()) {
105
            if (arrowCounter > 64)
106
                Managers.NOTIFICATION.publicity("NoRender", isRu() ? "Превышен лимит стрел! Удаляю..." : "Arrows limit reached! Removing...", 3, Notification.Type.SUCCESS);
107
108
            if (itemsCounter > 16)
109
                Managers.NOTIFICATION.publicity("NoRender", isRu() ? "Превышен лимит вещей! Удаляю..." : "Item limit reached! Removing...", 3, Notification.Type.SUCCESS);
110
111
            if (xpCounter > 16)
112
                Managers.NOTIFICATION.publicity("NoRender", isRu() ? "Превышен лимит пузырьков опыта! Удаляю..." : "XP orbs limit reached! Removing...", 3, Notification.Type.SUCCESS);
113
114
            if (potionCouter > 8)
115
                Managers.NOTIFICATION.publicity("NoRender", isRu() ? "Превышен лимит зелий! Удаляю..." : "Potions limit reached! Removing...", 3, Notification.Type.SUCCESS);
116
117
118
            List<Integer> toRemove = new ArrayList<>();
119
120
            for (Entity ent  : Managers.ASYNC.getAsyncEntities()) {
121
                if (ent instanceof Arrow && arrowCounter > 64) toRemove.add(ent.getId());
122
                if (ent instanceof ItemEntity && itemsCounter > 16) toRemove.add(ent.getId());
123
                if (ent instanceof ThrownExperienceBottle && xpCounter > 16) toRemove.add(ent.getId());
124
                if (ent instanceof AbstractThrownPotion && potionCouter > 8) toRemove.add(ent.getId());
125
            }
126
127
            try {
128
                toRemove.forEach(id -> mc.level.removeEntity(id, Entity.RemovalReason.KILLED));
129
            } catch (Exception ignored) {
130
            }
131
        }
132
133
        arrowCounter = 0;
134
        itemsCounter = 0;
135
        potionCouter = 0;
136
        xpCounter = 0;
137
    }
138
}
139
OfflineClientRENDERsrc/main/java/com/jellypudding/offlineclient/modules/render/NoRender.javaJava · 199 lines · 7.9 KB

Leaves out things in the world you do not need drawn.

SettingsArmourBeacon beamsFalling blocksWorld borderEnchantment glintFirework explosionsSign textBannersItem framesEnchanting bookBlock cracksCave cullingMap markersMap contentsBarriersTexture rotationsBlock entitiesEntitiesDrop spawn packetsGlowingSpawner mobsDead entitiesNametags
NoRender.javaJava · Minecraft 26.2 · 199 lines · 7.9 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.render;
2
3
import com.jellypudding.offlineclient.module.Category;
4
import com.jellypudding.offlineclient.module.Module;
5
import com.jellypudding.offlineclient.setting.BoolSetting;
6
import com.jellypudding.offlineclient.setting.EnumSetting;
7
import com.jellypudding.offlineclient.setting.RegistryListSetting;
8
import com.jellypudding.offlineclient.util.ChunkRebuild;
9
import net.minecraft.core.registries.BuiltInRegistries;
10
import net.minecraft.world.entity.Entity;
11
import net.minecraft.world.entity.EntityType;
12
import net.minecraft.world.entity.LivingEntity;
13
import net.minecraft.world.level.block.Block;
14
15
import java.util.List;
16
17
// Each item is skipped in its own renderer mixin. ClearView covers what is drawn over the screen.
18
public final class NoRender extends Module {
19
20
    public enum Banners { SHOW, POLE_ONLY, HIDE }
21
22
    private final BoolSetting armour = new BoolSetting("Armour",
23
        "Nobody is drawn wearing armour.", false);
24
    private final BoolSetting beaconBeams = new BoolSetting("Beacon beams",
25
        "Beacons keep their block and lose the beam.", true);
26
    private final BoolSetting fallingBlocks = new BoolSetting("Falling blocks",
27
        "Sand and gravel and anvils vanish whilst they fall.", false);
28
    private final BoolSetting worldBorder = new BoolSetting("World border",
29
        "The border wall is not drawn.", false);
30
    private final BoolSetting glint = new BoolSetting("Enchantment glint",
31
        "Enchanted items lose their shimmer.", false);
32
    private final BoolSetting fireworks = new BoolSetting("Firework explosions",
33
        "Rockets still fly but the burst is not drawn.", false);
34
    private final BoolSetting signText = new BoolSetting("Sign text",
35
        "Signs are drawn blank.", false);
36
    private final EnumSetting<Banners> banners = new EnumSetting<>("Banners",
37
        "How banners are drawn.", Banners.SHOW)
38
        .describe(Banners.SHOW, "Banners are drawn as normal.")
39
        .describe(Banners.POLE_ONLY, "The pole stays and the cloth goes.")
40
        .describe(Banners.HIDE, "Banners are not drawn at all.");
41
    private final BoolSetting itemFrames = new BoolSetting("Item frames",
42
        "Item frames and whatever they hold are not drawn.", false);
43
    private final BoolSetting enchantingBook = new BoolSetting("Enchanting book",
44
        "The book floating above an enchanting table is not drawn.", false);
45
    private final BoolSetting blockCracks = new BoolSetting("Block cracks",
46
        "The crack texture on a block being mined is not drawn.", false);
47
    private final BoolSetting caveCulling = new BoolSetting("Cave culling",
48
        "Chunks behind solid walls are drawn instead of being skipped.", false);
49
    private final BoolSetting mapMarkers = new BoolSetting("Map markers",
50
        "Player and banner markers are left off maps.", false);
51
    private final BoolSetting mapContents = new BoolSetting("Map contents",
52
        "Maps are drawn blank.", false);
53
    private final BoolSetting barriers = new BoolSetting("Barriers",
54
        "Barrier blocks show their marker without one in hand.", false);
55
    private final BoolSetting textureRotations = new BoolSetting("Texture rotations",
56
        "Every block uses the same texture rotation and offset instead of a random one.", false);
57
    private final RegistryListSetting<Block> blockEntities = new RegistryListSetting<>("Block entities",
58
        "Blocks whose special renderer is skipped such as chests and shulker boxes.",
59
        BuiltInRegistries.BLOCK, List.of());
60
    private final RegistryListSetting<EntityType<?>> entities = new RegistryListSetting<>("Entities",
61
        "Kinds of entity that are not drawn at all.", BuiltInRegistries.ENTITY_TYPE, List.of());
62
    private final BoolSetting dropSpawnPackets = new BoolSetting("Drop spawn packets",
63
        "The chosen entities are thrown away as they arrive so they never exist on your side.", false);
64
    private final BoolSetting glowing = new BoolSetting("Glowing",
65
        "The glowing outline effect is removed.", false);
66
    private final BoolSetting spawnerMobs = new BoolSetting("Spawner mobs",
67
        "The spinning mob inside a spawner is not drawn.", false);
68
    private final BoolSetting deadEntities = new BoolSetting("Dead entities",
69
        "Entities vanish as soon as they die instead of playing the death animation.", false);
70
    private final BoolSetting nametags = new BoolSetting("Nametags",
71
        "The vanilla name labels above entities are not drawn.", false);
72
73
    public NoRender() {
74
        super("NoRender", "Leaves out things in the world you do not need drawn.",
75
            Category.RENDER);
76
        addSettings(armour, beaconBeams, fallingBlocks, worldBorder, glint, fireworks,
77
            signText, banners, itemFrames, enchantingBook, blockCracks, caveCulling, mapMarkers,
78
            mapContents, barriers, textureRotations, blockEntities, entities, dropSpawnPackets,
79
            glowing, spawnerMobs, deadEntities, nametags);
80
        searchTags("hide", "no armor", "beacon", "glint", "banner", "sign");
81
    }
82
83
    // Culling and rotations are baked into the chunk meshes. They need a rebuild.
84
    @Override
85
    protected void onEnable() {
86
        rebuildChunks();
87
    }
88
89
    @Override
90
    protected void onDisable() {
91
        rebuildChunks();
92
    }
93
94
    private void rebuildChunks() {
95
        if (caveCulling.isOn() || textureRotations.isOn()) {
96
            ChunkRebuild.now();
97
        }
98
    }
99
100
    public boolean hidesArmour() {
101
        return isEnabled() && armour.isOn();
102
    }
103
104
    public boolean hidesBeaconBeams() {
105
        return isEnabled() && beaconBeams.isOn();
106
    }
107
108
    public boolean hidesFallingBlocks() {
109
        return isEnabled() && fallingBlocks.isOn();
110
    }
111
112
    public boolean hidesWorldBorder() {
113
        return isEnabled() && worldBorder.isOn();
114
    }
115
116
    public boolean hidesGlint() {
117
        return isEnabled() && glint.isOn();
118
    }
119
120
    public boolean hidesFireworks() {
121
        return isEnabled() && fireworks.isOn();
122
    }
123
124
    public boolean hidesSignText() {
125
        return isEnabled() && signText.isOn();
126
    }
127
128
    public Banners bannerMode() {
129
        return isEnabled() ? banners.getValue() : Banners.SHOW;
130
    }
131
132
    public boolean hidesItemFrames() {
133
        return isEnabled() && itemFrames.isOn();
134
    }
135
136
    public boolean hidesEnchantingBook() {
137
        return isEnabled() && enchantingBook.isOn();
138
    }
139
140
    public boolean hidesBlockCracks() {
141
        return isEnabled() && blockCracks.isOn();
142
    }
143
144
    public boolean skipsCaveCulling() {
145
        return isEnabled() && caveCulling.isOn();
146
    }
147
148
    public boolean hidesMapMarkers() {
149
        return isEnabled() && mapMarkers.isOn();
150
    }
151
152
    public boolean hidesMapContents() {
153
        return isEnabled() && mapContents.isOn();
154
    }
155
156
    public boolean showsBarriers() {
157
        return isEnabled() && barriers.isOn();
158
    }
159
160
    public boolean fixesTextureRotations() {
161
        return isEnabled() && textureRotations.isOn();
162
    }
163
164
    public boolean hidesBlockEntity(Block block) {
165
        return isEnabled() && blockEntities.contains(block);
166
    }
167
168
    public boolean hidesEntity(EntityType<?> type) {
169
        return isEnabled() && entities.contains(type);
170
    }
171
172
    // True for a hidden kind and for anything mid death animation whilst that is hidden.
173
    public boolean hidesEntity(Entity entity) {
174
        if (!isEnabled()) {
175
            return false;
176
        }
177
        if (entities.contains(entity.getType())) {
178
            return true;
179
        }
180
        return deadEntities.isOn() && entity instanceof LivingEntity living && living.isDeadOrDying();
181
    }
182
183
    public boolean dropsSpawnPacket(EntityType<?> type) {
184
        return isEnabled() && dropSpawnPackets.isOn() && entities.contains(type);
185
    }
186
187
    public boolean hidesGlowing() {
188
        return isEnabled() && glowing.isOn();
189
    }
190
191
    public boolean hidesSpawnerMobs() {
192
        return isEnabled() && spawnerMobs.isOn();
193
    }
194
195
    public boolean hidesNametags() {
196
        return isEnabled() && nametags.isOn();
197
    }
198
}
199
CombatantVISUALSsrc/main/java/combatant/client/features/module/modules/visuals/NoRender.javaJava · 292 lines · 11.1 KB
Settingsnorender_togglesnorender_world_togglesnorender_entity_togglesnorender_particle_togglesnorender_particle_classesnorender_view_obstruction_fade_living_entitiesnorender_view_obstruction_fade_strengthfire_only_if_resistanthide_scoreboard
NoRender.javaJava · Minecraft 26.2 · 292 lines · 11.1 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Copyright (c) 2026 pivosos2007.
4
 *
5
 * Licensed under the GNU General Public License v3.0.
6
 */
7
8
package combatant.client.features.module.modules.visuals;
9
10
import net.minecraft.client.Camera;
11
import net.minecraft.client.particle.Particle;
12
import net.minecraft.client.Minecraft;
13
import net.minecraft.util.Mth;
14
import net.minecraft.world.entity.Entity;
15
import net.minecraft.world.entity.LivingEntity;
16
import net.minecraft.world.entity.player.Player;
17
import net.minecraft.world.level.block.state.BlockState;
18
import net.minecraft.world.phys.AABB;
19
import net.minecraft.world.phys.Vec3;
20
import combatant.client.config.values.BooleanMapValue;
21
import combatant.client.config.values.BooleanValue;
22
import combatant.client.config.values.NumberValue;
23
import combatant.client.config.values.SetValue;
24
import combatant.client.compat.sodiumextra.SodiumExtraNoRenderCompat;
25
import combatant.client.features.module.Module;
26
import combatant.client.features.module.ModuleCategory;
27
import combatant.client.features.module.ModuleInfo;
28
import combatant.client.features.gui.clickgui.settings.TextListSetting;
29
30
import java.util.Optional;
31
32
//todo Description
33
@ModuleInfo(
34
        id = "norender",
35
        displayName = "NoRender",
36
        category = ModuleCategory.VISUALS
37
)
38
public class NoRender extends Module {
39
40
    private static final String SETTING_TOGGLES = "toggles";
41
    private static final String SETTING_WORLD_TOGGLES = "world_toggles";
42
    private static final String SETTING_ENTITY_TOGGLES = "entity_toggles";
43
    private static final String SETTING_PARTICLE_TOGGLES = "particle_toggles";
44
    private static final String SETTING_PARTICLE_CLASSES = "particle_classes";
45
    private static final String SETTING_VIEW_OBSTRUCTION_FADE_LIVING_ENTITIES = "view_obstruction_fade_living_entities";
46
    private static final String SETTING_VIEW_OBSTRUCTION_FADE_STRENGTH = "view_obstruction_fade_strength";
47
    private static final String SETTING_FIRE_ONLY_IF_RESISTANT = "fire_only_if_resistant";
48
    private static final String SETTING_HIDE_SCOREBOARD = "hide_scoreboard";
49
    private static final String KEY_VIEW_OBSTRUCTION_FADE = "view_obstruction_fade";
50
    private static final String KEY_SCREEN_DARKENING = "screen_darkening";
51
    private static final String KEY_TOAST_HINTS = "toast_hints";
52
    private static final double VIEW_OBSTRUCTION_FADE_DISTANCE = 0.82;
53
    private static final double VIEW_OBSTRUCTION_BOX_EXPAND_XZ = 0.18;
54
    private static final double VIEW_OBSTRUCTION_BOX_EXPAND_Y = 0.28;
55
    private static final float VIEW_OBSTRUCTION_MIN_ALPHA_WEAK = 0.72f;
56
    private static final float VIEW_OBSTRUCTION_MIN_ALPHA_STRONG = 0.22f;
57
    private final BooleanMapValue toggles = group(
58
            "norender_toggles",
59
            SETTING_TOGGLES,
60
            new java.util.LinkedHashMap<>() {{
61
                put("totem_overlay", false);
62
                put("eat_particles", false);
63
                put("hit_particles", false);
64
                put("sweep_particles", false);
65
                put("fire_overlay", true);
66
                put("camera_shake", true);
67
                put("view_bob", true);
68
                put("bad_effects", false);
69
                put("block_overlay", false);
70
                put(KEY_SCREEN_DARKENING, false);
71
                put(KEY_TOAST_HINTS, false);
72
                put(KEY_VIEW_OBSTRUCTION_FADE, false);
73
            }}
74
    );
75
    private final BooleanMapValue worldToggles = group(
76
            "norender_world_toggles",
77
            SETTING_WORLD_TOGGLES,
78
            new java.util.LinkedHashMap<>() {{
79
                put("sky", false);
80
                put("sun", false);
81
                put("moon", false);
82
                put("stars", false);
83
                put("weather", false);
84
            }}
85
    );
86
    private final BooleanMapValue entityToggles = group(
87
            "norender_entity_toggles",
88
            SETTING_ENTITY_TOGGLES,
89
            new java.util.LinkedHashMap<>() {{
90
                put("item_frames", false);
91
                put("armor_stands", false);
92
                put("paintings", false);
93
                put("moving_pistons", false);
94
                put("beacon_beams", false);
95
                put("enchanting_table_book", false);
96
                put("item_frame_name_tags", false);
97
                put("player_name_tags", false);
98
            }}
99
    );
100
    private final BooleanMapValue particleToggles = group(
101
            "norender_particle_toggles",
102
            SETTING_PARTICLE_TOGGLES,
103
            new java.util.LinkedHashMap<>() {{
104
                put("all_particles", false);
105
                put("rain_splash_particles", false);
106
                put("block_break_particles", false);
107
                put("block_breaking_particles", false);
108
            }}
109
    );
110
    private final SetValue particleClasses = textList(
111
            "norender_particle_classes",
112
            SETTING_PARTICLE_CLASSES,
113
            TextListSetting.PickerMode.PARTICLES
114
    );
115
116
    private final BooleanValue viewObstructionFadeLivingEntities =
117
            visibleWhen(bool("norender_view_obstruction_fade_living_entities", SETTING_VIEW_OBSTRUCTION_FADE_LIVING_ENTITIES, true),
118
                    this::viewObstructionFadeEnabled);
119
    private final NumberValue<Integer> viewObstructionFadeStrength =
120
            visibleWhen(num("norender_view_obstruction_fade_strength", SETTING_VIEW_OBSTRUCTION_FADE_STRENGTH, 55, 0, 100),
121
                    this::viewObstructionFadeEnabled);
122
    private final BooleanValue fireOnlyIfResistant =
123
            bool("fire_only_if_resistant", SETTING_FIRE_ONLY_IF_RESISTANT, false);
124
    private final BooleanValue hideScoreboard =
125
            bool("hide_scoreboard", SETTING_HIDE_SCOREBOARD, false);
126
127
    public static boolean shouldFadeSoftBlock(BlockState state) {
128
        return false;
129
    }
130
131
    private static double combatant$squaredDistanceToBox(Vec3 point, AABB box) {
132
        double nearestX = Mth.clamp(point.x, box.minX, box.maxX);
133
        double nearestY = Mth.clamp(point.y, box.minY, box.maxY);
134
        double nearestZ = Mth.clamp(point.z, box.minZ, box.maxZ);
135
        double dx = point.x - nearestX;
136
        double dy = point.y - nearestY;
137
        double dz = point.z - nearestZ;
138
        return dx * dx + dy * dy + dz * dz;
139
    }
140
141
    public boolean off(String key) {
142
        if (!isEnabled()) return false;
143
144
        return toggles.get(key);
145
    }
146
147
    public boolean offWorld(String key) {
148
        return isEnabled() && worldToggles.get(key);
149
    }
150
151
    public boolean offEntity(String key) {
152
        return isEnabled() && entityToggles.get(key);
153
    }
154
155
    public boolean offParticle(String key) {
156
        return isEnabled() && particleToggles.get(key);
157
    }
158
159
    public boolean shouldHideParticle(Particle particle) {
160
        if (!isEnabled() || particle == null) return false;
161
        if (particleToggles.get("all_particles")) return true;
162
163
        java.util.Set<String> selected = particleClasses.get();
164
        if (selected == null || selected.isEmpty()) return false;
165
166
        Class<?> current = particle.getClass();
167
        while (current != null && Particle.class.isAssignableFrom(current)) {
168
            if (selected.contains(current.getName())) return true;
169
            if (current == Particle.class) break;
170
            current = current.getSuperclass();
171
        }
172
        return false;
173
    }
174
175
    private void syncSodiumExtraNoRenderOwnership() {
176
        SodiumExtraNoRenderCompat.syncMigratedOptions(
177
                worldToggles.getAll(),
178
                entityToggles.getAll(),
179
                particleToggles.getAll()
180
        );
181
    }
182
183
    @Override
184
    public void onEnable() {
185
        syncSodiumExtraNoRenderOwnership();
186
    }
187
188
    @Override
189
    public void onTick() {
190
        // Combatant is authoritative while NoRender is enabled. Keep overlapping
191
        // Sodium Extra render switches mirrored from the module tick so its hooks
192
        // cannot override Combatant in the opposite direction.
193
        syncSodiumExtraNoRenderOwnership();
194
    }
195
196
    @Override
197
    public void onDisable() {
198
        SodiumExtraNoRenderCompat.releaseMigratedOptions();
199
    }
200
201
    public boolean fireOnlyWhenResistant() {
202
        return fireOnlyIfResistant.get();
203
    }
204
205
    public boolean hideScoreboard() {
206
        return isEnabled() && hideScoreboard.get();
207
    }
208
209
    public boolean hideScoreboardRaw() {
210
        return hideScoreboard.get();
211
    }
212
213
    public void setHideScoreboardRaw(boolean value) {
214
        if (hideScoreboard.get() == value) {
215
            return;
216
        }
217
        hideScoreboard.set(value);
218
        saveConfig();
219
    }
220
221
    public boolean viewObstructionFadeEnabled() {
222
        return isEnabled() && toggles.get(KEY_VIEW_OBSTRUCTION_FADE);
223
    }
224
225
    public boolean screenDarkeningDisabled() {
226
        return isEnabled() && toggles.get(KEY_SCREEN_DARKENING);
227
    }
228
229
    public boolean hideToastHints() {
230
        return isEnabled() && toggles.get(KEY_TOAST_HINTS);
231
    }
232
233
    public boolean blockOverlayDisabled() {
234
        return isEnabled() && toggles.get("block_overlay");
235
    }
236
237
    public boolean fadeAdditionalLivingEntities() {
238
        return viewObstructionFadeEnabled() && viewObstructionFadeLivingEntities.get();
239
    }
240
241
    public boolean fadeSoftBlocks() {
242
        return false;
243
    }
244
245
    public boolean shouldFadeEntity(Entity entity) {
246
        Minecraft client = Minecraft.getInstance();
247
        if (!viewObstructionFadeEnabled() || !(entity instanceof LivingEntity living) || client.player == null) {
248
            return false;
249
        }
250
        if (entity == client.player || living.isInvisible()) {
251
            return false;
252
        }
253
        if (entity instanceof Player) {
254
            return true;
255
        }
256
        return fadeAdditionalLivingEntities();
257
    }
258
259
    public float getEntityFadeAlpha(Entity entity) {
260
        Minecraft client = Minecraft.getInstance();
261
        if (client.gameRenderer == null || client.gameRenderer.mainCamera() == null) {
262
            return 1.0f;
263
        }
264
        Camera camera = client.gameRenderer.mainCamera();
265
        Vec3 cameraPos = camera.position();
266
        AABB box = entity.getBoundingBox().inflate(VIEW_OBSTRUCTION_BOX_EXPAND_XZ, VIEW_OBSTRUCTION_BOX_EXPAND_Y, VIEW_OBSTRUCTION_BOX_EXPAND_XZ);
267
        double obstructionDistance = Math.sqrt(combatant$squaredDistanceToBox(cameraPos, box));
268
269
        Vec3 rayEnd = cameraPos.add(Vec3.directionFromRotation(camera.xRot(), camera.yRot()).scale(VIEW_OBSTRUCTION_FADE_DISTANCE));
270
        Optional<Vec3> hit = box.clip(cameraPos, rayEnd);
271
        if (hit.isPresent()) {
272
            obstructionDistance = Math.min(obstructionDistance, cameraPos.distanceTo(hit.get()));
273
        }
274
275
        if (box.contains(cameraPos)) {
276
            obstructionDistance = 0.0;
277
        }
278
279
        if (obstructionDistance >= VIEW_OBSTRUCTION_FADE_DISTANCE) {
280
            return 1.0f;
281
        }
282
        float t = Mth.clamp((float) (obstructionDistance / VIEW_OBSTRUCTION_FADE_DISTANCE), 0.0f, 1.0f);
283
        t = t * t * (3.0f - 2.0f * t);
284
        return Mth.lerp(t, getViewObstructionMinAlpha(), 1.0f);
285
    }
286
287
    private float getViewObstructionMinAlpha() {
288
        float strength = Mth.clamp(viewObstructionFadeStrength.get(), 0, 100) / 100.0f;
289
        return Mth.lerp(strength, VIEW_OBSTRUCTION_MIN_ALPHA_WEAK, VIEW_OBSTRUCTION_MIN_ALPHA_STRONG);
290
    }
291
}
292
NicotineRendersrc/client/java/nicotine/mod/mods/render/NoRender.javaJava · 132 lines · 3.5 KB
SettingsFogOverlaysBossBarsPotionEffectsMiscOverlaysToastNotifsWeatherSkyParticlesTotemAnimation
NoRender.javaJava · Minecraft 26.3 · 132 lines · 3.5 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.render;
2
3
import net.minecraft.client.renderer.fog.FogRenderer;
4
import nicotine.events.*;
5
import nicotine.mod.Mod;
6
import nicotine.mod.ModCategory;
7
import nicotine.mod.option.ToggleOption;
8
import nicotine.util.EventBus;
9
10
import static nicotine.util.Common.*;
11
12
import java.util.Arrays;
13
14
public class NoRender extends Mod {
15
16
    private final ToggleOption fog = new ToggleOption("Fog") {
17
       @Override
18
       public void toggle() {
19
           super.toggle();
20
           FogRenderer.toggleFog();
21
       }
22
    };
23
24
    private final ToggleOption overlays = new ToggleOption("Overlays");
25
    private final ToggleOption bossBars = new ToggleOption("BossBars");
26
    private final ToggleOption potionEffects = new ToggleOption("PotionEffects");
27
    private final ToggleOption miscOverlays = new ToggleOption("MiscOverlays");
28
    private final ToggleOption toastNotifs = new ToggleOption("ToastNotifs");
29
    private final ToggleOption weather = new ToggleOption("Weather");
30
    private final ToggleOption sky = new ToggleOption("Sky");
31
    private final ToggleOption particles = new ToggleOption("Particles");
32
    private final ToggleOption totemAnimation = new ToggleOption("TotemAnimation");
33
34
    public NoRender() {
35
        super(ModCategory.Render, "NoRender");
36
        this.addOptions(Arrays.asList(fog, overlays, bossBars, potionEffects, miscOverlays, toastNotifs, weather, sky, particles, totemAnimation));
37
    }
38
39
    @Override
40
    protected void init() {
41
        EventBus.register(TotemAnimationEvent.class, event -> {
42
            if (!this.enabled)
43
                return true;
44
45
            if (totemAnimation.enabled)
46
                return false;
47
48
            return true;
49
        });
50
51
        EventBus.register(RenderOverlaysEvent.class, event -> {
52
           if (!this.enabled)
53
                return true;
54
55
           if (overlays.enabled)
56
               return false;
57
58
          return true;
59
        });
60
61
        EventBus.register(RenderBossBarHudEvent.class, event -> {
62
            if (!this.enabled)
63
                return true;
64
65
            if (bossBars.enabled)
66
                return false;
67
68
            return true;
69
        });
70
71
        EventBus.register(RenderStatusEffectsOverlayEvent.class, event-> {
72
            if (!this.enabled)
73
                return true;
74
75
            if (potionEffects.enabled)
76
                return false;
77
78
            return true;
79
        });
80
81
        EventBus.register(RenderMiscOverlaysEvent.class, event-> {
82
            if (!this.enabled)
83
                return true;
84
85
            if (miscOverlays.enabled)
86
                return false;
87
88
            return true;
89
        });
90
91
        EventBus.register(DrawToastEvent.class, event -> {
92
            if (!this.enabled)
93
                return true;
94
95
            if (toastNotifs.enabled)
96
                return false;
97
98
            return true;
99
        });
100
101
        EventBus.register(RenderWeatherEvent.class, event -> {
102
            if (!this.enabled)
103
                return true;
104
105
            if (weather.enabled)
106
                return false;
107
108
            return true;
109
        });
110
111
        EventBus.register(RenderSkyEvent.class, event -> {
112
            if (!this.enabled)
113
                return true;
114
115
            if (sky.enabled)
116
                return false;
117
118
            return true;
119
        });
120
121
        EventBus.register(ExtractParticleEvent.class, event -> {
122
            if (!this.enabled)
123
                return true;
124
125
            if (particles.enabled)
126
                return false;
127
128
            return true;
129
        });
130
    }
131
}
132
KiwiClientRENDERsrc/main/java/com/tangykiwi/kiwiclient/module/render/NoRender.javaJava · 19 lines · 772 B

Prevents certain things from rendering

SettingsWeatherFogBlindnessDarkness
NoRender.javaJava · Minecraft 26.2 · 19 lines · 772 B · complete file, verbatimOriginal ↗
1
package com.tangykiwi.kiwiclient.module.render;
2
3
import com.tangykiwi.kiwiclient.module.Module;
4
import com.tangykiwi.kiwiclient.module.setting.ToggleSetting;
5
import com.tangykiwi.kiwiclient.module.Category;
6
7
public class NoRender extends Module {
8
    public NoRender() {
9
        super("NoRender", "Prevents certain things from rendering", Category.RENDER,
10
            new ToggleSetting("Weather", "Disables snow/rain", true),
11
            new ToggleSetting("Fog", "Disables fog", true),
12
            new ToggleSetting("Blindness", "Disables blindness effect overlay", true),
13
            new ToggleSetting("Darkness", "Disables darkness effect overlay", true));
14
    }
15
16
    // handling done in WorldRendererMixin for weather
17
    // handling done in FogRendererMixin for fog
18
}
19