Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ItziSpyder authored Mar 31, 2023
1 parent 40ce286 commit 865f5df
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.14

# Mod Properties
mod_version = 1.19.3-0.6.0
mod_version = 1.19.3-0.6.1
maven_group = io.github.itzispyder
archives_base_name = ClickCrystals

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void onInitialize() {
system.addModule(new SlowHandSwing());
system.addModule(new SpectatorSight());
system.addModule(new NoLoadingScreen());
system.addModule(new NoGameOverlay());
Module.loadConfigModules();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

import java.util.Comparator;
import java.util.List;

import static io.github.itzispyder.clickcrystals.ClickCrystals.*;

/**
Expand Down Expand Up @@ -74,7 +77,12 @@ public void init() {
adder.add(title,2);

int y = 0, x = 0;
for (Module module : system.modules().values()) {
List<Module> sortedModules = system.modules().values()
.stream()
.sorted(Comparator.comparing(Module::getId))
.toList();

for (Module module : sortedModules) {
if (y ++ >= MAX_ROW_PER_COLUMN) {
x ++;
y = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.itzispyder.clickcrystals.mixins;

import io.github.itzispyder.clickcrystals.modules.Module;
import io.github.itzispyder.clickcrystals.modules.modules.NoGameOverlay;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.CameraSubmersionType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

/**
* Mixin for the camera or player screen perspectives
*/
@Mixin(Camera.class)
public abstract class CameraMixin {

@Inject(method = "getSubmersionType", at = @At("RETURN"), cancellable = true)
public void getSubmersionType(CallbackInfoReturnable<CameraSubmersionType> cir) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) cir.setReturnValue(CameraSubmersionType.NONE);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package io.github.itzispyder.clickcrystals.mixins;

import io.github.itzispyder.clickcrystals.modules.Module;
import io.github.itzispyder.clickcrystals.modules.modules.NoGameOverlay;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.entity.Entity;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
* Mixin for the in game hud
*/
@Mixin(InGameHud.class)
public abstract class GameHudMixin {

@Inject(method = "renderSpyglassOverlay", at = @At("HEAD"), cancellable = true)
public void renderSpyglassOverlay(float scale, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}

@Inject(method = "renderPortalOverlay", at = @At("HEAD"), cancellable = true)
public void renderPortalOverlay(float scale, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}

@Inject(method = "renderVignetteOverlay", at = @At("HEAD"), cancellable = true)
public void renderVignetteOverlay(Entity entity, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}

@Inject(method = "renderOverlay", at = @At("HEAD"), cancellable = true)
public void renderOverlay(Identifier texture, float opacity, CallbackInfo ci) {
if (!texture.getPath().contains("pumpkinblur")) return;
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package io.github.itzispyder.clickcrystals.mixins;

import io.github.itzispyder.clickcrystals.modules.Module;
import io.github.itzispyder.clickcrystals.modules.modules.NoGameOverlay;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.InGameOverlayRenderer;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
* Mixin for rendering in game overlays
*/
@Mixin(InGameOverlayRenderer.class)
public abstract class GameOverlayMixin {

@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
private static void renderFireOverlay(MinecraftClient client, MatrixStack matrices, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}

@Inject(method = "renderUnderwaterOverlay", at = @At("HEAD"), cancellable = true)
private static void renderUnderwaterOverlay(MinecraftClient client, MatrixStack matrices, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}

@Inject(method = "renderInWallOverlay", at = @At("HEAD"), cancellable = true)
private static void renderInWallOverlay(Sprite sprite, MatrixStack matrices, CallbackInfo ci) {
Module noOverlay = Module.get(NoGameOverlay.class);
if (noOverlay.isEnabled()) ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.itzispyder.clickcrystals.modules.modules;

import io.github.itzispyder.clickcrystals.modules.Module;

/**
* NoGameOverlay module
*/
public class NoGameOverlay extends Module {

public NoGameOverlay() {
super("NoGameOverlay","See clearly under water and lava, and in blocks! No more overlays!");
}

@Override
protected void onEnable() {

}

@Override
protected void onDisable() {

}
}
3 changes: 3 additions & 0 deletions src/main/resources/clickcrystals.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"package": "io.github.itzispyder.clickcrystals.mixins",
"compatibilityLevel": "JAVA_17",
"client": [
"CameraMixin",
"ClientPlayerInteractionMixin",
"GameHudMixin",
"GameOverlayMixin",
"GameRenderMixin",
"LightmapTextureMixin",
"PacketListenerMixin"
Expand Down

0 comments on commit 865f5df

Please sign in to comment.