Skip to content

Commit 0249ed1

Browse files
committed
[RC] Port to 1.21.8-rc1
* update dependencies - yarn mappings 1.21.8-rc1+build.2 - fabric loader 0.16.14 - fabric api 0.129.0+1.21.8 - Gradle 8.14.3 - SoundCategories * new sounds - Happy Ghast's harnesses - Dried Ghast * new module - `:versioned:es1.21.6` * into versioned module - getSoundVolume in `logics.SoundManager`
1 parent 5a66bfe commit 0249ed1

61 files changed

Lines changed: 1597 additions & 45 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.

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ dependencies {
102102
// <editor-fold desc="Extra Sounds modules">
103103
compileOnly include(project(path: 'logics'))
104104
// 1.21 family
105+
// compileOnly include(project(path: 'versioned:es1.21.9'))
106+
compileOnly include(project(path: 'versioned:es1.21.6'))
105107
compileOnly include(project(path: 'versioned:es1.21.5'))
106108
compileOnly include(project(path: 'versioned:es1.21.4'))
107109
compileOnly include(project(path: 'versioned:es1.21.2'))

gradle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ org.gradle.jvmargs=-Xmx4G
33
org.gradle.parallel=true
44
# Fabric Properties
55
# check these on https://fabricmc.net/develop/
6-
minecraft_version=1.21.5
7-
yarn_mappings=+build.1
8-
loader_version=0.16.10
6+
minecraft_version=1.21.8-rc1
7+
yarn_mappings=+build.2
8+
loader_version=0.16.14
9+
loom_version=1.11-SNAPSHOT
910
#Fabric api
10-
fabric_api_version=0.119.5+1.21.5
11+
fabric_api_version=0.129.0+1.21.8
1112
# Java
1213
java_lang_version=17
1314
# Mod Properties

gradle/wrapper/gradle-wrapper.jar

59 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-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ private void handleQuickMoveSound(Item item) {
198198
}
199199

200200
public void playSound(VersionedSoundEventWrapper snd, float pitch, SoundCategory category, SoundCategory... optionalVolumes) {
201-
float volume = this.getSoundVolume(Mixers.MASTER);
201+
float volume = ExtraSounds.MAIN.getSoundVolume(Mixers.MASTER);
202202
if (optionalVolumes != null) {
203203
for (SoundCategory cat : optionalVolumes) {
204-
volume = Math.min(this.getSoundVolume(cat), volume);
204+
volume = Math.min(ExtraSounds.MAIN.getSoundVolume(cat), volume);
205205
}
206206
}
207207
if (volume == 0 || this.isMuted(category)) {
@@ -219,7 +219,7 @@ public void playSound(VersionedSoundEventWrapper snd, float pitch, SoundCategory
219219
}
220220

221221
public void playSound(VersionedSoundEventWrapper snd, SoundType type, float volume, float pitch, BlockPos position) {
222-
volume *= this.getSoundVolume(Mixers.MASTER);
222+
volume *= ExtraSounds.MAIN.getSoundVolume(Mixers.MASTER);
223223
if (volume == 0 || this.isMuted(type.category)) {
224224
// skip reflection when volume is zero.
225225
if (DebugUtils.DEBUG) {
@@ -238,7 +238,7 @@ public boolean isMuted(SoundType type) {
238238
}
239239

240240
private boolean isMuted(SoundCategory category) {
241-
return this.getSoundVolume(category) == 0;
241+
return ExtraSounds.MAIN.getSoundVolume(category) == 0;
242242
}
243243

244244
private void logZeroVolume(VersionedSoundEventWrapper snd) {
@@ -293,10 +293,6 @@ public void stopSound(VersionedSoundEventWrapper e, SoundType type) {
293293
MinecraftClient.getInstance().getSoundManager().stopSounds(e.getId(), type.category);
294294
}
295295

296-
private float getSoundVolume(SoundCategory category) {
297-
return MinecraftClient.getInstance().options.getSoundVolume(category);
298-
}
299-
300296
public VersionedSoundEventWrapper getSoundByItem(Item item, SoundType type) {
301297
var itemId = ExtraSounds.MAIN.getItemId(item);
302298
Identifier id = ExtraSounds.getClickId(itemId, type);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.minecraft.item.Item;
1111
import net.minecraft.item.ItemStack;
1212
import net.minecraft.item.Items;
13+
import net.minecraft.sound.SoundCategory;
1314
import net.minecraft.util.Identifier;
1415
import net.minecraft.util.collection.IndexedIterable;
1516

@@ -51,4 +52,6 @@ public static VersionedMain newInstance() {
5152
public abstract void playSound(SoundInstance instance);
5253

5354
public abstract boolean shouldIgnoreItemSound(Item cursorItem, Item slotItem, InventoryClickState state);
55+
56+
public abstract float getSoundVolume(SoundCategory soundCategory);
5457
}

logics/src/main/java/dev/stashy/extrasounds/logics/entry/BaseVanillaGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ private boolean isBrickItem(Item item) {
4444

4545
private boolean isGearGoldenItem(Item item) {
4646
return item instanceof CompassItem ||
47-
item instanceof SpyglassItem || item instanceof ShearsItem;
47+
item instanceof SpyglassItem || item instanceof ShearsItem ||
48+
this.getItemIdPath(item).endsWith("_harness");
4849
}
4950

5051
private boolean isGearLeatherItem(Item item) {

logics/src/main/java/dev/stashy/extrasounds/logics/entry/SoundPackLoader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import net.minecraft.util.Identifier;
2626
import org.apache.logging.log4j.LogManager;
2727
import org.apache.logging.log4j.Logger;
28+
import org.jetbrains.annotations.NotNull;
2829

2930
import java.io.*;
3031
import java.nio.file.Files;
@@ -78,7 +79,7 @@ public static void init() {
7879
try {
7980
namespace = container.getProvider().getMetadata().getId();
8081
if (namespace == null || namespace.isBlank()) {
81-
throw new Exception("namespace is invalid: %s".formatted(namespace));
82+
throw new Exception("namespace is invalid: null or blank");
8283
}
8384
} catch (Exception ex) {
8485
LOGGER.error("Failed to read mod metadata, ignoring.", ex);
@@ -267,6 +268,7 @@ public boolean equals(Object obj) {
267268
}
268269

269270
@Override
271+
@NotNull
270272
public String toString() {
271273
final CharSequence[] data = new CharSequence[]{
272274
String.valueOf(version), String.valueOf(itemCount), String.join(DELIMITER_MOD_INFO, modInfo)

0 commit comments

Comments
 (0)