Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

Commit c28572f

Browse files
committed
[ALPHA] Port to 26.1-alpha.4
* dependency updates - Minecraft 26.1-snapshot-4 - Java 25 - fabric api 0.142.1+26.1 - fabric loader 0.18.4 - Gradle 9.3.0 - SoundCategories - fabric-loom -> net.fabricmc.fabric-loom * mappings migration - yarn -> official
1 parent 1511f67 commit c28572f

529 files changed

Lines changed: 1702 additions & 22036 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
build:
1919
strategy:
2020
matrix:
21-
java: [ 21 ]
21+
java: [ 25 ]
2222
os: [ ubuntu-latest ]
2323
runs-on: ${{ matrix.os }}
2424
steps:

build.gradle

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.google.gson.JsonParser
22
import com.google.gson.JsonPrimitive
33

44
plugins {
5-
id "fabric-loom"
5+
id 'net.fabricmc.fabric-loom'
66
id "maven-publish"
77
id 'com.palantir.git-version'
88
}
@@ -99,46 +99,28 @@ allprojects {
9999
}
100100

101101
var devLibsPaths = '**/build/devlibs/*-dev.jar'
102+
var libsPaths = '**/build/libs/*.jar'
102103
var sourcesPaths = '**/*-sources.jar'
103104

104105
dependencies {
105106
minecraft "com.mojang:minecraft:${project.minecraft_version}"
106-
mappings "net.fabricmc:yarn:${project.minecraft_version}${project.yarn_mappings}:v2"
107-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
108-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
107+
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
108+
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
109109

110110
implementation include("me.lonefelidae16:groominglib:${project.groom_version}")
111111

112112
// <editor-fold desc="Extra Sounds modules">
113113
compileOnly include(project(path: 'logics'))
114-
// 1.21 family
115-
compileOnly include(project(path: 'versioned:es1.21.9'))
116-
compileOnly include(project(path: 'versioned:es1.21.6'))
117-
compileOnly include(project(path: 'versioned:es1.21.5'))
118-
compileOnly include(project(path: 'versioned:es1.21.4'))
119-
compileOnly include(project(path: 'versioned:es1.21.2'))
120-
compileOnly include(project(path: 'versioned:es1.21'))
121-
// 1.20 family
122-
compileOnly include(project(path: 'versioned:es1.20.5'))
123-
compileOnly include(project(path: 'versioned:es1.20.2'))
124-
compileOnly include(project(path: 'versioned:es1.20'))
125-
// 1.19 family
126-
compileOnly include(project(path: 'versioned:es1.19.4'))
127-
compileOnly include(project(path: 'versioned:es1.19.3'))
128-
compileOnly include(project(path: 'versioned:es1.19.1'))
129-
compileOnly include(project(path: 'versioned:es1.19'))
130-
// 1.18 family
131-
compileOnly include(project(path: 'versioned:es1.18.2'))
132-
compileOnly include(project(path: 'versioned:es1.18'))
114+
compileOnly include(project(path: 'versioned:es26.1'))
133115
// </editor-fold>
134116

135117
// Sound Categories modules
136118
compileOnly include(project(path: 'sound-categories'))
137119

138120
// DevLaunch
139-
runtimeOnly fileTree(dir: 'logics', exclude: [sourcesPaths], include: [devLibsPaths])
140-
runtimeOnly fileTree(dir: 'versioned', exclude: [sourcesPaths], include: [devLibsPaths])
141-
runtimeOnly fileTree(dir: 'sound-categories', exclude: [sourcesPaths], include: [devLibsPaths])
121+
runtimeOnly fileTree(dir: 'logics', exclude: [sourcesPaths], include: [devLibsPaths, libsPaths])
122+
runtimeOnly fileTree(dir: 'versioned', exclude: [sourcesPaths], include: [devLibsPaths, libsPaths])
123+
runtimeOnly fileTree(dir: 'sound-categories', exclude: [sourcesPaths], include: [devLibsPaths, libsPaths])
142124
}
143125

