diff --git a/build.gradle b/build.gradle index 6cbf376..eb139a2 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.18.1-2.33' +version = '1.18-2.34' group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'effortlessbuilding' @@ -25,7 +25,7 @@ minecraft { // stable_# Stables are built at the discretion of the MCP team. // 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') // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. @@ -89,7 +89,7 @@ dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18.1-39.0.9' + minecraft 'net.minecraftforge:forge:1.18.2-40.0.19' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency diff --git a/src/main/java/nl/requios/effortlessbuilding/helper/SurvivalHelper.java b/src/main/java/nl/requios/effortlessbuilding/helper/SurvivalHelper.java index 4c85af2..329aac0 100644 --- a/src/main/java/nl/requios/effortlessbuilding/helper/SurvivalHelper.java +++ b/src/main/java/nl/requios/effortlessbuilding/helper/SurvivalHelper.java @@ -1,6 +1,7 @@ package nl.requios.effortlessbuilding.helper; import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.tags.Tag; @@ -233,7 +234,7 @@ public class SurvivalHelper { return false; } - //From EntityPlayer#canPlayerEdit + //From Player#mayUseItemAt private static boolean canPlayerEdit(Player player, Level world, BlockPos pos, ItemStack stack) { if (!world.mayInteract(player, pos)) return false; @@ -242,9 +243,8 @@ public class SurvivalHelper { return true; } else { //Adventure mode - BlockInWorld blockworldstate = new BlockInWorld(world, pos, false); - return stack.hasAdventureModePlaceTagForBlock(world.getTagManager(), blockworldstate); - + BlockInWorld blockinworld = new BlockInWorld(world, pos, false); + return stack.hasAdventureModePlaceTagForBlock(world.registryAccess().registryOrThrow(Registry.BLOCK_REGISTRY), blockinworld); } }