This commit is contained in:
iam4722202468 2024-05-09 22:24:31 -04:00
parent cf7a6d3c9f
commit b27afcd15f
No known key found for this signature in database
GPG Key ID: 4D8728E97DA5B8F9
3 changed files with 4 additions and 6 deletions

View File

@ -1111,14 +1111,14 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
}
/**
* Sets and refresh client food saturationModifier.
* Sets and refresh client food saturation.
*
* @param foodSaturation the food saturationModifier
* @param foodSaturation the food saturation
* @throws IllegalArgumentException if {@code foodSaturation} is not between 0 and 20
*/
public void setFoodSaturation(float foodSaturation) {
Check.argCondition(!MathUtils.isBetween(foodSaturation, 0, 20),
"Food saturationModifier has to be between 0 and 20");
"Food saturation has to be between 0 and 20");
this.foodSaturation = foodSaturation;
sendPacket(new UpdateHealthPacket(getHealth(), food, foodSaturation));
}

View File

@ -1,7 +1,5 @@
package net.minestom.server.instance;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.kyori.adventure.nbt.LongArrayBinaryTag;
import net.minestom.server.MinecraftServer;
import net.minestom.server.ServerFlag;
import net.minestom.server.collision.Shape;

View File

@ -149,7 +149,7 @@ public class BlockPlacementListener {
// If a player is trying to place a block on themselves, the client will send a block change but will not set the block on the client
// For this reason, the block doesn't need to be updated for the client
// Client also doesn't predict placement of blocks on entities, but we need to refresh for properties where bounding boxes on the server don't match the client
// Client also doesn't predict placement of blocks on entities, but we need to refresh for cases where bounding boxes on the server don't match the client
if (collisionEntity != player)
refresh(player, chunk);