Skip to content

Commit fbc5b21

Browse files
authored
Merge pull request #37 from AxolotlClient/1.8/kronhud-2.2.x
1.8/kronhud 2.2.x
2 parents e58185d + 9ad2872 commit fbc5b21

File tree

105 files changed

+4463
-2564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4463
-2564
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### 1.0.0 - 2.0.0
2+
3+
- Create the mod
4+
- Learn Java
5+
- Add Badge System
6+
- Add HUD modules
7+
- Add Hypixel mods
8+
- Add DiscordRPC
9+
- Add Custom Skies
10+
- Add Zoom
11+
- Rewrite Configuration System
12+
13+
- Add Turkish translation (YakisikliBaran)
14+
15+
### 2.0.0 - 2.2.0
16+
17+
- Separate the config system into a config library
18+
- Add French translation (CornetPanique86)
19+
- Add MotionBlur & Freelook (TheKodeToad)
20+
- Add Particle Modifiers
21+
- Add Screenshot Utils
22+
- Add Scrollable Tooltips
23+
- Add TnTTime
24+
- Add external Module Support
25+
- Add some other stuff I forgot
26+
- Full Changelog: https://github.com/AxolotlClient/AxolotlClient-mod/compare/v2.1.0+1.8.9...v2.2.0+1.8.9
27+
28+
### 2.2.1
29+
30+
- use own maven instead of JitPack
31+
- updated Translations
32+
- fix bugs in the config library
33+
34+
### 2.2.2
35+
36+
- Port of KronHUD 2.2.3's feature set
37+
- Use JSON format for translations
38+
- Various Fixes
39+
- now using the provided DefaultConfigManager

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ Features include:
2424
- Custom Block Outlines
2525
- Discord RPC
2626
- Badges for players using the mod
27+
28+
### Contributing
29+
30+
- feel free to join the discord to discuss new features
31+
- if you have a feature or a new/updated translation, feel free to open a pull request.
32+
- note your changes in CHANGELOG.md to be added to the next version's changelog.

build.gradle

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ plugins {
22
id 'fabric-loom' version "1.0-SNAPSHOT"
33
id 'io.github.juuxel.loom-quiltflower' version '1.7.+' // For loom 0.8-0.9, 0.11+
44
id 'maven-publish'
5+
id 'com.modrinth.minotaur' version "2.+"
6+
id 'io.freefair.lombok' version "6.5.1"
57
}
68

9+
archivesBaseName = project.archives_base_name
710
version = project.mod_version
811
group = project.maven_group
912

@@ -20,7 +23,7 @@ repositories {
2023
maven {
2124
url "https://moehreag.duckdns.org/maven/releases"
2225
}
23-
26+
mavenLocal()
2427
maven { url 'https://jitpack.io' }
2528
mavenCentral()
2629
}
@@ -62,7 +65,7 @@ dependencies {
6265
implementation('org.apache.logging.log4j:log4j-core:2.19.0')
6366

6467
modImplementation include("com.github.moehreag:search-in-resources:1.0.2")
65-
modImplementation include('io.github.axolotlclient:AxolotlClient-config:1.0.8+1.8.9')
68+
modImplementation include('io.github.axolotlclient:AxolotlClient-config:1.0.11+1.8.9')
6669
}
6770

