Skip to content

Commit

Permalink
Merge pull request #28 from r8420/27-1182-updating-jei-past-196-cause…
Browse files Browse the repository at this point in the history
…s-crash-on-worldloading

Fixed compartibility with newer versions of JEI, updated Forge to 1.18.2
  • Loading branch information
r8420 authored Jun 16, 2022
2 parents f24cdf1 + 65ebf17 commit 70e4eb0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ minecraft {
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.18.1'
mappings channel: 'official', version: '1.18.2'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

Expand Down Expand Up @@ -132,7 +132,8 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${forge_version}"

implementation fg.deobf("mezz.jei:jei-${jei_version}")
implementation fg.deobf("mezz.jei:jei-${jei_version_api}")
implementation fg.deobf("mezz.jei:jei-${jei_version_core}")
//runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")

implementation fg.deobf("slimeknights.mantle:Mantle:${mantle_version}")
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

forge_version=1.18.1-39.0.66
jei_version=1.18.1:9.2.3.84
mantle_version=1.18.1-1.8.35
forge_version=1.18.2-40.1.0
jei_version_api=1.18.2-common-api:10.1.0.202
jei_version_core=1.18.2-common:10.1.0.202
mantle_version=1.18.2-1.9.27
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package at.ridgo8.moreoverlays.api.lightoverlay;

import at.ridgo8.moreoverlays.config.Config;
import net.minecraft.core.Holder;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -84,8 +85,8 @@ public boolean shouldCheck(BlockPos pos, Level world) {
if (Config.light_IgnoreSpawnList.get()) {
return true;
}
Biome biome = world.getBiome(pos);
return biome.getMobSettings().getCreatureProbability() > 0 && !biome.getMobSettings().getMobs(MobCategory.MONSTER).isEmpty();
Holder<Biome> biome = world.getBiome(pos);
return biome.value().getMobSettings().getCreatureProbability() > 0 && !biome.value().getMobSettings().getMobs(MobCategory.MONSTER).isEmpty();
}

public abstract byte getSpawnModeAt(BlockPos pos, Level world);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void checkSlots(AbstractContainerScreen<?> container) {
private boolean isSearchedItem(ItemStack stack) {
if (emptyFilter) return true;
else if (stack.isEmpty()) return false;
for (Object ingredient : JeiModule.filter.getFilteredIngredients(VanillaTypes.ITEM)) {
for (Object ingredient : JeiModule.filter.getFilteredIngredients(VanillaTypes.ITEM_STACK)) {
if (ItemUtils.ingredientMatches(ingredient, stack)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import mezz.jei.api.runtime.IIngredientFilter;
import mezz.jei.api.runtime.IIngredientListOverlay;
import mezz.jei.api.runtime.IJeiRuntime;
import mezz.jei.gui.overlay.IngredientListOverlay;
import mezz.jei.common.gui.overlay.IngredientListOverlay;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import at.ridgo8.moreoverlays.lightoverlay.LightScannerVanilla;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;

Expand All @@ -13,8 +14,8 @@ public class CustomSpawnerLightScanner extends LightScannerVanilla {

@Override
public boolean shouldCheck(BlockPos pos, Level world) {
Biome biome = world.getBiome(pos);
return biome.getMobSettings().getCreatureProbability() <= 0;
Holder<Biome> biome = world.getBiome(pos);
return biome.value().getMobSettings().getCreatureProbability() <= 0;

/*
EnvironmentSettings environment = CMSUtils.getEnvironment(world);
Expand Down

0 comments on commit 70e4eb0

Please sign in to comment.