Contents
Class DropItemsComponent
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.item.DropItemsComponent
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
A component holding item stacks that
DropItemsSystem drops at the entity's position on
its next tick. Queue items on it to defer dropping, e.g. from contexts where the entity is not
yet in a world or where spawning entities is not possible.-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor for aDropItemsComponentinstance.DropItemsComponent(List<ItemStack> items) Constructor for aDropItemsComponentinstance holding the given item stacks. -
Method Summary
Modifier and TypeMethodDescriptionclone()static ComponentType<EntityStore, DropItemsComponent> getItems()static voidqueue(Holder<EntityStore> holder, List<ItemStack> itemStacks) Queues item stacks to be dropped by the entity, creating the component if absent.static voidqueue(Ref<EntityStore> ref, CommandBuffer<EntityStore> commandBuffer, List<ItemStack> itemStacks) Queues item stacks to be dropped by the entity, creating the component if absent.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
DropItemsComponent
public DropItemsComponent()Default Constructor for aDropItemsComponentinstance. -
DropItemsComponent
Constructor for aDropItemsComponentinstance holding the given item stacks.- Parameters:
items- The item stacks to drop.
-
-
Method Details
-
getComponentType
- Returns:
- the
DropItemsComponenttype.
-
getItems
-
queue
Queues item stacks to be dropped by the entity, creating the component if absent.- Parameters:
holder- The holder of the entity dropping the items.itemStacks- The item stacks to drop.
-
queue
public static void queue(@Nonnull Ref<EntityStore> ref, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull List<ItemStack> itemStacks) Queues item stacks to be dropped by the entity, creating the component if absent.- Parameters:
ref- The entity reference of the entity dropping the items.commandBuffer- The command buffer to submit the component through.itemStacks- The item stacks to drop.
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-