Package alexiil.mc.lib.multipart.api
Interface AbstractPart.ItemDropTarget
- Enclosing class:
- AbstractPart
public static interface AbstractPart.ItemDropTarget
A target for retrieving item drops from
AbstractPart.addDrops(ItemDropTarget, LootContext)
. This will
either spawn the dropped items into the world, or add them to a list, depending on what method called it.-
Method Summary
Modifier and Type Method Description void
drop(net.minecraft.item.ItemStack stack)
Drops the given itemstack, using a default position and velocity.void
drop(net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d pos)
Drops the givenItemStack
, using the given position and a random velocity.void
drop(net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d pos, net.minecraft.util.math.Vec3d velocity)
IfdropsAsEntity()
is false then this ignores the position and velocity.default void
dropAll(java.lang.Iterable<net.minecraft.item.ItemStack> iter)
boolean
dropsAsEntity()
-
Method Details
-
drop
void drop(net.minecraft.item.ItemStack stack)Drops the given itemstack, using a default position and velocity. -
dropAll
default void dropAll(java.lang.Iterable<net.minecraft.item.ItemStack> iter) -
drop
void drop(net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d pos)Drops the givenItemStack
, using the given position and a random velocity. This will also split the stack up randomly, like how vanilla splits stacks. -
drop
void drop(net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d pos, net.minecraft.util.math.Vec3d velocity)IfdropsAsEntity()
is false then this ignores the position and velocity. Otherwise, this drops the givenItemStack
directly at the given position, using the exact given velocity. This won't split the stack up. -
dropsAsEntity
boolean dropsAsEntity()- Returns:
- True if the position and velocity of the
ItemStack
will be used.
-