144126
jar {
@@ -151,12 +133,6 @@ publishing {
151133
publications {
152134
mavenJava(MavenPublication) {
153135
from components.java
154-
artifact(remapJar) {
155-
builtBy remapJar
156-
}
157-
artifact(sourcesJar) {
158-
builtBy remapSourcesJar
159-
}
160136
}
161137
}
162138

gradle.properties

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ org.gradle.caching=true
55
org.gradle.configureondemand=true
66
# Fabric Properties
77
# check these on https://fabricmc.net/develop/
8-
minecraft_version=1.21.11
9-
yarn_mappings=+build.4
8+
minecraft_version=26.1-snapshot-4
109
loader_version=0.18.4
1110
loom_version=1.14-SNAPSHOT
1211
#Fabric api
13-
fabric_api_version=0.141.1+1.21.11
12+
fabric_api_version=0.142.1+26.1
1413
# Java
15-
java_lang_version=17
14+
java_lang_version=25
1615
# Mod Properties
1716
mod_version=3.0.0
1817
maven_group=dev.stashy
@@ -27,4 +26,4 @@ mod_page=https://github.com/lonefelidae16/extra-sounds/blob/dev/README.md
2726
mod_sources=https://github.com/lonefelidae16/extra-sounds
2827
mod_issues=https://github.com/lonefelidae16/extra-sounds/issues
2928
mod_license=CC0-1.0
30-
mod_support_lowest_mc=1.18
29+
mod_support_lowest_mc=26.1-alpha.1

gradle/wrapper/gradle-wrapper.jar

542 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

logics/build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom'
2+
id 'net.fabricmc.fabric-loom'
33
}
44

55
var extraSounds = project.parent
@@ -12,17 +12,12 @@ base {
1212

1313
dependencies {
1414
minecraft "com.mojang:minecraft:${extraSounds.minecraft_version}"
15-
mappings "net.fabricmc:yarn:${extraSounds.minecraft_version}${extraSounds.yarn_mappings}:v2"
16-
modImplementation "net.fabricmc:fabric-loader:${extraSounds.loader_version}"
15+
implementation "net.fabricmc:fabric-loader:${extraSounds.loader_version}"
1716

1817
implementation "me.lonefelidae16:groominglib:${extraSounds.groom_version}"
1918

20-
compileOnly project(path: ':sound-categories:shared')
19+
compileOnly project(path: ':sound-categories')
2120

2221
// Integrations
23-
modCompileOnly "maven.modrinth:midnightcontrols:${extraSounds.mn_ctrls_version}"
24-
}
25-
26-
loom {
27-
accessWidenerPath = file("src/main/resources/extrasounds.accesswidener")
28-
}
22+
compileOnly "maven.modrinth:midnightcontrols:${extraSounds.mn_ctrls_version}"
23+
}

logics/src/main/java/dev/stashy/extrasounds/logics/ExtraSounds.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import dev.stashy.extrasounds.sounds.SoundType;
77
import dev.stashy.extrasounds.sounds.Sounds;
88
import me.lonefelidae16.groominglib.api.PrefixableMessageFactory;
9-
import net.minecraft.util.Identifier;
9+
import net.minecraft.resources.Identifier;
1010
import org.apache.logging.log4j.LogManager;
1111
import org.apache.logging.log4j.Logger;
1212

@@ -46,7 +46,7 @@ public static Identifier getClickId(Identifier id, SoundType type) {
4646
)
4747
);
4848
}
49-
return Objects.requireNonNull(MAIN.generateIdentifier(ExtraSounds.MODID, "%s.%s.%s".formatted(prefix, namespace, path)));
49+
return Identifier.fromNamespaceAndPath(ExtraSounds.MODID, "%s.%s.%s".formatted(prefix, namespace, path));
5050
} catch (Exception ex) {
5151
ExtraSounds.LOGGER.error("Failed to create Click Id.", ex);
5252
}
@@ -66,6 +66,6 @@ public static Identifier generateIdentifier(String path) {
6666
}
6767

