Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public void initModules() {

// client
system.addModule(new AutoDisconnect());
// system.addModule(new SelfGlow());
system.addModule(new SelfGlow());
system.addModule(new GuiBorders());
system.addModule(new InGameHuds());
system.addModule(new SilkTouch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class ToggleCommand extends Command {

public static boolean used = false;
public static boolean active = false;

public ToggleCommand() {
super("toggle","§7Toggles the modules from this mod. THIS CAN ALSO BE DONE VIA GUI MENU, PRESS YOUR §l§oAPOSTROPHE §7KEY!",",toggle <module> [on|off|help]","t");
Expand All @@ -28,27 +28,27 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
for (Module m: system.collectModules())
if (m.getClass() != SilkTouch.class)
m.setEnabled(true, false);
used = true;
active = true;
info("&bToggled all modules on");
used = false;
active = false;
return SINGLE_SUCCESS;
}))
.then(literal("off")
.executes(context -> {
for (Module m: system.collectModules())
m.setEnabled(false, false);
used = true;
active = true;
info("&7Toggled all modules off");
used = false;
active = false;
return SINGLE_SUCCESS;
}))
.executes(context -> {
for (Module m: system.collectModules())
if (m.getClass() != SilkTouch.class)
m.setEnabled(!m.isEnabled(), false);
used = true;
active = true;
info("&bToggled all modules (on -> off, off -> on)");
used = false;
active = false;
return SINGLE_SUCCESS;
}))
.then(argument("module", ModuleArgumentType.create())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.github.itzispyder.clickcrystals.mixins;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import io.github.itzispyder.clickcrystals.modules.Module;
import io.github.itzispyder.clickcrystals.modules.modules.clickcrystals.SelfGlow;
import io.github.itzispyder.clickcrystals.modules.modules.rendering.SpectatorSight;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -9,15 +11,28 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static io.github.itzispyder.clickcrystals.Global.mc;

@Mixin(Entity.class)
public abstract class MixinEntity {

@Inject(method = "isInvisibleTo", at = @At("HEAD"), cancellable = true)
private void overrideIsInvisibleToPlayer(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
SpectatorSight ss = Module.get(SpectatorSight.class);

if (ss.isEnabled() && ss.canRender((Entity)(Object)this)) {
if (ss.isEnabled() && ss.canRender((Entity) (Object) this)) {
cir.setReturnValue(false);
}
}

@ModifyReturnValue(method = "getTeamColorValue", at = @At("RETURN"))
private int modifyGetTeamColorValue(int original) {

SelfGlow self = Module.get(SelfGlow.class);

if (self == null || !self.isEnabled() || ((Object) this) != mc.player)
return original;

return self.glowColor.getVal().getRGBA();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void renderUpdated(FlyingItemEntityRenderState flyingItemEntityRenderStat
PearlCustomizer pc = Module.get(PearlCustomizer.class);
Entity entity = EntityUtils.getRenderStateOwner(flyingItemEntityRenderState);

if (!pc.isEnabled())
if (pc == null || !pc.isEnabled())
return;

if (!(entity instanceof EnderPearlEntity pearl))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class MixinLightmapTextureManager implements Global {

@Inject(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", shift = At.Shift.AFTER), cancellable = true)
private void onUpdate(float tickProgress, CallbackInfo ci, @Local Profiler profiler) {
if (Module.get(FullBright.class).isEnabled()) {
if (Module.isEnabled(FullBright.class)) {
RenderSystem.getDevice().createCommandEncoder().clearColorTexture(this.glTexture, 0xFFFFFFFF);
profiler.pop();
ci.cancel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package io.github.itzispyder.clickcrystals.mixins;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import io.github.itzispyder.clickcrystals.Global;
import io.github.itzispyder.clickcrystals.events.events.client.PlayerAttackEntityEvent;
import io.github.itzispyder.clickcrystals.events.events.client.SetScreenEvent;
import io.github.itzispyder.clickcrystals.events.events.networking.GameLeaveEvent;
import io.github.itzispyder.clickcrystals.interfaces.AccessorMinecraftClient;
import io.github.itzispyder.clickcrystals.modules.Module;
import io.github.itzispyder.clickcrystals.modules.modules.clickcrystals.SelfGlow;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -66,9 +70,11 @@ public void inputUse() {
this.doItemUse();
}

// @Inject(method = "hasOutline", at = @At("HEAD"), cancellable = true)
// private void outlineEntities(Entity entity, CallbackInfoReturnable<Boolean> ci) {
// if (entity instanceof ClientPlayerEntity && Module.isEnabled(SelfGlow.class))
// ci.setReturnValue(true);
// }

@ModifyReturnValue(method = "hasOutline", at = @At("RETURN"))
private boolean hasOutline(boolean original, Entity entity) {
if (mc == null) return original;
SelfGlow selfGlow = Module.get(SelfGlow.class);
return selfGlow != null ? selfGlow.isEnabled() && entity == mc.player : original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ public void setOutlineColor(Args args) {
}
}

// @Inject(method = "renderEntity", at = @At("HEAD"))
// private void onRenderEntity(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
// if (!(entity instanceof ClientPlayerEntity && vertexConsumers instanceof OutlineVertexConsumerProvider outlineConsumers))
// return;
//
// SelfGlow selfGlow = Module.get(SelfGlow.class);
//
// if (selfGlow.isEnabled()) {
// SelfGlow.Color glowColor = selfGlow.glowColor.getVal();
// int[] rgba = glowColor.getRGBA();
// outlineConsumers.setColor(rgba[0], rgba[1], rgba[2], rgba[3]);
// }
// }

@Inject(method = "render", at = @At("TAIL"))
public void render(ObjectAllocator allocator, RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, Matrix4f positionMatrix, Matrix4f matrix4f, Matrix4f projectionMatrix, GpuBufferSlice fogBuffer, Vector4f fogColor, boolean renderSky, CallbackInfo ci) {
RenderWorldEvent event = new RenderWorldEvent(mc.gameRenderer, positionMatrix, projectionMatrix, tickCounter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public String getHelp() {
}

public void sendUpdateInfo() {
if (!ClickCrystals.config.isDisableModuleToggleBroadcast() || !ToggleCommand.used)
if (!ClickCrystals.config.isDisableModuleToggleBroadcast() && ToggleCommand.active)
ChatUtils.sendPrefixMessage("§b" + name + " §3is now toggled " + getOnOrOff());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void onDisable() {
Module.acceptFor(TntSwap.class, tntSwap -> tntSwap.remove(postAction));
}

/*
/* @improperIssues TODO?
@EventHandler
private void onInteract(PacketSendEvent e) {
if (e.getPacket() instanceof PlayerInteractBlockC2SPacket packet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.github.itzispyder.clickcrystals.modules.modules.DummyModule;
import io.github.itzispyder.clickcrystals.modules.settings.SettingSection;

// NOTICE: Module pause development until rendering issue is resolved @I-No-One
public class SelfGlow extends DummyModule {

private final SettingSection scGeneral = getGeneralSection();
Expand Down Expand Up @@ -43,8 +42,8 @@ public enum Color {
this.alpha = alpha;
}

public int[] getRGBA() {
return new int[]{red, green, blue, alpha};
public int getRGBA() {
return alpha << 24 | red << 16 | green << 8 | blue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.entity.Entity;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
Expand All @@ -37,11 +38,19 @@ public void onCommand(ScriptCommand command, String line, ScriptArgs args) {
switch (read.next(TargetType.class)) {
case NEAREST_ENTITY -> {
Predicate<Entity> filter = ScriptParser.parseEntityPredicate(read.nextStr());
PlayerUtils.runOnNearestEntity(128, filter, entity -> mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND));
PlayerUtils.runOnNearestEntity(128, filter, entity -> {
EntityHitResult hitResult = new EntityHitResult(entity, entity.getBoundingBox().getCenter());
mc.interactionManager.interactEntityAtLocation(mc.player, entity, hitResult, Hand.MAIN_HAND);
mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND);
});
read.executeThenChain();
}
case ANY_ENTITY -> {
PlayerUtils.runOnNearestEntity(128, DamageCmd.ENTITY_EXISTS, entity -> mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND));
PlayerUtils.runOnNearestEntity(128, DamageCmd.ENTITY_EXISTS, entity -> {
EntityHitResult hitResult = new EntityHitResult(entity, entity.getBoundingBox().getCenter());
mc.interactionManager.interactEntityAtLocation(mc.player, entity, hitResult, Hand.MAIN_HAND);
mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND);
});
read.executeThenChain();
}
case NEAREST_BLOCK -> {
Expand Down