Merge branch '1.21.4' into 1.21.1

# Conflicts:
#	gradle.properties
This commit is contained in:
Oth3r 2025-06-14 19:00:48 -05:00
commit e64027930d
43 changed files with 215 additions and 117 deletions

View file

@ -77,7 +77,8 @@ public class Logic {
* @return true if sitting was successful
*/
public static boolean sitLooking(ServerPlayerEntity player) {
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,5),null);
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,
Utl.getPlayerReach(player)),null);
}
/**

View file

@ -10,6 +10,7 @@ import net.minecraft.block.*;
import net.minecraft.block.enums.BlockHalf;
import net.minecraft.block.enums.SlabType;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.decoration.DisplayEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
@ -481,4 +482,13 @@ public class Utl {
return new BlockPos(player.getBlockPos());
}
public static double getPlayerReach(PlayerEntity player) {
// use the BLOCK_INTERACTION_RANGE attribute if available
if (player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE) != null) {
return player.getAttributeValue(EntityAttributes.BLOCK_INTERACTION_RANGE);
}
// fallback to 5
return 5;
}
}