SimpleItemContainer

public class SimpleItemContainer extends ItemContainer

Class SimpleItemContainer. Provides simpleitemcontainer functionality for the Hytale server.

java.lang.Object > ItemContainer > SimpleItemContainer

Field Summary

capacity

protected short capacity

Field capacity.

items

protected Short2ObjectMap items

Field items.

globalFilter

private FilterType globalFilter

Field globalFilter.

map

final Int2ObjectConcurrentHashMap map

Field map.

filter

final SlotFilter filter

Field filter.

itemStacks

final ItemStack[] itemStacks

Field itemStacks.

that

final SimpleItemContainer that

Field that.

transaction

final ItemStackTransaction transaction

Field transaction.

remainder

final ItemStack remainder

Field remainder.

Method Detail

SimpleItemContainer

public protected SimpleItemContainer ()

Method SimpleItemContainer.

readAction

protected V readAction (@Nonnull final Supplier action)

Method readAction.

Parameters:
@Nonnull final Supplier action

writeAction

protected V writeAction (@Nonnull final Supplier action)

Method writeAction.

Parameters:
@Nonnull final Supplier action

internal_getSlot

protected ItemStack internal_getSlot (final short slot)

Method internal_getSlot.

Parameters:
final short slot

internal_setSlot

protected ItemStack internal_setSlot (final short slot, final ItemStack itemStack)

Method internal_setSlot.

Parameters:
final short slot
final ItemStack itemStack

internal_removeSlot

protected ItemStack internal_removeSlot (final short slot)

Method internal_removeSlot.

Parameters:
final short slot

cantAddToSlot

protected boolean cantAddToSlot (final short slot, final ItemStack itemStack, final ItemStack slotItemStack)

Method cantAddToSlot.

Parameters:
final short slot
final ItemStack itemStack
final ItemStack slotItemStack

cantRemoveFromSlot

protected boolean cantRemoveFromSlot (final short slot)

Method cantRemoveFromSlot.

Parameters:
final short slot

cantDropFromSlot

protected boolean cantDropFromSlot (final short slot)

Method cantDropFromSlot.

Parameters:
final short slot

cantMoveToSlot

protected boolean cantMoveToSlot (final ItemContainer fromContainer, final short slotFrom)

Method cantMoveToSlot.

Parameters:
final ItemContainer fromContainer
final short slotFrom

testFilter

private boolean testFilter (final FilterActionType actionType, final short slot, final ItemStack itemStack)

Method testFilter.

Parameters:
final FilterActionType actionType
final short slot
final ItemStack itemStack

getCapacity

public short getCapacity ()

Method getCapacity.

internal_clear

protected ClearTransaction internal_clear ()

Method internal_clear.

ClearTransaction

public new ClearTransaction (true, (short)

Method ClearTransaction.

Parameters:
true true
(short (short

clone

public SimpleItemContainer clone ()

Method clone.

isEmpty

public boolean isEmpty ()

Method isEmpty.

setGlobalFilter

public void setGlobalFilter (@Nonnull final FilterType globalFilter)

Method setGlobalFilter.

Parameters:
@Nonnull final FilterType globalFilter

setSlotFilter

public void setSlotFilter (final FilterActionType actionType, final short slot, @Nullable final SlotFilter filter)

Method setSlotFilter.

Parameters:
final FilterActionType actionType
final short slot
@Nullable final SlotFilter filter

Int2ObjectConcurrentHashMap

public new Int2ObjectConcurrentHashMap ()

Method Int2ObjectConcurrentHashMap.

getItemStack

public ItemStack getItemStack (final short slot)

Method getItemStack.

Parameters:
final short slot

equals

public boolean equals (final Object o)

Method equals.

Parameters:
final Object o

hashCode

public int hashCode ()

Method hashCode.

getNewContainer

static ItemContainer getNewContainer (final short capacity)

Method getNewContainer.

Parameters:
final short capacity

addOrDropItemStack

static boolean addOrDropItemStack (@Nonnull final ComponentAccessor store, @Nonnull final Ref ref, @Nonnull final ItemContainer itemContainer, @Nonnull final ItemStack itemStack)

Method addOrDropItemStack.

Parameters:
@Nonnull final ComponentAccessor store
@Nonnull final Ref ref
@Nonnull final ItemContainer itemContainer
@Nonnull final ItemStack itemStack

addOrDropItemStacks

static boolean addOrDropItemStacks (@Nonnull final ComponentAccessor store, @Nonnull final Ref ref, @Nonnull final ItemContainer itemContainer, final List itemStacks)

Method addOrDropItemStacks.

Parameters:
@Nonnull final ComponentAccessor store
@Nonnull final Ref ref
@Nonnull final ItemContainer itemContainer
final List itemStacks

tryAddOrderedOrDropItemStacks

static boolean tryAddOrderedOrDropItemStacks (@Nonnull final ComponentAccessor store, @Nonnull final Ref ref, @Nonnull final ItemContainer itemContainer, final List itemStacks)

Method tryAddOrderedOrDropItemStacks.

Parameters:
@Nonnull final ComponentAccessor store
@Nonnull final Ref ref
@Nonnull final ItemContainer itemContainer
final List itemStacks