9
0
mirror of https://github.com/HibiscusMC/HibiscusCommons.git synced 2025-12-19 15:09:26 +00:00

Added scale packets

This commit is contained in:
OakLoaf
2025-07-04 18:10:12 +01:00
parent ba63da4589
commit 2b113ee336
7 changed files with 86 additions and 0 deletions

View File

@@ -32,6 +32,8 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.PositionMoveRotation;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.level.GameType;
@@ -335,6 +337,18 @@ public class NMSPackets extends NMSCommon implements me.lojosho.hibiscuscommons.
for (Player p : sendTo) sendPacket(p, packet);
}
@Override
public void sendEntityScalePacket(int entityId, double scale, List<Player> sendTo) {
AttributeInstance attribute = new AttributeInstance(
Attributes.SCALE,
(ignored) -> {}
);
attribute.setBaseValue(scale);
ClientboundUpdateAttributesPacket packet = new ClientboundUpdateAttributesPacket(entityId, List.of(attribute));
for (Player p : sendTo) sendPacket(p, packet);
}
@Override
public void sendItemDisplayMetadata(int entityId,
Vector3f translation,