diff --git a/build.gradle b/build.gradle index 1c436ce..0525316 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ repositories { } mavenCentral() - //mavenLocal() + mavenLocal() } dependencies { @@ -61,8 +61,9 @@ dependencies { modImplementation include("eu.pb4:sgui:1.0.0+1.18.1") modImplementation include("eu.pb4:hologram-api:0.2.1+1.18-pre5") modImplementation include("eu.pb4:placeholder-api:1.1.3+1.17.1") - modImplementation include("eu.pb4:polymer:0.2.0-beta.27+1.18.1") - modImplementation include("fr.catcore:server-translations-api:1.4.8+1.18-pre1") + modImplementation include("eu.pb4:polymer:0.2.0-beta.27+1.18.2-rc1") + modImplementation include("fr.catcore:server-translations-api:1.4.9+1.18.2-rc1") + //modImplementation include("fr.catcore:server-translations-api:1.4.8+1.18-pre1") modImplementation include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT") modCompileOnly "dev.emi:trinkets:3.0.4" diff --git a/gradle.properties b/gradle.properties index bfa1670..db78aa5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.18.1 - yarn_mappings=1.18.1+build.1 - loader_version=0.12.8 - - #Fabric api - fabric_version=0.46.1+1.18 +minecraft_version=1.18.2 +yarn_mappings=1.18.2+build.1 +loader_version=0.13.3 +#Fabric api +fabric_version=0.47.8+1.18.2 # Mod Properties - mod_version = 2.0.0-rc.5+1.18.1 + mod_version = 2.0.0-rc.5+1.18.2 maven_group = eu.pb4 archives_base_name = graves diff --git a/src/main/java/eu/pb4/graves/mixin/ServerWorldMixin.java b/src/main/java/eu/pb4/graves/mixin/ServerWorldMixin.java index 5239b67..58816ee 100644 --- a/src/main/java/eu/pb4/graves/mixin/ServerWorldMixin.java +++ b/src/main/java/eu/pb4/graves/mixin/ServerWorldMixin.java @@ -6,6 +6,7 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.profiler.Profiler; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.World; @@ -20,6 +21,10 @@ @Mixin(ServerWorld.class) public abstract class ServerWorldMixin extends World { + protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, RegistryEntry registryEntry, Supplier profiler, boolean isClient, boolean debugWorld, long seed) { + super(properties, registryRef, registryEntry, profiler, isClient, debugWorld, seed); + } + @Inject(method = "canPlayerModifyAt", at = @At("HEAD"), cancellable = true) private void grave_disallowGraveBreaking(PlayerEntity player, BlockPos pos, CallbackInfoReturnable cir) { if (this.getBlockEntity(pos) instanceof GraveBlockEntity grave) { @@ -33,8 +38,4 @@ private static void grave_dontBreak(ServerWorld serverWorld, BlockPos pos, Callb ci.cancel(); } } - - protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DimensionType dimensionType, Supplier profiler, boolean isClient, boolean debugWorld, long seed) { - super(properties, registryRef, dimensionType, profiler, isClient, debugWorld, seed); - } } diff --git a/src/main/java/eu/pb4/graves/other/GraveUtils.java b/src/main/java/eu/pb4/graves/other/GraveUtils.java index 4f545b0..46dd969 100644 --- a/src/main/java/eu/pb4/graves/other/GraveUtils.java +++ b/src/main/java/eu/pb4/graves/other/GraveUtils.java @@ -5,7 +5,6 @@ import eu.pb4.graves.event.GraveValidPosCheckEvent; import eu.pb4.graves.registry.SafeXPEntity; import eu.pb4.graves.registry.TempBlock; -import net.fabricmc.fabric.api.tag.TagFactory; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.enchantment.Enchantment; @@ -17,6 +16,7 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.state.property.Property; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -36,7 +36,7 @@ public class GraveUtils { public static final Identifier REPLACEABLE_ID = new Identifier("universal_graves", "replaceable"); - public static final Tag REPLACEABLE_TAG = TagFactory.BLOCK.create(GraveUtils.REPLACEABLE_ID); + public static final TagKey REPLACEABLE_TAG = TagKey.of(Registry.BLOCK_KEY, REPLACEABLE_ID); private static final Function, Comparable>, String> PROPERTY_MAP_PRINTER = new Function<>() { public String apply(@Nullable Map.Entry, Comparable> entry) { if (entry == null) { @@ -117,10 +117,10 @@ public static void spawnExp(ServerWorld world, Vec3d pos, int amount) { } - private static BlockResult isValidPos(ServerPlayerEntity player, ServerWorld world, WorldBorder border, BlockPos pos, boolean anyBlock) { + private static BlockResult isValidPos(ServerPlayerEntity player, ServerWorld world, WorldBorder border, BlockPos pos, boolean anyBlock) { BlockState state = world.getBlockState(pos); - if (state.getBlock() != TempBlock.INSTANCE && border.contains(pos) && pos.getY() >= world.getBottomY() && pos.getY() < world.getTopY() && !state.hasBlockEntity() && (state.isAir() || anyBlock || REPLACEABLE_TAG.contains(state.getBlock()))) { + if (state.getBlock() != TempBlock.INSTANCE && border.contains(pos) && pos.getY() >= world.getBottomY() && pos.getY() < world.getTopY() && !state.hasBlockEntity() && (state.isAir() || anyBlock || state.isIn(REPLACEABLE_TAG))) { return GraveValidPosCheckEvent.EVENT.invoker().isValid(player, world, pos); } else { return BlockResult.BLOCK; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 15cac1c..54a4e7a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,7 +31,7 @@ "depends": { "fabricloader": ">=0.12.0", "fabric": "*", - "minecraft": ">=1.18-rc.1", + "minecraft": ">=1.18.2-rc.1", "java": ">=17" } }