mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
改成silent
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user