summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--build.gradle5
-rw-r--r--gradle.properties18
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin59536 -> 61574 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties3
-rwxr-xr-xgradlew28
-rw-r--r--gradlew.bat181
-rw-r--r--src/main/java/ganarchy/chewstuff/ChewComponent.java6
-rw-r--r--src/main/java/ganarchy/chewstuff/ChewStuff.java38
-rw-r--r--src/main/java/ganarchy/chewstuff/ChewableItem.java9
-rw-r--r--src/main/resources/fabric.mod.json4
10 files changed, 156 insertions, 136 deletions
diff --git a/build.gradle b/build.gradle
index c7be481..63b4b02 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
 plugins {
-	id 'fabric-loom' version '0.12-SNAPSHOT'
+	id 'fabric-loom' version '1.1-SNAPSHOT'
 	id 'maven-publish'
 }
 
@@ -42,6 +42,9 @@ dependencies {
 		exclude group: "com.terraformersmc"
 	}
 
+	modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardcomp_version}"
+	modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cardcomp_version}"
+
 	// Uncomment the following line to enable the deprecated Fabric API modules. 
 	// 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.
 
diff --git a/gradle.properties b/gradle.properties
index b84bf3a..74a79f7 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,17 +1,19 @@
 # Done to increase the memory available to gradle.
 org.gradle.jvmargs=-Xmx1G
+org.gradle.parallel=true
 
 # Fabric Properties
 	# check these on https://fabricmc.net/develop
-	minecraft_version=1.19.2
-	yarn_mappings=1.19.2+build.3
-	loader_version=0.14.9
+	minecraft_version=1.20
+	yarn_mappings=1.20+build.1
+	loader_version=0.14.21
 
 # Mod Properties
-	mod_version = 1.0.0
-	maven_group = ganarchy.chewstuff.mc_1_19_2
-	archives_base_name = chewstuff-mc1.19.2
+	mod_version = 1.0.1+1.20
+	maven_group = ganarchy.chewstuff
+	archives_base_name = chewstuff
 
 # Dependencies
-	fabric_version=0.59.0+1.19.2
-	trinkets_version=3.4.0
+	fabric_version=0.83.0+1.20
+	trinkets_version=3.7.0
+	cardcomp_version=5.2.0
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 7454180..943f0cb 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differdiff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 41dfb87..f398c33 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+networkTimeout=10000
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index c53aefa..65dcd68 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015-2021 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
 #         * functions;
-#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-#         * compound commands having a testable exit status, especially «case»;
-#         * various built-in commands including «command», «set», and «ulimit».
+#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+#         * compound commands having a testable exit status, especially «case»;
+#         * various built-in commands including «command», «set», and «ulimit».
 #
 #   Important for patching:
 #
@@ -55,7 +55,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
     esac
 done
 
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
 APP_BASE_NAME=${0##*/}
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
 
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
 if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
     case $MAX_FD in #(
       max*)
+        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+        # shellcheck disable=SC3045 
         MAX_FD=$( ulimit -H -n ) ||
             warn "Could not query maximum file descriptor limit"
     esac
     case $MAX_FD in  #(
       '' | soft) :;; #(
       *)
+        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+        # shellcheck disable=SC3045 
         ulimit -n "$MAX_FD" ||
             warn "Could not set maximum file descriptor limit to $MAX_FD"
     esac
@@ -205,6 +209,12 @@ set -- \
         org.gradle.wrapper.GradleWrapperMain \
         "$@"
 
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+    die "xargs is not available"
+fi
+
 # Use "xargs" to parse quoted args.
 #
 # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
diff --git a/gradlew.bat b/gradlew.bat
index 107acd3..6689b85 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,89 +1,92 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem      https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem  Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem

+@rem Copyright 2015 the original author or authors.

+@rem

+@rem Licensed under the Apache License, Version 2.0 (the "License");

+@rem you may not use this file except in compliance with the License.

+@rem You may obtain a copy of the License at

+@rem

+@rem      https://www.apache.org/licenses/LICENSE-2.0

+@rem

+@rem Unless required by applicable law or agreed to in writing, software

+@rem distributed under the License is distributed on an "AS IS" BASIS,

+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+@rem See the License for the specific language governing permissions and

+@rem limitations under the License.

+@rem

+

+@if "%DEBUG%"=="" @echo off

+@rem ##########################################################################

+@rem

+@rem  Gradle startup script for Windows

+@rem

+@rem ##########################################################################

+

+@rem Set local scope for the variables with windows NT shell

+if "%OS%"=="Windows_NT" setlocal

+

