9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

改成silent

This commit is contained in:
jhqwqmc
2025-11-25 22:42:00 +08:00
parent c1883648ef
commit c00feb7a3d
3 changed files with 5 additions and 5 deletions

View File

@@ -1281,7 +1281,7 @@ public class BukkitServerPlayer extends Player {
}
@Override
public void sendTotemAnimation(Item<?> totem, @Nullable SoundData sound, boolean removeSound) {
PlayerUtils.sendTotemAnimation(this, totem, sound, removeSound);
public void sendTotemAnimation(Item<?> totem, @Nullable SoundData sound, boolean silent) {
PlayerUtils.sendTotemAnimation(this, totem, sound, silent);
}
}

View File

@@ -57,7 +57,7 @@ public final class PlayerUtils {
}
}
public static void sendTotemAnimation(Player player, Item<?> totem, @Nullable SoundData sound, boolean removeSound) {
public static void sendTotemAnimation(Player player, Item<?> totem, @Nullable SoundData sound, boolean silent) {
List<Object> packets = new ArrayList<>();
try {
Object totemItem = totem.getLiteralObject();
@@ -86,7 +86,7 @@ public final class PlayerUtils {
packets.add(NetworkReflections.constructor$ClientboundSetEquipmentPacket.newInstance(
player.entityID(), List.of(Pair.of(CoreReflections.instance$EquipmentSlot$OFFHAND, previousOffHandItem))
));
if (sound != null || removeSound) {
if (sound != null || silent) {
packets.add(NetworkReflections.constructor$ClientboundStopSoundPacket.newInstance(
FastNMS.INSTANCE.method$ResourceLocation$fromNamespaceAndPath("minecraft", "item.totem.use"),
CoreReflections.instance$SoundSource$PLAYERS

View File

@@ -194,7 +194,7 @@ public abstract class Player extends AbstractEntity implements NetWorkUser {
public abstract void setExperienceLevels(int level);
public abstract void sendTotemAnimation(Item<?> totem, @Nullable SoundData sound, boolean removeSound);
public abstract void sendTotemAnimation(Item<?> totem, @Nullable SoundData sound, boolean silent);
@Override
public void remove() {