summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2024-01-05 22:25:44 +0100
committerGravatar Uko Kokņevičs2024-01-05 22:25:44 +0100
commit345035887fa01e804b2829a87358bca661221185 (patch)
tree9d8542bd73b33fb1421c5e0d5cf81960e1defe4a
parentCleanup imports (diff)
downloadmc-eris-alchemy-345035887fa01e804b2829a87358bca661221185.tar.gz
mc-eris-alchemy-345035887fa01e804b2829a87358bca661221185.tar.xz
mc-eris-alchemy-345035887fa01e804b2829a87358bca661221185.zip
Add jakarta NonNull annotations
-rw-r--r--build.gradle2
-rw-r--r--gradle.properties4
-rw-r--r--src/main/java/lv/enes/mc/eris_alchemy/CovalenceRepair.java7
3 files changed, 11 insertions, 2 deletions
diff --git a/build.gradle b/build.gradle
index 29c2585..2c618b9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,6 +39,8 @@ dependencies {
39 modImplementation("vazkii.patchouli:Patchouli:${patchouli_version}") { 39 modImplementation("vazkii.patchouli:Patchouli:${patchouli_version}") {
40 exclude group: "net.fabricmc", module: "fabric-loader" 40 exclude group: "net.fabricmc", module: "fabric-loader"
41 } 41 }
42
43 compileOnly "jakarta.annotation:jakarta.annotation-api:${jakarta_annotation_version}"
42} 44}
43 45
44processResources { 46processResources {
diff --git a/gradle.properties b/gradle.properties
index a78fc4a..6dc6f57 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -9,4 +9,6 @@ quilt_mappings = 23
9loader_version = 0.23.0 9loader_version = 0.23.0
10quilted_fabric_api_version = 7.4.0+0.90.0 10quilted_fabric_api_version = 7.4.0+0.90.0
11 11
12patchouli_version = 1.20.1-84-FABRIC \ No newline at end of file 12patchouli_version = 1.20.1-84-FABRIC
13
14jakarta_annotation_version = 2.1.1 \ No newline at end of file
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/CovalenceRepair.java b/src/main/java/lv/enes/mc/eris_alchemy/CovalenceRepair.java
index 2e9da77..f094342 100644
--- a/src/main/java/lv/enes/mc/eris_alchemy/CovalenceRepair.java
+++ b/src/main/java/lv/enes/mc/eris_alchemy/CovalenceRepair.java
@@ -4,6 +4,7 @@ import com.google.gson.Gson;
4import com.google.gson.JsonElement; 4import com.google.gson.JsonElement;
5import com.google.gson.JsonObject; 5import com.google.gson.JsonObject;
6import com.google.gson.JsonSyntaxException; 6import com.google.gson.JsonSyntaxException;
7import jakarta.annotation.Nonnull;
7import net.minecraft.core.RegistryAccess; 8import net.minecraft.core.RegistryAccess;
8import net.minecraft.network.FriendlyByteBuf; 9import net.minecraft.network.FriendlyByteBuf;
9import net.minecraft.resources.ResourceLocation; 10import net.minecraft.resources.ResourceLocation;
@@ -43,6 +44,7 @@ public class CovalenceRepair extends CustomRecipe {
43 return res; 44 return res;
44 } 45 }
45 46
47 @Nonnull
46 @Override 48 @Override
47 public CovalenceRepair fromJson(ResourceLocation id, JsonObject json) { 49 public CovalenceRepair fromJson(ResourceLocation id, JsonObject json) {
48 var recipeJson = new Gson().fromJson(json, Json.class); 50 var recipeJson = new Gson().fromJson(json, Json.class);
@@ -65,6 +67,7 @@ public class CovalenceRepair extends CustomRecipe {
65 recipe.tools.toNetwork(buf); 67 recipe.tools.toNetwork(buf);
66 } 68 }
67 69
70 @Nonnull
68 @Override 71 @Override
69 public CovalenceRepair fromNetwork(ResourceLocation id, FriendlyByteBuf buf) { 72 public CovalenceRepair fromNetwork(ResourceLocation id, FriendlyByteBuf buf) {
70 var category = buf.readEnum(CraftingBookCategory.class); 73 var category = buf.readEnum(CraftingBookCategory.class);
@@ -104,6 +107,7 @@ public class CovalenceRepair extends CustomRecipe {
104 return getInputs(inventory) != null; 107 return getInputs(inventory) != null;
105 } 108 }
106 109
110 @Nonnull
107 @Override 111 @Override
108 public ItemStack assemble(CraftingContainer inventory, RegistryAccess registryManager) { 112 public ItemStack assemble(CraftingContainer inventory, RegistryAccess registryManager) {
109 var inputs = getInputs(inventory); 113 var inputs = getInputs(inventory);
@@ -117,8 +121,9 @@ public class CovalenceRepair extends CustomRecipe {
117 return newToolStack; 121 return newToolStack;
118 } 122 }
119 123
124 @Nonnull
120 @Override 125 @Override
121 public RecipeSerializer<?> getSerializer() { 126 public RecipeSerializer<CovalenceRepair> getSerializer() {
122 return Serializer.INSTANCE; 127 return Serializer.INSTANCE;
123 } 128 }
124 129