+set DIRNAME=%~dp0

+if "%DIRNAME%"=="" set DIRNAME=.

+@rem This is normally unused

+set APP_BASE_NAME=%~n0

+set APP_HOME=%DIRNAME%

+

+@rem Resolve any "." and ".." in APP_HOME to make it shorter.

+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

+

+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.

+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

+

+@rem Find java.exe

+if defined JAVA_HOME goto findJavaFromJavaHome

+

+set JAVA_EXE=java.exe

+%JAVA_EXE% -version >NUL 2>&1

+if %ERRORLEVEL% equ 0 goto execute

+

+echo.

+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:findJavaFromJavaHome

+set JAVA_HOME=%JAVA_HOME:"=%

+set JAVA_EXE=%JAVA_HOME%/bin/java.exe

+

+if exist "%JAVA_EXE%" goto execute

+

+echo.

+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:execute

+@rem Setup the command line

+

+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

+

+

+@rem Execute Gradle

+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

+

+:end

+@rem End local scope for the variables with windows NT shell

+if %ERRORLEVEL% equ 0 goto mainEnd

+

+:fail

+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

+rem the _cmd.exe /c_ return code!

+set EXIT_CODE=%ERRORLEVEL%

+if %EXIT_CODE% equ 0 set EXIT_CODE=1

+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

+exit /b %EXIT_CODE%

+

+:mainEnd

+if "%OS%"=="Windows_NT" endlocal

+

+:omega

diff --git a/src/main/java/ganarchy/chewstuff/ChewComponent.java b/src/main/java/ganarchy/chewstuff/ChewComponent.java
index 4b6dcd8..aefa539 100644
--- a/src/main/java/ganarchy/chewstuff/ChewComponent.java
+++ b/src/main/java/ganarchy/chewstuff/ChewComponent.java
@@ -6,7 +6,7 @@ import dev.onyxstudios.cca.api.v3.component.ComponentV3;
 import net.minecraft.entity.effect.StatusEffect;
 import net.minecraft.nbt.NbtCompound;
 import net.minecraft.nbt.NbtOps;
-import net.minecraft.util.registry.Registry;
+import net.minecraft.registry.Registries;
 
 import java.util.*;
 
