#814: Add a method to send multiple equipment changes

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot 2023-02-27 20:27:43 +11:00
parent 3b7d1ed26c
commit 0fea70d4c9

View file

@ -2,6 +2,7 @@ package org.bukkit.entity;
import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.Map;
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@ -552,15 +553,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendBlockDamage(@NotNull Location loc, float progress);
/**
* Send the equipment change of an entity. This fakes the equipment change
* of an entity for a user. This will not actually change the inventory of
* the specified entity in any way.
* Send an equipment change for the target entity. This will not
* actually change the entity's equipment in any way.
*
* @param entity The entity that the player will see the change for
* @param slot The slot of the spoofed equipment change
* @param item The ItemStack to display for the player
* @param entity the entity whose equipment to change
* @param slot the slot to change
* @param item the item to which the slot should be changed, or null to set
* it to air
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item);
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @Nullable ItemStack item);
/**
* Send multiple equipment changes for the target entity. This will not
* actually change the entity's equipment in any way.
*
* @param entity the entity whose equipment to change
* @param items the slots to change, where the values are the items to which
* the slot should be changed. null values will set the slot to air
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items);
/**
* Send a sign change. This fakes a sign change packet for a user at