6868
public static Identifier generateIdentifier(String namespace, String path) {
69-
return MAIN.generateIdentifier(namespace, path);
69+
return Identifier.fromNamespaceAndPath(namespace, path);
7070
}
7171
}
Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
package dev.stashy.extrasounds.logics;
22

33
import dev.stashy.soundcategories.CategoryLoader;
4-
import net.minecraft.sound.SoundCategory;
4+
import net.minecraft.sounds.SoundSource;
55

66
public final class Mixers implements CategoryLoader {
77
@Register(master = true, defaultLevel = 0.33f, preview = ExtraSounds.MODID + ":item.pickup_all")
8-
public static SoundCategory MASTER;
8+
public static SoundSource MASTER;
9+
910
@Register(preview = ExtraSounds.MODID + ":item.pickup_all")
10-
public static SoundCategory INVENTORY;
11+
public static SoundSource INVENTORY;
12+
1113
@Register(preview = ExtraSounds.MODID + ":hotbar_scroll")
12-
public static SoundCategory HOTBAR;
14+
public static SoundSource HOTBAR;
15+
1316
@Register(preview = ExtraSounds.MODID + ":chat.message")
14-
public static SoundCategory CHAT;
17+
public static SoundSource CHAT;
18+
1519
@Register(preview = ExtraSounds.MODID + ":chat.mention")
16-
public static SoundCategory CHAT_MENTION;
20+
public static SoundSource CHAT_MENTION;
21+
1722
@Register(toggle = true, preview = ExtraSounds.MODID + ":keyboard.screenshot")
18-
public static SoundCategory SCREENSHOT;
23+
public static SoundSource SCREENSHOT;
24+
1925
@Register(preview = {
2026
ExtraSounds.MODID + ":effect.add.positive",
2127
ExtraSounds.MODID + ":effect.add.negative"
2228
})
23-
public static SoundCategory EFFECTS;
29+
public static SoundSource EFFECTS;
30+
2431
@Register(preview = ExtraSounds.MODID + ":keyboard.type")
25-
public static SoundCategory TYPING;
32+
public static SoundSource TYPING;
33+
2634
@Register(preview = ExtraSounds.MODID + ":action.bow")
27-
public static SoundCategory ITEM_INTR;
35+
public static SoundSource ITEM_INTR;
36+
2837
@Register(preview = {
2938
ExtraSounds.MODID + ":action.redstone_component.on",
3039
ExtraSounds.MODID + ":action.redstone_component.off"
3140
})
32-
public static SoundCategory BLOCK_INTR;
41+
public static SoundSource BLOCK_INTR;
42+
3343
@Register(defaultLevel = 0.f, preview = ExtraSounds.MODID + ":entity.poof")
34-
public static SoundCategory ENTITY;
44+
public static SoundSource ENTITY;
45+
3546
@Register(toggle = true, preview = ExtraSounds.MODID + ":item.drop")
36-
public static SoundCategory ITEM_DROP;
47+
public static SoundSource ITEM_DROP;
3748
}

