#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.net.InetSocketAddress;
import java.util.Collection; import java.util.Collection;
import java.util.Map;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -552,15 +553,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendBlockDamage(@NotNull Location loc, float progress); public void sendBlockDamage(@NotNull Location loc, float progress);
/** /**
* Send the equipment change of an entity. This fakes the equipment change * Send an equipment change for the target entity. This will not
* of an entity for a user. This will not actually change the inventory of * actually change the entity's equipment in any way.
* the specified entity in any way.
* *
* @param entity The entity that the player will see the change for * @param entity the entity whose equipment to change
* @param slot The slot of the spoofed equipment change * @param slot the slot to change
* @param item The ItemStack to display for the player * @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 * Send a sign change. This fakes a sign change packet for a user at