6871
// More hacks that make mac os work
@@ -136,3 +139,42 @@ publishing {
136139
}
137140
}
138141
}
142+
143+
modrinth {
144+
token = System.getenv("MODRINTH_TOKEN")
145+
projectId = "p2rxzX0q"
146+
versionNumber = "${project.version}"
147+
versionType = "release"
148+
uploadFile = remapJar
149+
gameVersions = ["${project.minecraft_version}"]
150+
loaders = ["fabric"]
151+
dependencies {
152+
//required.project "legacy-fabric-api" // Once lfapi is on modrinth (aka 'its next release')
153+
}
154+
155+
// Changelog fetching: Credit LambdAurora.
156+
// https://github.com/LambdAurora/LambDynamicLights/blob/1ef85f486084873b5d97b8a08df72f57859a3295/build.gradle#L145
157+
// License: MIT
158+
def changelogText = file('CHANGELOG.md').text
159+
def regexVersion = ((String) project.version).split("\\+")[0].replaceAll('\\.', /\\./).replaceAll('\\+', '\\+')
160+
def changelogRegex = ~"###? ${regexVersion}\\n\\n(( *- .+\\n)+)"
161+
def matcher = changelogText =~ changelogRegex
162+
163+
if (matcher.find()) {
164+
def changelogContent = matcher.group(1)
165+
166+
def changelogLines = changelogText.split('\n')
167+
def linkRefRegex = ~'^\\[([A-z0-9 _\\-/+.]+)]: '
168+
for (int i = changelogLines.length - 1; i > 0; i--) {
169+
def line = changelogLines[i]
170+
if ((line =~ linkRefRegex).find())
171+
changelogContent += '\n' + line
172+
else break
173+
}
174+
changelog = changelogContent
175+
} else {
176+
afterEvaluate {
177+
tasks.modrinth.setEnabled(false)
178+
}
179+
}
180+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx1G
77
loader_version = 0.14.9
88

99
# Mod Properties
10-
mod_version = 2.2.1+1.8.9
10+
mod_version = 2.2.2+1.8.9
1111
maven_group = io.github.axolotlclient
1212
archives_base_name = AxolotlClient
1313

src/main/java/io/github/axolotlclient/AxolotlClient.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package io.github.axolotlclient;
22

33
import com.mojang.blaze3d.platform.GlStateManager;
4+
import io.github.axolotlclient.AxolotlclientConfig.AxolotlClientConfigManager;
45
import io.github.axolotlclient.AxolotlclientConfig.ConfigManager;
6+
import io.github.axolotlclient.AxolotlclientConfig.DefaultConfigManager;
57
import io.github.axolotlclient.AxolotlclientConfig.options.BooleanOption;
8+
import io.github.axolotlclient.AxolotlclientConfig.options.Identifiable;
69
import io.github.axolotlclient.AxolotlclientConfig.options.OptionCategory;
710
import io.github.axolotlclient.config.AxolotlClientConfig;
8-
import io.github.axolotlclient.config.AxolotlClientConfigManager;
911
import io.github.axolotlclient.modules.AbstractModule;
1012
import io.github.axolotlclient.modules.ModuleLoader;
1113
import io.github.axolotlclient.modules.freelook.Freelook;
@@ -67,7 +69,15 @@ public void onInitializeClient() {
6769
CONFIG.config.addAll(CONFIG.getCategories());
6870
CONFIG.config.add(config);
6971

70-
io.github.axolotlclient.AxolotlclientConfig.AxolotlClientConfigManager.registerConfig(modid, CONFIG, configManager = new AxolotlClientConfigManager());
72+
AxolotlClientConfigManager.registerConfig(modid, CONFIG, configManager = new DefaultConfigManager(modid, FabricLoader.getInstance().getConfigDir().resolve("AxolotlClient.json"), CONFIG.config){
73+
@Override
74+
public String getName(Identifiable t) {
75+
if(super.getName(t).startsWith("axolotlclient.")){
76+
return super.getName(t).substring(14);
77+
}
78+
return super.getName(t);
79+
}
80+
});
7181

7282
modules.forEach(AbstractModule::lateInit);
7383

src/main/java/io/github/axolotlclient/config/AxolotlClientConfigManager.java

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.github.axolotlclient.mixin;
2+
3+
import io.github.axolotlclient.modules.hud.HudManager;
4+
import io.github.axolotlclient.modules.hud.gui.hud.simple.TPSHud;
5+
import net.minecraft.client.network.ClientPlayNetworkHandler;
6+
import net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11+
12+
@Mixin(ClientPlayNetworkHandler.class)
13+
public abstract class ClientPlayNetworkHandlerMixin {
14+
15+
@Inject(method = "onWorldTimeUpdate", at = @At("HEAD"))
16+
private void onWorldUpdate(WorldTimeUpdateS2CPacket packet, CallbackInfo ci) {
17+
TPSHud tpsHud = (TPSHud) HudManager.getInstance().get(TPSHud.ID);
18+
tpsHud.updateTime(packet.getTime());
19+
}
20+
21+
}

src/main/java/io/github/axolotlclient/mixin/ClientPlayerEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public abstract class ClientPlayerEntityMixin {
2626
)
2727
private boolean alwaysPressed(KeyBinding sprintKey) {
2828
ToggleSprintHud hud = (ToggleSprintHud) HudManager.getInstance().get(ToggleSprintHud.ID);
29-
return hud.sprintToggled.get() || sprintKey.isPressed();
29+
return hud.getSprintToggled().get() || sprintKey.isPressed();
3030
}
3131
}

src/main/java/io/github/axolotlclient/mixin/DebugHudMixin.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
package io.github.axolotlclient.mixin;
22

3-
import io.github.axolotlclient.modules.hud.HudManager;
4-
import io.github.axolotlclient.modules.hud.gui.hud.CrosshairHud;
53
import net.fabricmc.loader.api.FabricLoader;
64
import net.minecraft.client.ClientBrandRetriever;
75
import net.minecraft.client.gui.hud.DebugHud;
8-
import net.minecraft.client.util.Window;
96
import org.spongepowered.asm.mixin.Mixin;
107
import org.spongepowered.asm.mixin.injection.At;
11-
import org.spongepowered.asm.mixin.injection.Inject;
128
import org.spongepowered.asm.mixin.injection.Redirect;
13-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
149

1510
@Mixin(DebugHud.class)
1611
public abstract class DebugHudMixin {
1712

18-
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;pop()V"))
19-
public void onRender(Window window, CallbackInfo ci){
20-
21-
CrosshairHud hud = (CrosshairHud) HudManager.getInstance().get(CrosshairHud.ID);
22-
if(hud.isEnabled() && hud.showInF3.get()){
23-
hud.render();
24-
}
25-
}
26-
2713
@Redirect(method = "getLeftText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/ClientBrandRetriever;getClientModName()Ljava/lang/String;"))
2814
public String nicerVersionString(){
2915
if(FabricLoader.getInstance().getModContainer("axolotlclient").isPresent()) {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package io.github.axolotlclient.mixin;
2+
3+
import io.github.axolotlclient.util.Hooks;
4+
import net.minecraft.entity.Entity;
5+
import net.minecraft.util.math.MathHelper;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.Shadow;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11+
12+
@Mixin(Entity.class)
13+
public abstract class EntityMixin {
14+
15+
@Shadow public float yaw;
16+
17+
@Shadow public float pitch;
18+
19+
@Inject(method = "increaseTransforms", at = @At("HEAD"))
20+
private void updateLookDirection(float yaw, float pitch, CallbackInfo ci) {
21+
if(yaw == 0 && pitch == 0) {
22+
return;
23+
}
24+
25+
float prevPitch = this.pitch;
26+
float prevYaw = this.yaw;
27+
pitch = (float)((double)prevPitch - (double)pitch * 0.15);
28+
yaw = (float)((double)prevYaw + (double)yaw * 0.15);
29+
pitch = MathHelper.clamp(pitch, -90.0F, 90.0F);
30+
Hooks.PLAYER_DIRECTION_CHANGE.invoker().onChange(prevPitch, prevYaw, pitch, yaw);
31+
}
32+
}

0 commit comments

Comments
 (0)