Skip to content

Commit

Permalink
Fixed a crash at startup caused by the RecipeBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Mar 23, 2024
1 parent a623fc7 commit 8aaf1fa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'babric-loom' version '1.1.+'
id 'babric-loom' version '1.4.+'
id 'java'
}

Expand Down Expand Up @@ -96,8 +96,6 @@ dependencies {
modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar
modImplementation "fabric-loader:fabric-loader:${project.loader_version}"

include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9")))

implementation "org.slf4j:slf4j-api:1.8.0-beta4"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bta_version=7.1-pre2a
loader_version=0.15.6-babric.4-bta

# Mod
mod_version=3.4.15
mod_version=3.4.16
mod_group=turniplabs
mod_name=halplibe

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.core.item.IItemConvertible;
import net.minecraft.core.item.ItemStack;
import turniplabs.halplibe.helper.RecipeBuilder;
import turniplabs.halplibe.mixin.accessors.RecipeSymbolAccessor;

import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -114,7 +115,14 @@ public void create(String recipeID, ItemStack outputStack) {
if (tempplate == null){
recipe[x + y * width] = null;
} else {
recipe[x + y * width] = new RecipeSymbol(cha == null ? ' ' : cha, tempplate.getStack(), tempplate.getItemGroup());
if(tempplate.getItemGroup() == null){
RecipeSymbol s = new RecipeSymbol(tempplate.getStack());
((RecipeSymbolAccessor)s).setSymbol(cha == null ? ' ' : cha);
recipe[x + y * width] = s;
} else {
recipe[x + y * width] = new RecipeSymbol(cha == null ? ' ' : cha, tempplate.getStack(), tempplate.getItemGroup());
}

}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package turniplabs.halplibe.mixin.accessors;

import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(RecipeSymbol.class)
public interface RecipeSymbolAccessor {
@Accessor
void setSymbol(char symbol);
}
1 change: 1 addition & 0 deletions src/main/resources/halplibe.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"accessors.EntityFXAccessor",
"accessors.EntityListAccessor",
"accessors.LanguageAccessor",
"accessors.RecipeSymbolAccessor",
"accessors.TileEntityAccessor",
"accessors.WeightedRandomBagAccessor",
"accessors.WeightedRandomBagEntryAccessor",
Expand Down

0 comments on commit 8aaf1fa

Please sign in to comment.