|
|
|
@@ -0,0 +1,232 @@
|
|
|
|
|
package cc.fros.features.modules.render;
|
|
|
|
|
|
|
|
|
|
import cc.fros.features.modules.Module;
|
|
|
|
|
import cc.fros.features.settings.EntityListSetting;
|
|
|
|
|
import cc.fros.features.settings.Setting;
|
|
|
|
|
import net.minecraft.world.entity.Entity;
|
|
|
|
|
import net.minecraft.world.entity.EntityType;
|
|
|
|
|
|
|
|
|
|
import java.util.LinkedHashSet;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NoRender — disables various overlays, effects and world/entity rendering.
|
|
|
|
|
* Ported from Meteor's {@code NoRender}.
|
|
|
|
|
*/
|
|
|
|
|
public class NoRenderModule extends Module {
|
|
|
|
|
private static NoRenderModule INSTANCE;
|
|
|
|
|
|
|
|
|
|
private final Setting<Page> page = mode("Page", Page.Overlay);
|
|
|
|
|
|
|
|
|
|
// Overlay
|
|
|
|
|
private final Setting<Boolean> noPortalOverlay = bool("PortalOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noSpyglassOverlay = bool("SpyglassOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noNausea = bool("Nausea", false);
|
|
|
|
|
private final Setting<Boolean> noPumpkinOverlay = bool("PumpkinOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noPowderedSnowOverlay = bool("PowderedSnowOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noFireOverlay = bool("FireOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noLiquidOverlay = bool("LiquidOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noInWallOverlay = bool("InWallOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noVignette = bool("Vignette", false);
|
|
|
|
|
private final Setting<Boolean> noGuiBackground = bool("GuiBackground", false);
|
|
|
|
|
private final Setting<Boolean> noTotemAnimation = bool("TotemAnimation", false);
|
|
|
|
|
private final Setting<Boolean> noParticles = bool("Particles", false);
|
|
|
|
|
private final Setting<Boolean> noEatParticles = bool("EatingParticles", false);
|
|
|
|
|
private final Setting<Boolean> noEnchantGlint = bool("EnchantGlint", false);
|
|
|
|
|
|
|
|
|
|
// HUD
|
|
|
|
|
private final Setting<Boolean> noBossBar = bool("BossBar", false);
|
|
|
|
|
private final Setting<Boolean> noScoreboard = bool("Scoreboard", false);
|
|
|
|
|
private final Setting<Boolean> noCrosshair = bool("Crosshair", false);
|
|
|
|
|
private final Setting<Boolean> noTitle = bool("Title", false);
|
|
|
|
|
private final Setting<Boolean> noHeldItemName = bool("HeldItemName", false);
|
|
|
|
|
private final Setting<Boolean> noObfuscation = bool("Obfuscation", false);
|
|
|
|
|
private final Setting<Boolean> noPotionIcons = bool("PotionIcons", false);
|
|
|
|
|
private final Setting<Boolean> noMessageSignatureIndicator = bool("MessageSignatureIndicator", false);
|
|
|
|
|
|
|
|
|
|
// World
|
|
|
|
|
private final Setting<Boolean> noWeather = bool("Weather", false);
|
|
|
|
|
private final Setting<Boolean> noWorldBorder = bool("WorldBorder", false);
|
|
|
|
|
private final Setting<Boolean> noBlindness = bool("Blindness", false);
|
|
|
|
|
private final Setting<Boolean> noDarkness = bool("Darkness", false);
|
|
|
|
|
private final Setting<Boolean> noFog = bool("Fog", false);
|
|
|
|
|
private final Setting<Boolean> noEnchTableBook = bool("EnchantTableBook", false);
|
|
|
|
|
private final Setting<Boolean> noSignText = bool("SignText", false);
|
|
|
|
|
private final Setting<Boolean> noBlockBreakOverlay = bool("BlockBreakOverlay", false);
|
|
|
|
|
private final Setting<Boolean> noBeaconBeams = bool("BeaconBeams", false);
|
|
|
|
|
private final Setting<Boolean> noFallingBlocks = bool("FallingBlocks", false);
|
|
|
|
|
private final Setting<Boolean> noCaveCulling = bool("CaveCulling", false);
|
|
|
|
|
private final Setting<Boolean> noMapMarkers = bool("MapMarkers", false);
|
|
|
|
|
private final Setting<Boolean> noMapContents = bool("MapContents", false);
|
|
|
|
|
private final Setting<Boolean> noFireworkExplosions = bool("FireworkExplosions", false);
|
|
|
|
|
private final Setting<Boolean> noBarrierInvis = bool("BarrierInvisibility", false);
|
|
|
|
|
private final Setting<Boolean> noTextureRotations = bool("TextureRotations", false);
|
|
|
|
|
|
|
|
|
|
// Entity
|
|
|
|
|
private final Setting<Set<EntityType<?>>> disabledEntities = register(new EntityListSetting("Entities", new LinkedHashSet<>()));
|
|
|
|
|
private final Setting<Boolean> dropSpawnPackets = bool("DropSpawnPackets", false);
|
|
|
|
|
private final Setting<Boolean> noArmor = bool("Armor", false);
|
|
|
|
|
private final Setting<Boolean> noElytra = bool("Elytra", false);
|
|
|
|
|
private final Setting<Boolean> noInvisibility = bool("Invisibility", false);
|
|
|
|
|
private final Setting<Boolean> noGlowing = bool("Glowing", false);
|
|
|
|
|
private final Setting<Boolean> noMobInSpawner = bool("SpawnerEntities", false);
|
|
|
|
|
private final Setting<Boolean> noDeadEntities = bool("DeadEntities", false);
|
|
|
|
|
private final Setting<Boolean> noNametags = bool("Nametags", false);
|
|
|
|
|
|
|
|
|
|
public NoRenderModule() {
|
|
|
|
|
super("NoRender", "Disables certain animations, overlays and entity rendering.", Category.RENDER);
|
|
|
|
|
INSTANCE = this;
|
|
|
|
|
refreshVisibility();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void refreshVisibility() {
|
|
|
|
|
noPortalOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noSpyglassOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noNausea.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noPumpkinOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noPowderedSnowOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noFireOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noLiquidOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noInWallOverlay.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noVignette.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noGuiBackground.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noTotemAnimation.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noParticles.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noEatParticles.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
noEnchantGlint.setVisibility(v -> on(Page.Overlay));
|
|
|
|
|
|
|
|
|
|
noBossBar.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noScoreboard.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noCrosshair.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noTitle.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noHeldItemName.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noObfuscation.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noPotionIcons.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
noMessageSignatureIndicator.setVisibility(v -> on(Page.Hud));
|
|
|
|
|
|
|
|
|
|
noWeather.setVisibility(v -> on(Page.World));
|
|
|
|
|
noWorldBorder.setVisibility(v -> on(Page.World));
|
|
|
|
|
noBlindness.setVisibility(v -> on(Page.World));
|
|
|
|
|
noDarkness.setVisibility(v -> on(Page.World));
|
|
|
|
|
noFog.setVisibility(v -> on(Page.World));
|
|
|
|
|
noEnchTableBook.setVisibility(v -> on(Page.World));
|
|
|
|
|
noSignText.setVisibility(v -> on(Page.World));
|
|
|
|
|
noBlockBreakOverlay.setVisibility(v -> on(Page.World));
|
|
|
|
|
noBeaconBeams.setVisibility(v -> on(Page.World));
|
|
|
|
|
noFallingBlocks.setVisibility(v -> on(Page.World));
|
|
|
|
|
noCaveCulling.setVisibility(v -> on(Page.World));
|
|
|
|
|
noMapMarkers.setVisibility(v -> on(Page.World));
|
|
|
|
|
noMapContents.setVisibility(v -> on(Page.World));
|
|
|
|
|
noFireworkExplosions.setVisibility(v -> on(Page.World));
|
|
|
|
|
noBarrierInvis.setVisibility(v -> on(Page.World));
|
|
|
|
|
noTextureRotations.setVisibility(v -> on(Page.World));
|
|
|
|
|
|
|
|
|
|
disabledEntities.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
dropSpawnPackets.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noArmor.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noElytra.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noInvisibility.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noGlowing.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noMobInSpawner.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noDeadEntities.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
noNametags.setVisibility(v -> on(Page.Entity));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean on(Page p) {
|
|
|
|
|
return page.getValue() == p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static NoRenderModule get() {
|
|
|
|
|
return INSTANCE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static boolean isActive() {
|
|
|
|
|
return INSTANCE != null && INSTANCE.isEnabled();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --- Overlay getters ---
|
|
|
|
|
|
|
|
|
|
public boolean noPortalOverlay() { return isActive() && noPortalOverlay.getValue(); }
|
|
|
|
|
public boolean noSpyglassOverlay() { return isActive() && noSpyglassOverlay.getValue(); }
|
|
|
|
|
public boolean noNausea() { return isActive() && noNausea.getValue(); }
|
|
|
|
|
public boolean noPumpkinOverlay() { return isActive() && noPumpkinOverlay.getValue(); }
|
|
|
|
|
public boolean noPowderedSnowOverlay() { return isActive() && noPowderedSnowOverlay.getValue(); }
|
|
|
|
|
public boolean noFireOverlay() { return isActive() && noFireOverlay.getValue(); }
|
|
|
|
|
public boolean noLiquidOverlay() { return isActive() && noLiquidOverlay.getValue(); }
|
|
|
|
|
public boolean noInWallOverlay() { return isActive() && noInWallOverlay.getValue(); }
|
|
|
|
|
public boolean noVignette() { return isActive() && noVignette.getValue(); }
|
|
|
|
|
public boolean noGuiBackground() { return isActive() && noGuiBackground.getValue(); }
|
|
|
|
|
public boolean noTotemAnimation() { return isActive() && noTotemAnimation.getValue(); }
|
|
|
|
|
public boolean noParticles() { return isActive() && noParticles.getValue(); }
|
|
|
|
|
public boolean noEatParticles() { return isActive() && noEatParticles.getValue(); }
|
|
|
|
|
public boolean noEnchantGlint() { return isActive() && noEnchantGlint.getValue(); }
|
|
|
|
|
|
|
|
|
|
// --- HUD getters ---
|
|
|
|
|
|
|
|
|
|
public boolean noBossBar() { return isActive() && noBossBar.getValue(); }
|
|
|
|
|
public boolean noScoreboard() { return isActive() && noScoreboard.getValue(); }
|
|
|
|
|
public boolean noCrosshair() { return isActive() && noCrosshair.getValue(); }
|
|
|
|
|
public boolean noTitle() { return isActive() && noTitle.getValue(); }
|
|
|
|
|
public boolean noHeldItemName() { return isActive() && noHeldItemName.getValue(); }
|
|
|
|
|
public boolean noObfuscation() { return isActive() && noObfuscation.getValue(); }
|
|
|
|
|
public boolean noPotionIcons() { return isActive() && noPotionIcons.getValue(); }
|
|
|
|
|
public boolean noMessageSignatureIndicator() { return isActive() && noMessageSignatureIndicator.getValue(); }
|
|
|
|
|
|
|
|
|
|
// --- World getters ---
|
|
|
|
|
|
|
|
|
|
public boolean noWeather() { return isActive() && noWeather.getValue(); }
|
|
|
|
|
public boolean noWorldBorder() { return isActive() && noWorldBorder.getValue(); }
|
|
|
|
|
public boolean noBlindness() { return isActive() && noBlindness.getValue(); }
|
|
|
|
|
public boolean noDarkness() { return isActive() && noDarkness.getValue(); }
|
|
|
|
|
public boolean noFog() { return isActive() && noFog.getValue(); }
|
|
|
|
|
public boolean noEnchTableBook() { return isActive() && noEnchTableBook.getValue(); }
|
|
|
|
|
public boolean noSignText() { return isActive() && noSignText.getValue(); }
|
|
|
|
|
public boolean noBlockBreakOverlay() { return isActive() && noBlockBreakOverlay.getValue(); }
|
|
|
|
|
public boolean noBeaconBeams() { return isActive() && noBeaconBeams.getValue(); }
|
|
|
|
|
public boolean noFallingBlocks() { return isActive() && noFallingBlocks.getValue(); }
|
|
|
|
|
public boolean noCaveCulling() { return isActive() && noCaveCulling.getValue(); }
|
|
|
|
|
public boolean noMapMarkers() { return isActive() && noMapMarkers.getValue(); }
|
|
|
|
|
public boolean noMapContents() { return isActive() && noMapContents.getValue(); }
|
|
|
|
|
public boolean noFireworkExplosions() { return isActive() && noFireworkExplosions.getValue(); }
|
|
|
|
|
public boolean noBarrierInvis() { return isActive() && noBarrierInvis.getValue(); }
|
|
|
|
|
public boolean noTextureRotations() { return isActive() && noTextureRotations.getValue(); }
|
|
|
|
|
|
|
|
|
|
// --- Entity getters ---
|
|
|
|
|
|
|
|
|
|
public boolean noArmor() { return isActive() && noArmor.getValue(); }
|
|
|
|
|
public boolean noElytra() { return isActive() && noElytra.getValue(); }
|
|
|
|
|
public boolean noInvisibility() { return isActive() && noInvisibility.getValue(); }
|
|
|
|
|
public boolean noGlowing() { return isActive() && noGlowing.getValue(); }
|
|
|
|
|
public boolean noMobInSpawner() { return isActive() && noMobInSpawner.getValue(); }
|
|
|
|
|
public boolean noDeadEntities() { return isActive() && noDeadEntities.getValue(); }
|
|
|
|
|
public boolean noNametags() { return isActive() && noNametags.getValue(); }
|
|
|
|
|
public Set<EntityType<?>> disabledEntities() { return disabledEntities.getValue(); }
|
|
|
|
|
public boolean dropSpawnPackets() { return isActive() && dropSpawnPackets.getValue(); }
|
|
|
|
|
|
|
|
|
|
/** True when the given entity type is ticked off in the {@code Entities} list. */
|
|
|
|
|
public boolean noEntity(EntityType<?> type) { return isActive() && type != null && disabledEntities.getValue().contains(type); }
|
|
|
|
|
|
|
|
|
|
/** True when this specific entity is ticked off in the {@code Entities} list. */
|
|
|
|
|
public boolean noEntity(Entity entity) { return entity != null && noEntity(entity.getType()); }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onEnable() {
|
|
|
|
|
if (noCaveCulling.getValue() || noTextureRotations.getValue()) {
|
|
|
|
|
mc.levelRenderer.allChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onDisable() {
|
|
|
|
|
if (noCaveCulling.getValue() || noTextureRotations.getValue()) {
|
|
|
|
|
mc.levelRenderer.allChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private enum Page {
|
|
|
|
|
Overlay,
|
|
|
|
|
Hud,
|
|
|
|
|
World,
|
|
|
|
|
Entity
|
|
|
|
|
}
|
|
|
|
|
}
|