Skip to content

Commit

Permalink
Fixed ChildBasedIngredient crash, updated arch and rei
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Apr 7, 2024
1 parent 663dc50 commit a836cfe
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 29 deletions.
12 changes: 0 additions & 12 deletions .kubejs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,5 @@
"name": "NeoForge",
"url": "https://maven.saps.dev/releases/dev/latvian/mods/kubejs-neoforge/{version}/kubejs-neoforge-{version}.jar"
}
],
"event_groups": [
"BlockEvents",
"ClientEvents",
"EntityEvents",
"ItemEvents",
"LevelEvents",
"NetworkEvents",
"PlayerEvents",
"ServerEvents",
"StartupEvents",
"WorldgenEvents"
]
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ dependencies {
modApi("dev.latvian.mods:rhino-neoforge:${rootProject.rhino_version}") { transitive false }

// todo: reevaluate if we want to depend on jei
modCompileOnly("mezz.jei:jei-1.20.2-forge:${rootProject.jei_version}") { transitive(false) }
modCompileOnly("mezz.jei:jei-1.20.4-neoforge:${rootProject.jei_version}") { transitive(false) }

modLocalRuntime modCompileOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${rootProject.rei_version}")
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ modrinth_id=umyGl7zF
minecraft_version=1.20.4
rhino_version=2004.2.3-build.4
min_rhino_version=2004.2.3-build.4
architectury_version=11.0.9
architectury_version=11.1.17
rei_version=14.0.688
#rei_comp_version=9.0.16
neoforge_version=20.4.190
neoforge_version=20.4.223
#forge_bookshelf_version=11.0.3
#forge_gamestages_version=7.+
jei_version=16.0.0.28
jei_version=17.3.0.49
loom.platform=neoforge
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
import dev.latvian.mods.kubejs.util.FluidAmounts;
import dev.latvian.mods.kubejs.util.JsonIO;
import dev.latvian.mods.kubejs.util.KubeJSPlugins;
import dev.latvian.mods.kubejs.util.LegacyCodeHandler;
import dev.latvian.mods.kubejs.util.ListJS;
import dev.latvian.mods.kubejs.util.MapJS;
import dev.latvian.mods.kubejs.util.NBTIOWrapper;
Expand Down Expand Up @@ -344,12 +343,7 @@ public void registerBindings(BindingsEvent event) {
event.add("ResourceLocation", ResourceLocation.class);
event.add("Duration", Duration.class);

if (event.getType().isServer()) {
event.add("settings", new LegacyCodeHandler("settings"));
}

event.add("onEvent", new LegacyCodeHandler("onEvent()"));
event.add("java", new LegacyCodeHandler("java()"));
// event.add("onEvent", new LegacyCodeHandler("onEvent()"));

if (event.getType().isServer() && event.manager instanceof ServerScriptManager sm && sm.server != null) {
var se = sm.server.kjs$getScheduledEvents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

import dev.latvian.mods.kubejs.core.IngredientKJS;
import net.minecraft.world.item.crafting.Ingredient;
import net.neoforged.neoforge.common.crafting.CompoundIngredient;
import net.neoforged.neoforge.common.crafting.IntersectionIngredient;
import net.neoforged.neoforge.common.crafting.ChildBasedIngredient;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

import java.util.List;

@Mixin({CompoundIngredient.class, IntersectionIngredient.class})
@Mixin(ChildBasedIngredient.class)
public abstract class IngredientsWithChildrenMixin implements IngredientKJS {
@Final
@Shadow(remap = false)
private List<Ingredient> children;
protected List<Ingredient> children;

@Override
public boolean kjs$canBeUsedForMatching() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public void registerBindings(BindingsEvent event) {

if (event.getType().isStartup()) {
event.add("NativeEvents", new NativeEventWrapper("NativeEvents", NeoForge.EVENT_BUS));
KubeJSEntryPoint.eventBus().ifPresent(bus -> event.add("NativeModEvents",
new NativeEventWrapper("NativeModEvents", bus)));
KubeJSEntryPoint.eventBus().ifPresent(bus -> event.add("NativeModEvents", new NativeEventWrapper("NativeModEvents", bus)));
}
}

Expand Down

0 comments on commit a836cfe

Please sign in to comment.