Skip to content

Commit 231dc50

Browse files
committed
1.0.17
- The config screen now works in 1.21.10 - Added the option to keep Java Edition toast sounds - Changed the mod id to `console_advancement_sounds`
1 parent fc33474 commit 231dc50

18 files changed

Lines changed: 23 additions & 25 deletions

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ loader_version=0.16.14
99
loom_version=1.11-SNAPSHOT
1010

1111
# Mod Properties
12-
mod_version=1.0.16
12+
mod_version=1.0.17
1313
maven_group=standard.mod.standard
1414
archives_base_name=jimmy-smiths
1515

src/main/java/standard/mod/standard/DutchWindmills.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Map;
1616

1717
public class DutchWindmills implements ModInitializer {
18-
public static final String MOD_ID = "jimmy-smiths";
18+
public static final String MOD_ID = "console_advancement_sounds";
1919

2020
// This logger is used to write text to the console and the log file.
2121
// It is considered best practice to use your mod id as the logger's name.
@@ -31,9 +31,9 @@ public void onInitialize() {
3131
// However, some things (like resources) may still be uninitialized.
3232
// Proceed with mild caution.
3333
for (Type value : Type.values()) {
34-
T.put(value, Registry.register(BuiltInRegistries.SOUND_EVENT, ResourceLocation.parse("jimmy-smiths:advancement-sound." + value.getSerializedName()), SoundEvent.createVariableRangeEvent(ResourceLocation.parse("jimmy-smiths:advancement-sound." + value.getSerializedName()))));
34+
T.put(value, Registry.register(BuiltInRegistries.SOUND_EVENT, ResourceLocation.parse("console_advancement_sounds:advancement-sound." + value.getSerializedName()), SoundEvent.createVariableRangeEvent(ResourceLocation.parse("console_advancement_sounds:advancement-sound." + value.getSerializedName()))));
3535

36-
T2.put(value, Registry.register(BuiltInRegistries.SOUND_EVENT, ResourceLocation.parse("jimmy-smiths:advancement-sound-rare." + value.getSerializedName()), SoundEvent.createVariableRangeEvent(ResourceLocation.parse("jimmy-smiths:advancement-sound-rare." + value.getSerializedName()))));
36+
T2.put(value, Registry.register(BuiltInRegistries.SOUND_EVENT, ResourceLocation.parse("console_advancement_sounds:advancement-sound-rare." + value.getSerializedName()), SoundEvent.createVariableRangeEvent(ResourceLocation.parse("console_advancement_sounds:advancement-sound-rare." + value.getSerializedName()))));
3737
}
3838
LOGGER.info("Hello NeoForge world!");
3939
try {

src/main/java/standard/mod/standard/ModConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.nio.file.Path;
1515

1616
public class ModConfig {
17-
public Type type = Type.PLAYSTATION_4;
17+
public Type type = Type.JAVA;
1818
public static final Codec<ModConfig> CODEC = RecordCodecBuilder.create(instance -> instance.group(
1919
Type.CODEC.fieldOf("sound_platform").forGetter(a -> a.type)
2020
).apply(instance, f -> {

src/main/java/standard/mod/standard/Type.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.Locale;
77

88
public enum Type implements StringRepresentable {
9+
JAVA("Java Edition", "Java Edition"),
910
XBOX_360("Xbox 360", "X-box 360"),
1011
PLAYSTATION_5("Playstation 5", "Paystation 5"),
1112
XBOX_ONE("Xbox One", "Xbox 1"),

src/main/java/standard/mod/standard/mixin/ToastManagerMixin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
import org.spongepowered.asm.mixin.Mixin;
1111
import org.spongepowered.asm.mixin.injection.At;
1212
import standard.mod.standard.DutchWindmills;
13+
import standard.mod.standard.Type;
1314

1415
@Mixin(ToastManager.class)
1516
public class ToastManagerMixin {
1617
@WrapOperation(method =
1718
"method_61992(Lnet/minecraft/client/gui/components/toasts/Toast;)Z"
1819
,at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/toasts/Toast;getSoundEvent()Lnet/minecraft/sounds/SoundEvent;"))
1920
SoundEvent update(Toast instance, Operation<SoundEvent> original) {
21+
theIfStatement:
2022
if (instance instanceof AdvancementToast toast) {
23+
if (DutchWindmills.config.type == Type.JAVA) break theIfStatement;
2124
return (toast.getSoundEvent() != null ? DutchWindmills.T2 : DutchWindmills.T).get(DutchWindmills.config.type);
2225
}
2326
return original.call(instance);

src/main/java/standard/mod/standard/screen/ConfigScreen.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ public ConfigScreen(Screen parent) {
2626
protected void init() {
2727
super.init();
2828
boolean s;
29-
if ( Minecraft.getInstance().getGameProfile() != null) {
30-
String name1 = Minecraft.getInstance().getGameProfile().getName();
31-
s = name1 != null && (name1.toLowerCase(Locale.ROOT).equals("nicgamertv") || name1.toLowerCase(Locale.ROOT).equals("jab125"));
32-
} else {
33-
s = false;
34-
}
35-
s = s? Math.random() < 0.003 : Math.random() < 0.08;
29+
s = Math.random() < 0.01;
3630
boolean finalS = s;
3731
CycleButton.Builder<Type> type = new CycleButton.Builder<>(a -> Component.literal(finalS ? a.d2 : a.d));
3832
type.withValues(Type.values());

src/main/resources/assets/jimmy-smiths/icon.png renamed to src/main/resources/assets/console_advancement_sounds/icon.png

File renamed without changes.
File renamed without changes.

src/main/resources/assets/jimmy-smiths/sounds.json renamed to src/main/resources/assets/console_advancement_sounds/sounds.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
{
22
"advancement-sound.xbox_360": {
33
"sounds": [
4-
"jimmy-smiths:advancement-sound-x360"
4+
"console_advancement_sounds:advancement-sound-x360"
55
]
66
},
77
"advancement-sound-rare.xbox_360": {
88
"sounds": [
9-
"jimmy-smiths:advancement-sound-x360"
9+
"console_advancement_sounds:advancement-sound-x360"
1010
]
1111
},
1212
"advancement-sound.xbox_one": {
1313
"sounds": [
14-
"jimmy-smiths:advancement-sound-x1"
14+
"console_advancement_sounds:advancement-sound-x1"
1515
]
1616
},
1717
"advancement-sound-rare.xbox_one": {
1818
"sounds": [
19-
"jimmy-smiths:advancement-sound-x1-rare"
19+
"console_advancement_sounds:advancement-sound-x1-rare"
2020
]
2121
},
2222
"advancement-sound.playstation_4": {
2323
"sounds": [
24-
"jimmy-smiths:advancement-sound-ps4"
24+
"console_advancement_sounds:advancement-sound-ps4"
2525
]
2626
},
2727
"advancement-sound-rare.playstation_4": {
2828
"sounds": [
29-
"jimmy-smiths:advancement-sound-ps4"
29+
"console_advancement_sounds:advancement-sound-ps4"
3030
]
3131
},
3232
"advancement-sound.playstation_5": {
3333
"sounds": [
34-
"jimmy-smiths:advancement-sound-ps5"
34+
"console_advancement_sounds:advancement-sound-ps5"
3535
]
3636
},
3737
"advancement-sound-rare.playstation_5": {
3838
"sounds": [
39-
"jimmy-smiths:advancement-sound-ps5-rare"
39+
"console_advancement_sounds:advancement-sound-ps5-rare"
4040
]
4141
},
4242
"advancement-sound.steam": {
4343
"sounds": [
44-
"jimmy-smiths:advancement-sound-steam"
44+
"console_advancement_sounds:advancement-sound-steam"
4545
]
4646
},
4747
"advancement-sound-rare.steam": {
4848
"sounds": [
49-
"jimmy-smiths:advancement-sound-steam"
49+
"console_advancement_sounds:advancement-sound-steam-rare"
5050
]
5151
}
5252
}

src/main/resources/assets/jimmy-smiths/sounds/advancement-sound-ps4.ogg renamed to src/main/resources/assets/console_advancement_sounds/sounds/advancement-sound-ps4.ogg

File renamed without changes.

0 commit comments

Comments
 (0)