Skip to content

Commit

Permalink
Start update to 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueZeeKing committed Oct 19, 2024
1 parent 9505d81 commit 1a9655f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
}

Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/icker/factions/FactionsMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/io/icker/factions/command/HomeCommand.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -60,7 +62,7 @@ private int go(CommandContext<ServerCommandSource> 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);
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/io/icker/factions/core/InteractionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,7 +87,7 @@ private static ActionResult onPlaceBlock(ItemUsageContext context) {
return ActionResult.PASS;
}

private static TypedActionResult<ItemStack> onUseBucket(PlayerEntity player, World world,
private static ActionResult onUseBucket(PlayerEntity player, World world,
Hand hand) {
Item item = player.getStackInHand(hand).getItem();

Expand All @@ -98,7 +97,7 @@ private static TypedActionResult<ItemStack> 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();
Expand All @@ -114,20 +113,20 @@ private static TypedActionResult<ItemStack> 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());
if (checkPermissions(player, placePos, world,
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static Serializer<SimpleInventory, NbtList> 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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -44,7 +45,7 @@ public void tick(CallbackInfo info) {
}

@Inject(method = "isInvulnerableTo", at = @At("RETURN"), cancellable = true)
private void isInvulnerableTo(DamageSource damageSource, CallbackInfoReturnable<Boolean> info) {
public void isInvulnerableTo(ServerWorld world, DamageSource damageSource, CallbackInfoReturnable<Boolean> info) {
Entity source = damageSource.getAttacker();
if (source == null)
return;
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 1a9655f

Please sign in to comment.