@@ -20,10 +20,10 @@ public class ChewComponent implements ComponentV3 {
     public static final Codec<ChewComponent> CODEC = RecordCodecBuilder.create(
         inst -> inst.group(
             Codec.unboundedMap(
-                Registry.STATUS_EFFECT.getCodec(), Codec.INT
+                Registries.STATUS_EFFECT.getCodec(), Codec.INT
             ).fieldOf("effects").forGetter(i -> i.effects),
             Codec.list(
-                Registry.STATUS_EFFECT.getCodec()
+                Registries.STATUS_EFFECT.getCodec()
             ).fieldOf("applied").forGetter(i -> new ArrayList<>(i.applied)),
             Codec.BOOL.fieldOf("sendUpdate").forGetter(i -> i.sendUpdate)
         ).apply(inst, ChewComponent::new)
diff --git a/src/main/java/ganarchy/chewstuff/ChewStuff.java b/src/main/java/ganarchy/chewstuff/ChewStuff.java
index 7bea0ec..ee035f3 100644
--- a/src/main/java/ganarchy/chewstuff/ChewStuff.java
+++ b/src/main/java/ganarchy/chewstuff/ChewStuff.java
@@ -1,10 +1,12 @@
 package ganarchy.chewstuff;
 
 import net.fabricmc.api.ModInitializer;
+import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
 import net.minecraft.item.Item;
-import net.minecraft.item.ItemGroup;
+import net.minecraft.item.ItemGroups;
+import net.minecraft.registry.Registries;
+import net.minecraft.registry.Registry;
 import net.minecraft.util.Identifier;
-import net.minecraft.util.registry.Registry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -22,7 +24,7 @@ public class ChewStuff implements ModInitializer {
      * chews.
      */
     public static final Item SILICONE = new Item(
-        new Item.Settings().group(ItemGroup.MISC)
+        new Item.Settings()
     );
     /**
      * 1 day, in ticks.
@@ -33,27 +35,21 @@ public class ChewStuff implements ModInitializer {
      */
     public static final Item SOFT_CHEW = new ChewableItem(
         1,
-        new Item.Settings().maxDamage(5 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
+        new Item.Settings().maxDamage(5 * DAY_MULTIPLIER)
     );
     /**
      * Medium chew. Lasts 6 days, 2 effect slots.
      */
     public static final Item MEDIUM_CHEW = new ChewableItem(
         2,
-        new Item.Settings().maxDamage(6 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
+        new Item.Settings().maxDamage(6 * DAY_MULTIPLIER)
     );
     /**
      * Hard chew. Lasts 7 days, 3 effect slots.
      */
     public static final Item HARD_CHEW = new ChewableItem(
         3,
-        new Item.Settings().maxDamage(7 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
-    );
-    /**
-     * The stat for chew effects.
-     */
-    public static final Identifier CHEW_EFFECTS = new Identifier(
-        "chewstuff", "effects"
+        new Item.Settings().maxDamage(7 * DAY_MULTIPLIER)
     );
 
     @Override
@@ -65,26 +61,32 @@ public class ChewStuff implements ModInitializer {
         LOGGER.info("This software is made with love by a queer trans person.");
 
         Registry.register(
-            Registry.ITEM,
+            Registries.ITEM,
             new Identifier("chewstuff", "silicone"),
             SILICONE
         );
         Registry.register(
-            Registry.ITEM,
+            Registries.ITEM,
             new Identifier("chewstuff", "soft_chew"),
             SOFT_CHEW
         );
         Registry.register(
-            Registry.ITEM,
+            Registries.ITEM,
             new Identifier("chewstuff", "medium_chew"),
             MEDIUM_CHEW
         );
         Registry.register(
-            Registry.ITEM,
+            Registries.ITEM,
             new Identifier("chewstuff", "hard_chew"),
             HARD_CHEW
         );
-//        Registry.register(Registry.CUSTOM_STAT, CHEW_EFFECTS, CHEW_EFFECTS);
-//        Stats.CUSTOM.getOrCreateStat(CHEW_EFFECTS, StatFormatter.DEFAULT);
+        ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(content -> {
+            content.add(SOFT_CHEW);
+            content.add(MEDIUM_CHEW);
+            content.add(HARD_CHEW);
+        });
+        ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(content -> {
+            content.add(SILICONE);
+        });
     }
 }
diff --git a/src/main/java/ganarchy/chewstuff/ChewableItem.java b/src/main/java/ganarchy/chewstuff/ChewableItem.java
index e3c8f60..5e637c4 100644
--- a/src/main/java/ganarchy/chewstuff/ChewableItem.java
+++ b/src/main/java/ganarchy/chewstuff/ChewableItem.java
@@ -9,7 +9,6 @@ import net.minecraft.entity.effect.StatusEffect;
 import net.minecraft.entity.effect.StatusEffectInstance;
 import net.minecraft.entity.player.PlayerEntity;
 import net.minecraft.item.ItemStack;
-import net.minecraft.item.Wearable;
 import net.minecraft.nbt.NbtCompound;
 import net.minecraft.network.packet.s2c.play.EntityStatusEffectS2CPacket;
 import net.minecraft.server.network.ServerPlayerEntity;
@@ -23,7 +22,7 @@ import java.util.stream.Collectors;
 /**
  * An item that can be chewed.
  */
-public class ChewableItem extends TrinketItem implements Wearable {
+public class ChewableItem extends TrinketItem {
     /**
      * The cooldown between activations, in ticks.
      */
@@ -44,7 +43,7 @@ public class ChewableItem extends TrinketItem implements Wearable {
 
     @Override
     public void onEquip(ItemStack stack, SlotReference slot, LivingEntity entity) {
-        if (entity.world.isClient) {
+        if (entity.getWorld().isClient) {
             return;
         }
         var maybeInfo = ChewComponents.CHEW.maybeGet(entity);
@@ -57,7 +56,7 @@ public class ChewableItem extends TrinketItem implements Wearable {
     public void onUnequip(
         ItemStack stack, SlotReference slot, LivingEntity entity
     ) {
-        if (entity.world.isClient) {
+        if (entity.getWorld().isClient) {
             return;
         }
         var maybeInfo = ChewComponents.CHEW.maybeGet(entity);
@@ -70,7 +69,7 @@ public class ChewableItem extends TrinketItem implements Wearable {
 
     @Override
     public void tick(ItemStack stack, SlotReference slot, LivingEntity entity) {
-        if (entity.world.isClient) {
+        if (entity.getWorld().isClient) {
             return;
         }
         if (entity instanceof PlayerEntity player) {
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index ba566da..82f2c26 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -33,10 +33,10 @@
   ],
 
   "depends": {
-    "trinkets": "~3.4",
+    "trinkets": "~3.7",
     "fabricloader": ">=0.14.6",
     "fabric": "*",
-    "minecraft": "~1.19",
+    "minecraft": "~1.20",
     "java": ">=17"
   },