logics/src/main/java/dev/stashy/extrasounds/logics/SoundManager.java

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,24 @@
44
import dev.stashy.extrasounds.logics.entry.SoundPackLoader;
55
import dev.stashy.extrasounds.logics.impl.VersionedHotbarSoundHandler;
66
import dev.stashy.extrasounds.logics.impl.state.InventoryClickState;
7+
import dev.stashy.extrasounds.logics.impl.state.SlotActionType;
78
import dev.stashy.extrasounds.logics.runtime.VersionedPositionedSoundInstanceWrapper;
89
import dev.stashy.extrasounds.logics.runtime.VersionedSoundEventWrapper;
910
import dev.stashy.extrasounds.logics.throwable.SoundNotFoundException;
1011
import dev.stashy.extrasounds.sounds.SoundType;
1112
import dev.stashy.extrasounds.sounds.Sounds;
1213
import me.lonefelidae16.groominglib.api.PrefixableMessageFactory;
13-
import net.minecraft.client.MinecraftClient;
14-
import net.minecraft.client.sound.SoundInstance;
15-
import net.minecraft.entity.player.PlayerEntity;
16-
import net.minecraft.entity.player.PlayerInventory;
17-
import net.minecraft.item.Item;
18-
import net.minecraft.item.ItemStack;
19-
import net.minecraft.item.Items;
20-
import net.minecraft.screen.ScreenHandler;
21-
import net.minecraft.screen.slot.SlotActionType;
22-
import net.minecraft.sound.SoundCategory;
23-
import net.minecraft.util.Identifier;
24-
import net.minecraft.util.math.BlockPos;
25-
import net.minecraft.util.math.MathHelper;
14+
import net.minecraft.client.Minecraft;
15+
import net.minecraft.client.resources.sounds.SoundInstance;
16+
import net.minecraft.core.BlockPos;
17+
import net.minecraft.resources.Identifier;
18+
import net.minecraft.sounds.SoundSource;
19+
import net.minecraft.util.Mth;
20+
import net.minecraft.world.entity.player.Inventory;
21+
import net.minecraft.world.entity.player.Player;
22+
import net.minecraft.world.item.Item;
23+
import net.minecraft.world.item.ItemStack;
24+
import net.minecraft.world.item.Items;
2625
import org.apache.logging.log4j.LogManager;
2726
import org.apache.logging.log4j.Logger;
2827

