ItemComponent

public class ItemComponent implements Component

Component for tracking item state. Attach this component to entities that need to track item data.

java.lang.Object > ItemComponent

Field Summary

itemStack

private ItemStack itemStack

Field itemStack.

isNetworkOutdated

private boolean isNetworkOutdated

Field isNetworkOutdated.

mergeDelay

private float mergeDelay

Field mergeDelay.

pickupDelay

private float pickupDelay

Field pickupDelay.

pickupThrottle

private float pickupThrottle

Field pickupThrottle.

removedByPlayerPickup

private boolean removedByPlayerPickup

Field removedByPlayerPickup.

pickupRange

private float pickupRange

Field pickupRange.

world

final World world

Field world.

defaultConfig

final ItemEntityConfig defaultConfig

Field defaultConfig.

config

final ItemEntityConfig config

Field config.

itemEntityConfig

final ItemEntityConfig itemEntityConfig

Field itemEntityConfig.

ttl

final Float ttl

Field ttl.

item

final Item item

Field item.

blockType

final BlockType blockType

Field blockType.

temp

final boolean temp

Field temp.

randomAngleOffset

final float randomAngleOffset

Field randomAngleOffset.

iterator

final CircleIterator iterator

Field iterator.

circlePos

final Vector3d circlePos

Field circlePos.

itemEntityHolder

final Holder itemEntityHolder

Field itemEntityHolder.

holder

final Holder holder

Field holder.

itemComponent

final ItemComponent itemComponent

Field itemComponent.

tempTtl

final float tempTtl

Field tempTtl.

timeResource

final TimeResource timeResource

Field timeResource.

itemTransformComponent

final TransformComponent itemTransformComponent

Field itemTransformComponent.

itemItemComponent

final ItemComponent itemItemComponent

Field itemItemComponent.

itemHeadRotationComponent

final HeadRotation itemHeadRotationComponent

Field itemHeadRotationComponent.

pickupItemComponent

final PickupItemComponent pickupItemComponent

Field pickupItemComponent.

transaction

final ItemStackTransaction transaction

Field transaction.

remainder

final ItemStack remainder

Field remainder.

quantity

final int quantity

Field quantity.

Method Detail

getComponentType

public ItemComponent> getComponentType ()

Method getComponentType.

ItemComponent

public public ItemComponent ()

Method ItemComponent.

getItemStack

public ItemStack getItemStack ()

Method getItemStack.

setItemStack

public void setItemStack (@Nullable final ItemStack itemStack)

Method setItemStack.

Parameters:
@Nullable final ItemStack itemStack

setPickupDelay

public void setPickupDelay (final float pickupDelay)

Method setPickupDelay.

Parameters:
final float pickupDelay

getPickupRadius

public float getPickupRadius (@Nonnull final ComponentAccessor componentAccessor)

Method getPickupRadius.

Parameters:
@Nonnull final ComponentAccessor componentAccessor

computeLifetimeSeconds

public float computeLifetimeSeconds (@Nonnull final ComponentAccessor componentAccessor)

Method computeLifetimeSeconds.

Parameters:
@Nonnull final ComponentAccessor componentAccessor

computeDynamicLight

public ColorLight computeDynamicLight ()

Method computeDynamicLight.

if

public else if (item.getLight()

Method if.

Parameters:
item.getLight( item.getLight(

pollPickupDelay

public boolean pollPickupDelay (final float dt)

Method pollPickupDelay.

Parameters:
final float dt

pollPickupThrottle

public boolean pollPickupThrottle (final float dt)

Method pollPickupThrottle.

Parameters:
final float dt

pollMergeDelay

public boolean pollMergeDelay (final float dt)

Method pollMergeDelay.

Parameters:
final float dt

canPickUp

public boolean canPickUp ()

Method canPickUp.

isRemovedByPlayerPickup

public boolean isRemovedByPlayerPickup ()

Method isRemovedByPlayerPickup.

setRemovedByPlayerPickup

public void setRemovedByPlayerPickup (final boolean removedByPlayerPickup)

Method setRemovedByPlayerPickup.

Parameters:
final boolean removedByPlayerPickup

consumeNetworkOutdated

public boolean consumeNetworkOutdated ()

Method consumeNetworkOutdated.

clone

public ItemComponent clone ()

Method clone.

generateItemDrops

static Holder[] generateItemDrops (@Nonnull final ComponentAccessor accessor, @Nonnull final List itemStacks, @Nonnull final Vector3d position, @Nonnull final Vector3f rotation)

Method generateItemDrops.

Parameters:
@Nonnull final ComponentAccessor accessor
@Nonnull final List itemStacks
@Nonnull final Vector3d position
@Nonnull final Vector3f rotation

CircleIterator

public new CircleIterator (Vector3d.ZERO, 3.0, itemStacks.size()

Method CircleIterator.

Parameters:
Vector3d.ZERO Vector3d.ZERO
3.0 3.0
itemStacks.size( itemStacks.size(

generateItemDrop

public return generateItemDrop (accessor, item, position, rotation, (float)

Method generateItemDrop.

Parameters:
accessor accessor
item item
position position
rotation rotation
(float (float

TransformComponent

public new TransformComponent (position, rotation)

Method TransformComponent.

Parameters:
position position
rotation rotation

generatePickedUpItem

static Holder generatePickedUpItem (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor, @Nonnull final Ref targetRef, @Nonnull final Vector3d targetPosition)

Method generatePickedUpItem.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentAccessor componentAccessor
@Nonnull final Ref targetRef
@Nonnull final Vector3d targetPosition

PickupItemComponent

public new PickupItemComponent (targetRef, targetPosition.clone()

Method PickupItemComponent.

Parameters:
targetRef targetRef
targetPosition.clone( targetPosition.clone(

NetworkId

public new NetworkId (ref.getStore()

Method NetworkId.

Parameters:
ref.getStore( ref.getStore(

addToItemContainer

static ItemStack addToItemContainer (@Nonnull final Store store, @Nonnull final Ref itemRef, @Nonnull final ItemContainer itemContainer)

Method addToItemContainer.

Parameters:
@Nonnull final Store store
@Nonnull final Ref itemRef
@Nonnull final ItemContainer itemContainer