Skip to content

Commit

Permalink
Add Disable Animations + RenderSky Option
Browse files Browse the repository at this point in the history
  • Loading branch information
thr3343 committed Dec 19, 2023
1 parent 0934a4e commit 49bc787
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/vulkanmod/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class Config {
public boolean uniqueOpaqueLayer = true;
public boolean entityCulling = true;
public int device = -1;
public boolean animations = true;
public boolean renderSky = true;

private static Path path;

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/vulkanmod/config/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ public static Option<?>[] getGraphicsOpts() {
new RangeOption("Entity Distance", 50, 500, 25,
value -> minecraftOptions.entityDistanceScaling().set(value * 0.01),
() -> minecraftOptions.entityDistanceScaling().get().intValue() * 100),
new SwitchOption("Animations",
value -> config.animations = value,
() -> config.animations),
new SwitchOption("Render Sky",
value -> config.renderSky = value,
() -> config.renderSky),
new CyclingOption<>("Mipmap Levels",
new Integer[]{0, 1, 2, 3, 4},
value -> Component.nullToEmpty(value.toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.VertexBuffer;
import net.minecraft.client.renderer.ShaderInstance;
import net.vulkanmod.Initializer;
import net.vulkanmod.render.VBO;
import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -57,7 +58,8 @@ public void upload(BufferBuilder.RenderedBuffer buffer) {
*/
@Overwrite
public void drawWithShader(Matrix4f viewMatrix, Matrix4f projectionMatrix, ShaderInstance shader) {
vbo.drawWithShader(viewMatrix, projectionMatrix, shader);
if(Initializer.CONFIG.renderSky)
vbo.drawWithShader(viewMatrix, projectionMatrix, shader);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.Tickable;
import net.minecraft.resources.ResourceLocation;
import net.vulkanmod.Initializer;
import net.vulkanmod.render.texture.SpriteUtil;
import net.vulkanmod.vulkan.DeviceManager;
import net.vulkanmod.vulkan.Renderer;
Expand All @@ -29,7 +30,7 @@ public abstract class MTextureManager {
*/
@Overwrite
public void tick() {
if(Renderer.skipRendering)
if(Renderer.skipRendering|| !Initializer.CONFIG.animations)
return;

//Debug D
Expand Down

0 comments on commit 49bc787

Please sign in to comment.