@@ -59,7 +58,7 @@ public SoundManager() {
5958
* @param player player instance
6059
* @param state click state
6160
*/
62-
public void handleInventorySlot(PlayerEntity player, InventoryClickState state) {
61+
public void handleInventorySlot(Player player, InventoryClickState state) {
6362
final SlotActionType actionType = state.actionType;
6463

6564
if (state.isQuickCrafting()) {
@@ -143,17 +142,17 @@ public void handleInventorySlot(PlayerEntity player, InventoryClickState state)
143142
}
144143

145144
public void hotbar(int i) {
146-
PlayerEntity player = MinecraftClient.getInstance().player;
145+
Player player = Minecraft.getInstance().player;
147146
if (player == null) {
148147
return;
149148
}
150149

151-
if (!PlayerInventory.isValidHotbarIndex(i)) {
150+
if (!Inventory.isHotbarSlot(i)) {
152151
LOGGER.error("Invalid index '{}' was passed.", i, new IndexOutOfBoundsException(i));
153152
return;
154153
}
155154

156-
ItemStack stack = player.getInventory().getStack(i);
155+
ItemStack stack = player.getInventory().getItem(i);
157156
if (stack.isEmpty()) {
158157
this.playSound(Sounds.HOTBAR_SCROLL, SoundType.HOTBAR);
159158
} else {
@@ -182,8 +181,8 @@ public void playSound(Item item, SoundType type) {
182181
* SlotActionType.QUICK_MOVE is too many method calls
183182
*
184183
* @param item Target item to quickMove
185-
* @see net.minecraft.client.network.ClientPlayerInteractionManager#clickSlot
186-
* @see ScreenHandler#internalOnSlotClick
184+
* @see net.minecraft.client.multiplayer.MultiPlayerGameMode#handleContainerInput
185+
* @see net.minecraft.world.inventory.AbstractContainerMenu#doClick
187186
*/
188187
private void handleQuickMoveSound(Item item) {
189188
if (item == Items.AIR) {
@@ -197,10 +196,10 @@ private void handleQuickMoveSound(Item item) {
197196
}
198197
}
199198

200-
public void playSound(VersionedSoundEventWrapper snd, float pitch, SoundCategory category, SoundCategory... optionalVolumes) {
199+
public void playSound(VersionedSoundEventWrapper snd, float pitch, SoundSource category, SoundSource... optionalVolumes) {
201200
float volume = ExtraSounds.MAIN.getSoundVolume(Mixers.MASTER);
202201
if (optionalVolumes != null) {
203-
for (SoundCategory cat : optionalVolumes) {
202+
for (SoundSource cat : optionalVolumes) {
204203
volume = Math.min(ExtraSounds.MAIN.getSoundVolume(cat), volume);
205204
}
206205
}
@@ -212,7 +211,7 @@ public void playSound(VersionedSoundEventWrapper snd, float pitch, SoundCategory
212211
return;
213212
}
214213
final var soundInstance = VersionedPositionedSoundInstanceWrapper.newInstance(
215-
snd.getId(), category, volume, pitch, false, 0, SoundInstance.AttenuationType.NONE,
214+
snd.getId(), category, volume, pitch, false, 0, SoundInstance.Attenuation.NONE,
216215
0.0D, 0.0D, 0.0D, true
217216
);
218217
this.playSound(Objects.requireNonNull(soundInstance));
@@ -237,7 +236,7 @@ public boolean isMuted(SoundType type) {
237236
return this.isMuted(type.category);
238237
}
239238

240-
private boolean isMuted(SoundCategory category) {
239+
private boolean isMuted(SoundSource category) {
241240
return ExtraSounds.MAIN.getSoundVolume(category) == 0;
242241
}
243242

@@ -252,11 +251,11 @@ private void playSound(SoundInstance instance) {
252251
ExtraSounds.MAIN.playSound(instance);
253252
this.lastPlayed = now;
254253
if (DebugUtils.DEBUG) {
255-
LOGGER.info("Playing sound: {}", instance.getId());
254+
LOGGER.info("Playing sound: {}", instance.getIdentifier());
256255
}
257256
} else {
258257
if (DebugUtils.DEBUG) {
259-
LOGGER.warn("Sound suppressed due to the fast interval between method calls, was '{}'.", instance.getId());
258+
LOGGER.warn("Sound suppressed due to the fast interval between method calls, was '{}'.", instance.getIdentifier());
260259
}
261260
}
262261
} catch (Exception e) {
@@ -274,28 +273,28 @@ public void playThrow(ItemStack itemStack) {
274273
* If an ItemStack is not stackable, the pitch is maximum.
275274
*
276275
* @param itemStack Target stack to adjust the pitch.
277-
* @param category {@link SoundCategory} to adjust the volume.
278-
* @see MathHelper#lerp
279-
* @see net.minecraft.client.sound.SoundSystem#play
280-
* @see net.minecraft.client.sound.SoundSystem#getAdjustedPitch
276+
* @param category {@link SoundSource} to adjust the volume.
277+
* @see Mth#lerp
278+
* @see net.minecraft.client.sounds.SoundEngine#play
279+
* @see net.minecraft.client.sounds.SoundEngine#calculatePitch
281280
*/
282-
public void playThrow(ItemStack itemStack, SoundCategory category) {
281+
public void playThrow(ItemStack itemStack, SoundSource category) {
283282
if (itemStack.isEmpty()) {
284283
return;
285284
}
286285
final float maxPitch = 2f;
287286
final float pitch = (!itemStack.isStackable()) ? maxPitch :
288-
MathHelper.lerp((itemStack.getCount() - 1f) / (itemStack.getItem().getMaxCount() - 1f), maxPitch, 1.5f);
287+
Mth.lerp((itemStack.getCount() - 1f) / (itemStack.getItem().getDefaultMaxStackSize() - 1f), maxPitch, 1.5f);
289288
this.playSound(Sounds.ITEM_DROP, pitch, category, Mixers.ITEM_DROP);
290289
}
291290

292291
public void stopSound(VersionedSoundEventWrapper e, SoundType type) {
293-
MinecraftClient.getInstance().getSoundManager().stopSounds(e.getId(), type.category);
292+
ExtraSounds.MAIN.stopSound(e, type);
294293
}
295294

296295
public VersionedSoundEventWrapper getSoundByItem(Item item, SoundType type) {
297296
var itemId = ExtraSounds.MAIN.getItemId(item);
298-
Identifier id = ExtraSounds.getClickId(itemId, type);
297+
var id = ExtraSounds.getClickId(itemId, type);
299298
VersionedSoundEventWrapper sound = SoundPackLoader.CUSTOM_SOUND_EVENT.getOrDefault(id, null);
300299
if (sound == null) {
301300
if (!this.missingSoundId.contains(id)) {

0 commit comments

Comments
 (0)