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

Commit 721fb9f

Browse files
committed
more forgotten things
1 parent c56d63f commit 721fb9f

File tree

6 files changed

+44
-19
lines changed

6 files changed

+44
-19
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ public abstract class ParticleManagerMixin {
2525

2626
private ParticleType<?> cachedType;
2727

28-
@Inject(method = "addParticle(Lnet/minecraft/particle/ParticleEffect;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/ParticleManager;addParticle(Lnet/minecraft/client/particle/Particle;)V"))
28+
@Inject(method = "addParticle(Lnet/minecraft/particle/ParticleEffect;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At(value = "HEAD"), cancellable = true)
2929
public void afterCreation(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ, CallbackInfoReturnable<Particle> cir){
3030
cachedType = parameters.getType();
31+
32+
if(!Particles.getInstance().getShowParticle(cachedType)){
33+
cir.setReturnValue(null);
34+
cir.cancel();
35+
}
3136
}
3237

3338
@Inject(method = "addParticle(Lnet/minecraft/client/particle/Particle;)V", at = @At(value = "HEAD"))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public void getReach(Entity entity, CallbackInfo ci){
3838

3939
@Inject(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;onAttacking(Lnet/minecraft/entity/Entity;)V"))
4040
public void alwaysCrit(Entity entity, CallbackInfo ci){
41-
if(((BooleanOption) Particles.getInstance().particleOptions.get(ParticleTypes.CRIT).get("alwaysCrit")).get()) {
41+
if(Particles.getInstance().getAlwaysOn(ParticleTypes.CRIT)) {
4242
MinecraftClient.getInstance().player.addCritParticles(entity);
4343
}
44-
if(((BooleanOption)Particles.getInstance().particleOptions.get(ParticleTypes.ENCHANTED_HIT).get("alwaysCrit")).get()) {
44+
if(Particles.getInstance().getAlwaysOn(ParticleTypes.ENCHANTED_HIT)) {
4545
MinecraftClient.getInstance().player.addEnchantedHitParticles(entity);
4646
}
4747
}

src/main/java/io/github/axolotlclient/modules/ModuleLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static List<AbstractModule> loadExternalModules(){
2525

2626
List<String> authors = data.contributors().stream().filter(contributor -> contributor.role().equals("Author") || contributor.role().equals("Owner")).map(ModContributor::name).collect(Collectors.toList());
2727

28-
List<String> contributors = data.contributors().stream().map(modContributor -> modContributor.name() + " (" + modContributor.role() + ")").toList();
28+
List<String> contributors = data.contributors().stream().map(ModContributor::name).filter(name -> !authors.contains(name)).toList();
2929
if (authors.isEmpty()) {
3030
data.contributors().stream().findFirst().ifPresent(modContributor -> authors.add(modContributor.name()));
3131
}
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.axolotlclient.modules.hud.gui.hud;
22

3-
import io.github.axolotlclient.AxolotlclientConfig.options.BooleanOption;
43
import io.github.axolotlclient.AxolotlclientConfig.options.OptionBase;
4+
import io.github.axolotlclient.AxolotlclientConfig.options.StringOption;
55
import net.minecraft.util.Identifier;
66

77
import java.text.SimpleDateFormat;
@@ -10,14 +10,12 @@
1010

1111
public class RealTimeHud extends CleanHudEntry{
1212

13-
private Date date = new Date();
14-
private final SimpleDateFormat dateFormatSeconds = new SimpleDateFormat("kk:mm:ss");
15-
private final SimpleDateFormat dateFormat = new SimpleDateFormat("kk:mm");
13+
private final Date date = new Date();
14+
private final StringOption dateFormat = new StringOption("format", "HH:mm");
15+
private SimpleDateFormat format = new SimpleDateFormat("HH:mm");
1616

1717
private int second = 0;
1818

19-
protected BooleanOption showSeconds = new BooleanOption("showSeconds", false);
20-
2119
public static Identifier ID = new Identifier("realtimehud");
2220

2321
@Override
@@ -27,7 +25,7 @@ public Identifier getId() {
2725

2826
@Override
2927
public String getValue() {
30-
return showSeconds.get()?dateFormatSeconds.format(date):dateFormat.format(date);
28+
return format.format(date);
3129
}
3230

3331
@Override
@@ -38,7 +36,7 @@ public String getPlaceholder() {
3836
@Override
3937
public void addConfigOptions(List<OptionBase<?>> options) {
4038
super.addConfigOptions(options);
41-
options.add(showSeconds);
39+
options.add(dateFormat);
4240
}
4341

4442
@Override
@@ -49,8 +47,16 @@ public boolean tickable() {
4947
@Override
5048
public void tick() {
5149
if(second>=20){
52-
date = new Date();
50+
date.setTime(System.currentTimeMillis());
5351
second=0;
5452
} else second++;
53+
54+
if(!format.toPattern().equals(dateFormat.get()) && dateFormat.get() != null){
55+
try {
56+
format = new SimpleDateFormat(dateFormat.get());
57+
} catch (IllegalArgumentException e){
58+
dateFormat.set(dateFormat.get().substring(0, dateFormat.get().length()-1));
59+
}
60+
}
5561
}
5662
}

src/main/java/io/github/axolotlclient/modules/particles/Particles.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ private void addParticleOptions(){
5050
OptionCategory category = new OptionCategory(Arrays.stream(Registry.PARTICLE_TYPE.getId(type).getPath().split("_")).map(StringUtils::capitalize).collect(Collectors.joining(" ")), false);
5151
HashMap<String, OptionBase<?>> optionsByKey = new LinkedHashMap<>();
5252

53+
populateMap(optionsByKey,
54+
new BooleanOption("showParticle", true),
55+
new IntegerOption("count", 1, 1, 20),
56+
new BooleanOption("customColor", false),
57+
new ColorOption("color", "particles", Color.WHITE));
58+
5359
if(type == ParticleTypes.CRIT || type == ParticleTypes.ENCHANTED_HIT){
5460
populateMap(optionsByKey, new BooleanOption("alwaysCrit", false));
5561
}
5662

57-
populateMap(optionsByKey,
58-
new IntegerOption("count", 1, 1, 20),
59-
new BooleanOption("customColor", false),
60-
new ColorOption("color", "particles", Color.WHITE));
61-
6263
category.add(optionsByKey.values());
6364
particleOptions.put(type, optionsByKey);
6465

@@ -94,6 +95,14 @@ public int getMultiplier(ParticleType<?> type) {
9495
return 1;
9596
}
9697

98+
public boolean getAlwaysOn(ParticleType<?> type){
99+
return enabled.get() && ((BooleanOption)Particles.getInstance().particleOptions.get(type).get("alwaysCrit")).get();
100+
}
101+
102+
public boolean getShowParticle(ParticleType<?> type){
103+
return enabled.get() ? ((BooleanOption)Particles.getInstance().particleOptions.get(type).get("showParticle")).get() : true;
104+
}
105+
97106
protected static class AlphabeticalComparator implements Comparator<ParticleType<?>> {
98107

99108
// Function to compare

src/main/resources/assets/axolotlclient/lang/en_us.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"inverse": "Inverse",
7979
"tnttime": "TntTime",
8080
"particles": "Particles",
81+
"showParticle": "Show Particle",
8182
"customColor": "Custom Color",
8283
"customColor.tooltip": "Whether to use a custom color for this Particle.",
8384
"particles.color.tooltip": "The color of the particle. <br>Needs \"Custom Color\" enabled.",
@@ -180,7 +181,7 @@
180181
"itemupdatehud": "Item Update HUD",
181182
"packdisplayhud": "Pack Display HUD",
182183
"realtimehud": "Real Time HUD",
183-
"showSeconds": "Show Seconds",
184+
"format": "Format",
184185
"timeout": "Timeout",
185186
"text": "Text",
186187
"bar": "Bar",
@@ -245,6 +246,9 @@
245246
"outline": "Outline",
246247
"outlineColor": "Outline Color",
247248
"shadow": "Shadow",
249+
"center": "Center",
250+
"left": "Left",
251+
"right": "Rgith",
248252

249253
"rpc": "Discord RPC",
250254
"showActivity": "Show Activity",
@@ -267,6 +271,7 @@
267271
"creditsBGM": "BGM",
268272
"contributors": "Contributors",
269273
"other_people": "Other People",
274+
"external_modules": "External Modules",
270275

271276
"pickColor": "Pick Color",
272277
"currentColor": "Current",

0 commit comments

Comments
 (0)