Merge branch '1.20.6' into 1.20.4

# Conflicts:
#	gradle.properties
#	src/main/java/one/oth3r/sit/utl/Utl.java
This commit is contained in:
Oth3r 2025-05-03 12:19:08 -05:00
commit 16608e0546
7 changed files with 20 additions and 10 deletions

View file

@ -207,7 +207,7 @@ public class Utl {
/**
* the customizable y height of the entity, as some versions have different sitting heights on the entity
*/
private static final double Y_ADJUSTMENT = 0;
public static final double Y_ADJUSTMENT = 0;
/**
* checks if the entity's block is still there, & is valid
@ -226,9 +226,9 @@ public class Utl {
public static BlockPos getBlockPos(DisplayEntity.TextDisplayEntity entity) {
// the entity Y level, adjusted
// the adjustment - is the opposite of the offset applied in Entity.create()
double entityY = entity.getBlockY() + (Y_ADJUSTMENT*-1);
int entityBlockY = (int) (Math.floor(entity.getY() + (Y_ADJUSTMENT*-1)));
// get the block pos
BlockPos pos = new BlockPos(entity.getBlockX(),(int)entityY,entity.getBlockZ());
BlockPos pos = new BlockPos(entity.getBlockX(),entityBlockY,entity.getBlockZ());
// if above the block, subtract 1
if (isAboveBlockHeight(entity)) {
pos = pos.add(0,-1,0);
@ -368,7 +368,8 @@ public class Utl {
* sends the settings packets to the server, if client & in game
*/
public static void sendSettingsPackets() {
if (Data.isClient() && Data.isInGame()) {
if (Data.isClient() && Data.isInGame() &&
ClientPlayNetworking.canSend(PacketType.SETTINGS)) {
new PacketSender(PacketType.SETTINGS, Utl.getGson().toJson(FileData.getSittingConfig())).sendToServer();
}
}