Skip to content

Commit 2c1bee5

Browse files
committed
chore: update deps
1 parent 2175512 commit 2c1bee5

File tree

16 files changed

+69
-61
lines changed

16 files changed

+69
-61
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

build.gradle

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.4-SNAPSHOT'
2+
id 'fabric-loom' version '1.7-SNAPSHOT'
33
id 'maven-publish'
44
}
55

@@ -20,6 +20,18 @@ repositories {
2020
maven { url "https://maven.shedaniel.me/" }
2121
}
2222

23+
loom {
24+
splitEnvironmentSourceSets()
25+
26+
mods {
27+
"notebetterfabric" {
28+
sourceSet sourceSets.main
29+
sourceSet sourceSets.client
30+
}
31+
}
32+
33+
}
34+
2335
dependencies {
2436
// To change the versions see the gradle.properties file
2537
minecraft "com.mojang:minecraft:${project.minecraft_version}"
@@ -29,11 +41,6 @@ dependencies {
2941
// Fabric API. This is technically optional, but you probably want it anyway.
3042
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
3143

32-
// Uncomment the following line to enable the deprecated Fabric API modules.
33-
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
34-
35-
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
36-
3744
//* Cloth Config https://www.curseforge.com/minecraft/mc-mods/cloth-config
3845
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}") {
3946
exclude(group: "net.fabricmc.fabric-api")
@@ -71,7 +78,8 @@ jar {
7178
// configure the maven publication
7279
publishing {
7380
publications {
74-
mavenJava(MavenPublication) {
81+
create("mavenJava", MavenPublication) {
82+
artifactId = project.archives_base_name
7583
from components.java
7684
}
7785
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ org.gradle.parallel=true
66
# check these on https://fabricmc.net/develop
77
minecraft_version=1.19.4
88
yarn_mappings=1.19.4+build.2
9-
loader_version=0.14.22
9+
loader_version=0.16.3
1010

1111
# Mod Properties
1212
mod_version=1.0
1313
maven_group=com.gmail.gorayan3838
1414
archives_base_name=NoteBetterFabric
1515

1616
# Dependencies
17-
fabric_version=0.87.0+1.19.4
17+
fabric_version=0.87.2+1.19.4
1818
#* check this on https://www.curseforge.com/minecraft/mc-mods/cloth-config/files
1919
cloth_version=10.1.105

gradle/wrapper/gradle-wrapper.jar

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

gradlew

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum
@@ -145,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145148
case $MAX_FD in #(
146149
max*)
147150
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
151+
# shellcheck disable=SC2039,SC3045
149152
MAX_FD=$( ulimit -H -n ) ||
150153
warn "Could not query maximum file descriptor limit"
151154
esac
152155
case $MAX_FD in #(
153156
'' | soft) :;; #(
154157
*)
155158
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
159+
# shellcheck disable=SC2039,SC3045
157160
ulimit -n "$MAX_FD" ||
158161
warn "Could not set maximum file descriptor limit to $MAX_FD"
159162
esac
@@ -202,11 +205,11 @@ fi
202205
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203206
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204207

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
208+
# Collect all arguments for the java command:
209+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210+
# and any embedded shellness will be escaped.
211+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212+
# treated as '${Hostname}' itself on the command line.
210213

211214
set -- \
212215
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

src/main/java/com/gmail/gorayan3838/notebetterfabric/NoteBetterFabric.java renamed to src/client/java/com/gmail/gorayan3838/notebetterfabric/client/NoteBetterFabricClient.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
package com.gmail.gorayan3838.notebetterfabric;
1+
package com.gmail.gorayan3838.notebetterfabric.client;
22

33
import com.gmail.gorayan3838.notebetterfabric.config.SoundConfig;
4-
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
54
import me.shedaniel.autoconfig.AutoConfig;
65
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
7-
import net.fabricmc.api.ModInitializer;
8-
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
9-
import net.minecraft.server.command.CommandManager;
6+
import net.fabricmc.api.ClientModInitializer;
7+
import net.fabricmc.api.EnvType;
8+
import net.fabricmc.api.Environment;
9+
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
10+
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
1011
import net.minecraft.text.Text;
1112

12-
public class NoteBetterFabric implements ModInitializer {
13+
@Environment(EnvType.CLIENT)
14+
public class NoteBetterFabricClient implements ClientModInitializer {
1315

1416
public static final String modID = "notebetterfabric";
1517

1618
public static SoundConfig CONFIG;
1719

1820
@Override
19-
public void onInitialize() {
21+
public void onInitializeClient() {
2022
AutoConfig.register(SoundConfig.class, GsonConfigSerializer::new);
2123
CONFIG = AutoConfig.getConfigHolder(SoundConfig.class).get();
2224
registerCommand();
2325
}
2426

2527
public void registerCommand() {
26-
CommandRegistrationCallback.EVENT.register((dispatcher, b) -> {
27-
LiteralArgumentBuilder builder = CommandManager.literal("notebetter")
28+
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
29+
var builder = ClientCommandManager.literal("notebetter")
2830
.requires(serverCommandSource -> serverCommandSource.hasPermissionLevel(2))
29-
.then(CommandManager.literal("reload")
31+
.then(ClientCommandManager.literal("reload")
3032
.executes(context -> {
3133
AutoConfig.getConfigHolder(SoundConfig.class).load();
3234
CONFIG = AutoConfig.getConfigHolder(SoundConfig.class).get();
33-
context.getSource().sendFeedback(Text.translatable("commands.notebetterfabric.reload.success"), true);
35+
context.getSource().sendFeedback(Text.translatable("commands.notebetterfabric.reload.success"));
3436
return 1;
3537
})
3638
);

src/main/java/com/gmail/gorayan3838/notebetterfabric/config/SoundConfig.java renamed to src/client/java/com/gmail/gorayan3838/notebetterfabric/config/SoundConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.gmail.gorayan3838.notebetterfabric.config;
22

3-
import com.gmail.gorayan3838.notebetterfabric.NoteBetterFabric;
3+
import com.gmail.gorayan3838.notebetterfabric.client.NoteBetterFabricClient;
44
import me.shedaniel.autoconfig.ConfigData;
55
import me.shedaniel.autoconfig.annotation.Config;
66
import me.shedaniel.autoconfig.annotation.ConfigEntry;
77

8-
@Config(name = NoteBetterFabric.modID)
8+
@Config(name = NoteBetterFabricClient.modID)
99
public class SoundConfig implements ConfigData {
1010

1111
@ConfigEntry.Gui.CollapsibleObject

src/main/java/com/gmail/gorayan3838/notebetterfabric/mixin/NoteBlockMixin.java renamed to src/client/java/com/gmail/gorayan3838/notebetterfabric/mixin/NoteBlockMixin.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package com.gmail.gorayan3838.notebetterfabric.mixin;
22

3-
import com.gmail.gorayan3838.notebetterfabric.NoteBetterFabric;
3+
import com.gmail.gorayan3838.notebetterfabric.client.NoteBetterFabricClient;
44
import com.gmail.gorayan3838.notebetterfabric.config.SoundConfig;
5-
import net.minecraft.block.Block;
65
import net.minecraft.block.NoteBlock;
76
import net.minecraft.entity.player.PlayerEntity;
87
import net.minecraft.registry.entry.RegistryEntry;
@@ -26,7 +25,7 @@ public class NoteBlockMixin {
2625
@Redirect(method = "onSyncedBlockEvent", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;playSound(Lnet/minecraft/entity/player/PlayerEntity;DDDLnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/sound/SoundCategory;FFJ)V"))
2726
private void injected(World world, @Nullable PlayerEntity player, double x, double y, double z, RegistryEntry<SoundEvent> sound, SoundCategory category, float volume, float pitch, long seed) {
2827
BlockPos pos = new BlockPos((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
29-
SoundConfig.Mapping[] mappings = NoteBetterFabric.CONFIG.getMappings();
28+
SoundConfig.Mapping[] mappings = NoteBetterFabricClient.CONFIG.getMappings();
3029
List<SoundConfig.Mapping> filteredMappings = Arrays.stream(mappings)
3130
.filter(mapping -> world.getBlockState(pos.down()).getBlock().equals(Registries.BLOCK.get(new Identifier(mapping.getBlock()))))
3231
.toList();

0 commit comments

Comments
 (0)