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 @@ -32,19 +32,16 @@
import io.github.axolotlclient.modules.auth.Auth;
import io.github.axolotlclient.modules.blur.MenuBlur;
import io.github.axolotlclient.modules.blur.MotionBlur;
import io.github.axolotlclient.modules.freelook.Freelook;
import io.github.axolotlclient.modules.hud.HudManager;
import io.github.axolotlclient.modules.hypixel.HypixelMods;
import io.github.axolotlclient.modules.particles.Particles;
import io.github.axolotlclient.modules.renderOptions.BeaconBeam;
import io.github.axolotlclient.modules.rpc.DiscordRPC;
import io.github.axolotlclient.modules.screenshotUtils.ScreenshotUtils;
import io.github.axolotlclient.modules.scrollableTooltips.ScrollableTooltips;
import io.github.axolotlclient.modules.sky.SkyResourceManager;
import io.github.axolotlclient.modules.tablist.Tablist;
import io.github.axolotlclient.modules.tnttime.TntTime;
import io.github.axolotlclient.modules.zoom.Zoom;
import io.github.axolotlclient.util.FeatureDisabler;
import io.github.axolotlclient.util.FeatureDisablerCommon;
import io.github.axolotlclient.util.Logger;
import io.github.axolotlclient.util.LoggerImpl;
import io.github.axolotlclient.util.notifications.Notifications;
Expand All @@ -66,12 +63,9 @@ private void addBuiltinModules() {
registerModule(MotionBlur.getInstance());
registerModule(MenuBlur.getInstance());
registerModule(ScrollableTooltips.getInstance());
registerModule(DiscordRPC.getInstance());
registerModule(Freelook.getInstance());
registerModule(TntTime.getInstance());

registerModule(Particles.getInstance());
registerModule(ScreenshotUtils.getInstance());
registerModule(BeaconBeam.getInstance());
registerModule(Tablist.getInstance());
registerModule(Auth.getInstance());
registerModule(APIOptions.getInstance());
Expand All @@ -97,8 +91,8 @@ public void onInitializeClient() {
}

@Override
protected void initFeatureDisabler() {
FeatureDisabler.init();
protected FeatureDisablerCommon getFeatureDisabler() {
return FeatureDisabler.getInstance();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public Identifier getFabricId() {
return new Identifier("axolotlclient", "bridge/resource_listener");
}
});

ClientPlayConnectionEvents.INIT.register((handler, client) ->
Events.BEGIN_JOIN_SERVER.invoker().accept(new Events.ServerJoinInfo(handler.getConnection().getAddress().toString())));

ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@

package io.github.axolotlclient.bridge.mixin;

import java.util.Collection;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import io.github.axolotlclient.bridge.AxoMinecraftClient;
import io.github.axolotlclient.bridge.AxoPlayerListEntry;
import io.github.axolotlclient.bridge.AxoSession;
import io.github.axolotlclient.bridge.entity.AxoEntity;
import io.github.axolotlclient.bridge.entity.AxoPlayer;
import io.github.axolotlclient.bridge.key.AxoClientKeybinds;
import io.github.axolotlclient.bridge.AxoGameOptions;
import io.github.axolotlclient.bridge.render.AxoFont;
import io.github.axolotlclient.bridge.resource.AxoResourceManager;
import io.github.axolotlclient.bridge.util.AxoText;
Expand All @@ -41,9 +44,15 @@
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.client.options.GameOptions;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.client.util.Session;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.resource.ResourceManager;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.scoreboard.ScoreboardObjective;
import net.minecraft.scoreboard.ScoreboardPlayerScore;
import net.minecraft.scoreboard.Team;
import net.minecraft.text.Text;
import net.minecraft.util.thread.ReentrantThreadExecutor;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -89,6 +98,14 @@ public abstract class MinecraftClientMixin extends ReentrantThreadExecutor<Runna
@Shadow
public abstract ResourceManager getResourceManager();

@Shadow
@Final
public WorldRenderer worldRenderer;

@Shadow
@Nullable
public Entity cameraEntity;

public MinecraftClientMixin(String string) {
super(string);
}
Expand All @@ -111,7 +128,7 @@ public MinecraftClientMixin(String string) {

@Override

public AxoClientKeybinds br$getKeybinds() {
public AxoGameOptions br$getGameOptions() {
return options;
}

Expand All @@ -130,6 +147,11 @@ public MinecraftClientMixin(String string) {
return Optional.ofNullable(getCurrentServerEntry()).map(x -> x.address).orElse(null);
}

@Override
public String br$getServerName() {
return Optional.ofNullable(getCurrentServerEntry()).map(x -> x.name).orElse(null);
}

@Override
public Collection<? extends AxoPlayerListEntry> br$getOnlinePlayers() {
return player.networkHandler.getPlayerList();
Expand Down Expand Up @@ -161,4 +183,54 @@ public MinecraftClientMixin(String string) {
public Object br$getScreen() {
return currentScreen;
}

@Override
public void br$notifyLevelRenderer() {
worldRenderer.scheduleTerrainUpdate();
}

@Override
public AxoEntity br$getCameraEntity() {
return cameraEntity;
}

@Override
public List<String> br$getSidebar() {
List<String> lines = new ArrayList<>();
MinecraftClient client = MinecraftClient.getInstance();
if (client.world == null)
return lines;

Scoreboard scoreboard = client.world.getScoreboard();
if (scoreboard == null)
return lines;
ScoreboardObjective sidebar = scoreboard.getObjectiveForSlot(1);
if (sidebar == null)
return lines;

Collection<ScoreboardPlayerScore> scores = scoreboard.getAllPlayerScores(sidebar);
List<ScoreboardPlayerScore> list = scores.stream().filter(
input -> input != null && input.getPlayerName() != null && !input.getPlayerName().startsWith("#"))
.collect(Collectors.toList());

if (list.size() > 15) {
scores = Lists.newArrayList(Iterables.skip(list, scores.size() - 15));
} else {
scores = list;
}

for (ScoreboardPlayerScore score : scores) {
Team team = scoreboard.getPlayerTeam(score.getPlayerName());
if (team == null)
return lines;
String text = team.getPrefix().getString() + team.getSuffix().getString();
if (!text.trim().isEmpty())
lines.add(text);
}

lines.add(sidebar.getDisplayName().getString());
Collections.reverse(lines);

return lines;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@

package io.github.axolotlclient.bridge.mixin.key;

import io.github.axolotlclient.bridge.key.AxoClientKeybinds;
import io.github.axolotlclient.bridge.AxoGameOptions;
import io.github.axolotlclient.bridge.AxoPerspective;
import io.github.axolotlclient.bridge.key.AxoKeybinding;
import net.minecraft.client.options.GameOptions;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.options.Perspective;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(GameOptions.class)
public abstract class GameOptionsMixin implements AxoClientKeybinds {
public abstract class GameOptionsMixin implements AxoGameOptions {
@Shadow
@Final
public KeyBinding keyAttack;
Expand All @@ -48,6 +50,12 @@ public abstract class GameOptionsMixin implements AxoClientKeybinds {
@Final
public KeyBinding keyUse;

@Shadow
public abstract Perspective getPerspective();

@Shadow
public abstract void method_31043(Perspective par1);

@Override
public AxoKeybinding br$getSprintKeybind() {
return keySprint;
Expand All @@ -67,4 +75,22 @@ public abstract class GameOptionsMixin implements AxoClientKeybinds {
public AxoKeybinding br$getUseKey() {
return keyUse;
}

@Override
public AxoPerspective br$getCameraType() {
return switch (getPerspective()) {
case FIRST_PERSON -> AxoPerspective.FIRST_PERSON;
case THIRD_PERSON_BACK -> AxoPerspective.THIRD_PERSON_BACK;
case THIRD_PERSON_FRONT -> AxoPerspective.THIRD_PERSON_FRONT;
};
}

@Override
public void br$setCameraType(AxoPerspective perspective) {
method_31043(switch (perspective) {
case FIRST_PERSON -> Perspective.FIRST_PERSON;
case THIRD_PERSON_BACK -> Perspective.THIRD_PERSON_BACK;
case THIRD_PERSON_FRONT -> Perspective.THIRD_PERSON_FRONT;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,8 @@
import net.minecraft.client.texture.NativeImageBackedTexture;

public class AxolotlClientConfig extends AxolotlClientConfigCommon {

public final BooleanOption showOwnNametag = new BooleanOption("showOwnNametag", false);
public final BooleanOption useShadows = new BooleanOption("useShadows", false);
public final BooleanOption nametagBackground = new BooleanOption("nametagBackground", true);

public final BooleanOption showBadges = new BooleanOption("showBadges", true);
public final BooleanOption customBadge = new BooleanOption("customBadge", false);
public final StringOption badgeText = new StringOption("badgeText", "");

public final ForceableBooleanOption timeChangerEnabled = new ForceableBooleanOption("enabled", false);
public final IntegerOption customTime = new IntegerOption("time", 0, 0, 24000);
public final BooleanOption customSky = new BooleanOption("customSky", true);
public final BooleanOption dynamicFOV = new BooleanOption("dynamicFov", true);
public final ForceableBooleanOption fullBright = new ForceableBooleanOption("fullBright", false);
public final BooleanOption removeVignette = new BooleanOption("removeVignette", false);
public final ForceableBooleanOption lowFire = new ForceableBooleanOption("lowFire", false);

public final BooleanOption lowShield = new BooleanOption("lowShield", false);
public final ColorOption hitColor = new ColorOption("hitColor", new Color(255, 0, 0, 77),
value -> {
Expand Down Expand Up @@ -93,59 +79,26 @@ public class AxolotlClientConfig extends AxolotlClientConfigCommon {
} catch (Exception ignored) {
}
});
public final BooleanOption minimalViewBob = new BooleanOption("minimalViewBob", false);
public final BooleanOption noHurtCam = new BooleanOption("noHurtCam", false);

public final BooleanOption flatItems = new BooleanOption("flatItems", false);
public final BooleanOption inventoryPotionEffectOffset = new BooleanOption("inventory.potion_effect_offset", true);

public final ColorOption loadingScreenColor = new ColorOption("loadingBgColor", new Color(239, 50, 61, 255));
public final BooleanOption nightMode = new BooleanOption("nightMode", false);
public final BooleanOption customWindowTitle = new BooleanOption("customWindowTitle", true);

public final BooleanOption enableCustomOutlines = new BooleanOption("enabled", false);
public final ColorOption outlineColor = new ColorOption("color", Color.parse("#DD000000"));
public final BooleanOption outlineChroma = new BooleanOption("chroma", false);

public final BooleanOption noRain = new BooleanOption("noRain", false);

public final GenericOption openCredits = new GenericOption("Credits", "Open Credits", () ->
MinecraftClient.getInstance().openScreen(new CreditsScreen(MinecraftClient.getInstance().currentScreen))
);
public final BooleanOption debugLogOutput = new BooleanOption("debugLogOutput", false);
public final BooleanOption creditsBGM = new BooleanOption("creditsBGM", true);

public final OptionCategory general = OptionCategory.create("general");
public final OptionCategory nametagOptions = OptionCategory.create("nametagOptions");
public final OptionCategory rendering = OptionCategory.create("rendering");
public final OptionCategory outlines = OptionCategory.create("blockOutlines");
public final OptionCategory timeChanger = OptionCategory.create("timeChanger");

@Getter
private final List<Option<?>> options = new ArrayList<>();

public AxolotlClientConfig() {
config.add(general);
config.add(nametagOptions);
config.add(rendering);

rendering.add(outlines);

nametagOptions.add(showOwnNametag);
nametagOptions.add(useShadows);
nametagOptions.add(nametagBackground);

nametagOptions.add(showBadges);
nametagOptions.add(customBadge);
nametagOptions.add(badgeText);

general.add(loadingScreenColor);
general.add(nightMode);
general.add(customWindowTitle);
general.add(openCredits);
general.add(debugLogOutput);

general.add(datetimeFormat);
general.add(titleScreenOptionButtonMode);
general.add(gameMenuScreenOptionButtonMode);

ConfigUI.getInstance().runWhenLoaded(() -> {
general.getOptions().removeIf(o -> "configStyle".equals(o.getName()));
Expand All @@ -169,29 +122,13 @@ public AxolotlClientConfig() {
});

rendering.add(customSky,
dynamicFOV,
fullBright,
removeVignette,
lowFire,
lowShield,
hitColor,
minimalViewBob,
flatItems,
noHurtCam,
inventoryPotionEffectOffset);

timeChanger.add(timeChangerEnabled);
timeChanger.add(customTime);
rendering.add(timeChanger);

outlines.add(enableCustomOutlines);
outlines.add(outlineColor);
outlines.add(outlineChroma);

rendering.add(noRain);

hidden.add(creditsBGM, someNiceBackground);

general.add(new GenericOption("profiles.title", "profiles.configure", () ->
MinecraftClient.getInstance().openScreen(new ProfilesScreen(MinecraftClient.getInstance().currentScreen))), false);

Expand All @@ -203,5 +140,4 @@ public AxolotlClientConfig() {
}
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

package io.github.axolotlclient.mixin;

import io.github.axolotlclient.modules.renderOptions.BeaconBeam;
import io.github.axolotlclient.modules.render.BeaconBeam;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.minecraft.client.render.entity.TntEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.TntEntity;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -45,7 +46,7 @@ protected TntEntityRendererMixin(EntityRenderDispatcher dispatcher) {
public void axolotlclient$render(TntEntity entity, float yaw, float delta, MatrixStack matrixStack,
VertexConsumerProvider vertexConsumerProvider, int light, CallbackInfo ci) {
if (TntTime.getInstance().enabled.get()) {
super.renderLabelIfPresent(entity, TntTime.getInstance().getFuseTime(entity.getFuse()), matrixStack,
super.renderLabelIfPresent(entity, (Text) TntTime.getInstance().getFuseTime(entity.getFuse()), matrixStack,
vertexConsumerProvider, light);
}
}
Expand Down
Loading
Loading