Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 3e569c8

Browse files
committed
TntTime
(and some other things)
1 parent ad76e66 commit 3e569c8

File tree

10 files changed

+345
-162
lines changed

10 files changed

+345
-162
lines changed

build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'maven-publish'
33
id 'io.github.juuxel.loom-quiltflower' version '1.7.+' // For loom 0.8-0.9, 0.11+
4-
id 'fabric-loom' version '0.12.+'
4+
id 'fabric-loom' version '0.13.+'
55
}
66

77
archivesBaseName = project.archives_base_name
@@ -37,9 +37,6 @@ dependencies {
3737

3838
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
3939

40-
//modImplementation "org.quiltmc:quilt-loader:${project.loader_version}"
41-
//modImplementation "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${quilted_fabric_api_version}-${minecraft_version}"
42-
4340
modImplementation "com.terraformersmc:modmenu:1.16.23"
4441

4542
include( implementation('com.github.JnCrMx:discord-game-sdk4j:0.5.5'))

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ org.gradle.parallel = true
55
# Dependencies
66
minecraft_version = 1.16_combat-6
77
yarn_mappings=1.16_combat-6+build.2
8-
loader_version = 0.14.8
8+
loader_version = 0.14.9
99

1010
#Fabric api
1111
fabric_version=0.42.0+1.16
1212

1313
# Mod Properties
14-
version = 2.1.6+1.16_combat-6
14+
version = 2.1.7+1.16_combat-6
1515
maven_group = io.github.axolotlclient
1616
archives_base_name = AxolotlClient
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import io.github.axolotlclient.modules.motionblur.MotionBlur;
1515
import io.github.axolotlclient.modules.rpc.DiscordRPC;
1616
import io.github.axolotlclient.modules.scrollableTooltips.ScrollableTooltips;
17+
import io.github.axolotlclient.modules.tnttime.TntTime;
1718
import io.github.axolotlclient.modules.zoom.Zoom;
1819
import io.github.axolotlclient.util.Util;
1920
import net.fabricmc.api.ClientModInitializer;
@@ -113,6 +114,7 @@ public static void getModules(){
113114
modules.put(ScrollableTooltips.ID, ScrollableTooltips.Instance);
114115
modules.put(DiscordRPC.ID, DiscordRPC.getInstance());
115116
modules.put(Freelook.ID, Freelook.INSTANCE);
117+
modules.put(TntTime.ID, TntTime.Instance);
116118
}
117119

118120
public static boolean isUsingClient(UUID uuid){
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.modules.tnttime.TntTime;
4+
import net.minecraft.client.render.VertexConsumerProvider;
5+
import net.minecraft.client.render.entity.EntityRenderDispatcher;
6+
import net.minecraft.client.render.entity.EntityRenderer;
7+
import net.minecraft.client.render.entity.TntEntityRenderer;
8+
import net.minecraft.client.util.math.MatrixStack;
9+
import net.minecraft.entity.TntEntity;
10+
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.injection.At;
12+
import org.spongepowered.asm.mixin.injection.Inject;
13+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14+
15+
@Mixin(TntEntityRenderer.class)
16+
public abstract class MixinTntEntityRenderer extends EntityRenderer<TntEntity> {
17+
18+
protected MixinTntEntityRenderer(EntityRenderDispatcher entityRenderDispatcher) {
19+
super(entityRenderDispatcher);
20+
}
21+
22+
@Inject(method = "render(Lnet/minecraft/entity/TntEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V",
23+
at = @At(value = "INVOKE",
24+
target = "Lnet/minecraft/client/render/entity/EntityRenderer;render(Lnet/minecraft/entity/Entity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V"),
25+
cancellable = true)
26+
public void render(TntEntity entity, float yaw, float delta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, CallbackInfo ci){
27+
if(TntTime.Instance.enabled.get()) {
28+
super.renderLabelIfPresent(entity, TntTime.Instance.getFuseTime(entity.getFuseTimer()), matrixStack, vertexConsumerProvider, light);
29+
ci.cancel();
30+
}
31+
}
32+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package io.github.axolotlclient.modules.tnttime;
2+
3+
import io.github.axolotlclient.AxolotlClient;
4+
import io.github.axolotlclient.config.options.BooleanOption;
5+
import io.github.axolotlclient.config.options.IntegerOption;
6+
import io.github.axolotlclient.config.options.OptionCategory;
7+
import io.github.axolotlclient.modules.AbstractModule;
8+
import net.minecraft.text.Style;
9+
import net.minecraft.text.Text;
10+
import net.minecraft.util.Formatting;
11+
import net.minecraft.util.Identifier;
12+
13+
import java.text.DecimalFormat;
14+
15+
public class TntTime extends AbstractModule {
16+
17+
public static Identifier ID = new Identifier("tnttime");
18+
public static TntTime Instance = new TntTime();
19+
20+
private DecimalFormat format;
21+
private int decimals;
22+
23+
private final OptionCategory category = new OptionCategory("tnttime");
24+
public final BooleanOption enabled = new BooleanOption("enabled", false);
25+
private final IntegerOption decimalPlaces = new IntegerOption("decimalplaces", 2, 0, 6);
26+
27+
@Override
28+
public void init() {
29+
category.add(enabled, decimalPlaces);
30+
AxolotlClient.CONFIG.rendering.addSubCategory(category);
31+
}
32+
33+
@Override
34+
public void tick() {
35+
if(decimalPlaces.get() != decimals){
36+
StringBuilder string = new StringBuilder("#0");
37+
if (decimalPlaces.get() > 0) {
38+
string.append(".");
39+
for(int i=0;i<decimalPlaces.get();i++){
40+
string.append("0");
41+
}
42+
}
43+
format = new DecimalFormat(string.toString());
44+
decimals = decimalPlaces.get();
45+
}
46+
}
47+
48+
public Text getFuseTime(int time){
49+
float secs = time/20F;
50+
return Text.of(String.valueOf(format.format(secs))).copy().setStyle(Style.EMPTY.withColor(getCurrentColor(secs)));
51+
}
52+
53+
private Formatting getCurrentColor(float seconds){
54+
if (seconds > 7d) {
55+
return Formatting.DARK_AQUA;
56+
} else if (seconds > 6d) {
57+
return Formatting.AQUA;
58+
} else if (seconds > 4d) {
59+
return Formatting.DARK_GREEN;
60+
} else if (seconds > 3d) {
61+
return Formatting.GREEN;
62+
} else if (seconds > 2d) {
63+
return Formatting.GOLD;
64+
} else if (seconds > 1d) {
65+
return Formatting.RED;
66+
} else if (seconds > 0d) {
67+
return Formatting.DARK_RED;
68+
} else {
69+
return Formatting.WHITE;
70+
}
71+
}
72+
}

src/main/resources/assets/axolotlclient/lang/de_DE.lang

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)