diff --git a/build.gradle b/build.gradle index 22fcc8f0..ff0b6776 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.8-SNAPSHOT' id 'maven-publish' } diff --git a/gradle.properties b/gradle.properties index 95aac4dc..4eac2891 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,20 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties -minecraft_version=1.21 -yarn_mappings=1.21+build.2 -loader_version=0.15.11 +minecraft_version=1.21.2-rc1 +yarn_mappings=1.21.2-rc1+build.1 +loader_version=0.16.7 # Mod Properties -mod_version = 2.6.3 +mod_version = 2.6.4 maven_group = io.icker archives_base_name = factions # Dependencies -fabric_version=0.100.1+1.21 +fabric_version=0.106.0+1.21.2 lucko_permissions_version=0.3.1 dynmap_api_version=3.7-SNAPSHOT -papi_version=2.4.0-pre.2+1.21 -styled_chat_version=OQeEfRIi +papi_version=2.4.1+1.21 +styled_chat_version=EoTTJkqS bluemap_api_version=2.7.1 squaremap_api_version=1.2.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..9355b415 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/io/icker/factions/FactionsMod.java b/src/main/java/io/icker/factions/FactionsMod.java index 391cf91c..0a4ad386 100644 --- a/src/main/java/io/icker/factions/FactionsMod.java +++ b/src/main/java/io/icker/factions/FactionsMod.java @@ -54,7 +54,7 @@ public class FactionsMod implements ModInitializer { @Override public void onInitialize() { - LOGGER.info("Initialized Factions Mod for Minecraft v1.20.1"); + LOGGER.info("Initialized Factions Mod for Minecraft v1.21.2"); WorldUtils.register(); diff --git a/src/main/java/io/icker/factions/command/HomeCommand.java b/src/main/java/io/icker/factions/command/HomeCommand.java index fa8370c9..2d26e920 100644 --- a/src/main/java/io/icker/factions/command/HomeCommand.java +++ b/src/main/java/io/icker/factions/command/HomeCommand.java @@ -1,5 +1,7 @@ package io.icker.factions.command; +import java.util.HashSet; + import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.tree.LiteralCommandNode; @@ -60,7 +62,7 @@ private int go(CommandContext context) throws CommandSyntax // damageRecord.getEntityAge() // > // FactionsMod.CONFIG.HOME.DAMAGE_COOLDOWN - player.teleport(world, home.x, home.y, home.z, home.yaw, home.pitch); + player.teleport(world, home.x, home.y, home.z, new HashSet<>(), home.yaw, home.pitch, false); new Message("Warped to faction home").send(player, false); } else { new Message("Cannot warp while in combat").fail().send(player, false); diff --git a/src/main/java/io/icker/factions/core/InteractionManager.java b/src/main/java/io/icker/factions/core/InteractionManager.java index 9dc0b704..b7a07adc 100644 --- a/src/main/java/io/icker/factions/core/InteractionManager.java +++ b/src/main/java/io/icker/factions/core/InteractionManager.java @@ -24,7 +24,6 @@ import net.minecraft.item.ItemUsageContext; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; -import net.minecraft.util.TypedActionResult; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.BlockPos; @@ -88,7 +87,7 @@ private static ActionResult onPlaceBlock(ItemUsageContext context) { return ActionResult.PASS; } - private static TypedActionResult onUseBucket(PlayerEntity player, World world, + private static ActionResult onUseBucket(PlayerEntity player, World world, Hand hand) { Item item = player.getStackInHand(hand).getItem(); @@ -98,7 +97,7 @@ private static TypedActionResult onUseBucket(PlayerEntity player, Wor if (playerResult == ActionResult.FAIL) { InteractionsUtil.warn(player, "pick up/place liquids"); InteractionsUtil.sync(player, player.getStackInHand(hand), hand); - return TypedActionResult.fail(player.getStackInHand(hand)); + return ActionResult.FAIL; } Fluid fluid = ((BucketItemAccessor) item).getFluid(); @@ -114,7 +113,7 @@ private static TypedActionResult onUseBucket(PlayerEntity player, Wor Permissions.PLACE_BLOCKS) == ActionResult.FAIL) { InteractionsUtil.warn(player, "pick up/place liquids"); InteractionsUtil.sync(player, player.getStackInHand(hand), hand); - return TypedActionResult.fail(player.getStackInHand(hand)); + return ActionResult.FAIL; } BlockPos placePos = raycastPos.add(raycastResult.getSide().getVector()); @@ -122,12 +121,12 @@ private static TypedActionResult onUseBucket(PlayerEntity player, Wor Permissions.PLACE_BLOCKS) == ActionResult.FAIL) { InteractionsUtil.warn(player, "pick up/place liquids"); InteractionsUtil.sync(player, player.getStackInHand(hand), hand); - return TypedActionResult.fail(player.getStackInHand(hand)); + return ActionResult.FAIL; } } } - return TypedActionResult.pass(player.getStackInHand(hand)); + return ActionResult.PASS; } private static ActionResult onAttackEntity(PlayerEntity player, World world, Hand hand, diff --git a/src/main/java/io/icker/factions/database/SerializerRegistry.java b/src/main/java/io/icker/factions/database/SerializerRegistry.java index 7b935ba0..cb73cacd 100644 --- a/src/main/java/io/icker/factions/database/SerializerRegistry.java +++ b/src/main/java/io/icker/factions/database/SerializerRegistry.java @@ -121,7 +121,7 @@ private static Serializer createInventorySerializer(in if (!itemStack.isEmpty()) { NbtCompound nbtCompound = new NbtCompound(); nbtCompound.putByte("Slot", (byte) i); - nbtCompound.put("Data", itemStack.encode(WorldUtils.server.getRegistryManager())); + nbtCompound.put("Data", itemStack.toNbt(WorldUtils.server.getRegistryManager())); nbtList.add(nbtCompound); } } diff --git a/src/main/java/io/icker/factions/mixin/ServerPlayerEntityMixin.java b/src/main/java/io/icker/factions/mixin/ServerPlayerEntityMixin.java index 8c7bdaea..cd244a0a 100644 --- a/src/main/java/io/icker/factions/mixin/ServerPlayerEntityMixin.java +++ b/src/main/java/io/icker/factions/mixin/ServerPlayerEntityMixin.java @@ -10,6 +10,7 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; @@ -44,7 +45,7 @@ public void tick(CallbackInfo info) { } @Inject(method = "isInvulnerableTo", at = @At("RETURN"), cancellable = true) - private void isInvulnerableTo(DamageSource damageSource, CallbackInfoReturnable info) { + public void isInvulnerableTo(ServerWorld world, DamageSource damageSource, CallbackInfoReturnable info) { Entity source = damageSource.getAttacker(); if (source == null) return; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 14f13511..1013f58e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,12 +30,14 @@ "depends": { "fabricloader": ">=0.13.3", - "minecraft": ">=1.20.2", + "minecraft": ">=1.21.2-rc.1", "java": ">=17", "fabric-api": "*" }, "suggests": { "fabric-permissions-api-v0": "*", - "dynmap": ">=3.0" + "dynmap": ">=3.0", + "squaremap": ">=1.0", + "bluemap": ">=2.0" } }