Package de.ellpeck.rockbottom.api.item
Class StorageContainerItem
java.lang.Object
de.ellpeck.rockbottom.api.item.Item
de.ellpeck.rockbottom.api.item.BasicItem
de.ellpeck.rockbottom.api.item.StorageContainerItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionStorageContainerItem(ResourceName name, int maxStorage) StorageContainerItem(ResourceName name, int maxStorage, int containerWidth) -
Method Summary
Modifier and TypeMethodDescriptionintintstatic InventorygetItemInventory(ItemInstance instance) doublegetMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) intbooleanonInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) protected voidopenStorageContainer(AbstractPlayerEntity player, ItemInstance instance) static voidsetItemInventory(ItemInstance instance, Inventory inventory) Methods inherited from class de.ellpeck.rockbottom.api.item.BasicItem
createRenderer, getRendererMethods inherited from class de.ellpeck.rockbottom.api.item.Item
attacksMultipleEntities, canHoldButtonToAttack, describeItem, getAttackCooldown, getAttackDamage, getCustomAttackableEntities, getDespawnTime, getHighestPossibleMeta, getInteractionPriority, getLocalizedName, getMaxAmount, getMiningSpeed, getName, getToolProperties, getUnlocalizedName, hasToolProperty, isDataSensitive, onEntityAttack, onInteractWithDestKey, onTileBroken, register, setMaxAmount, takeDamage, takeDamage, toString, useMetaAsDurability
-
Field Details
-
maxStorage
protected final int maxStorage -
containerWidth
protected final int containerWidth
-
-
Constructor Details
-
StorageContainerItem
-
StorageContainerItem
-
-
Method Details
-
onInteractWith
public boolean onInteractWith(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) - Overrides:
onInteractWithin classItem
-
getMaxInteractionDistance
public double getMaxInteractionDistance(IWorld world, int x, int y, TileLayer layer, double mouseX, double mouseY, AbstractPlayerEntity player, ItemInstance instance) - Overrides:
getMaxInteractionDistancein classItem
-
getMaxStorage
public int getMaxStorage() -
getContainerWidth
public int getContainerWidth() -
getContainerHeight
public int getContainerHeight() -
openStorageContainer
-
getItemInventory
- Parameters:
instance- The item instance.- Returns:
- The inventory with the items from the instance,
or null if instance is not instance of
StorageContainerItem.
-
setItemInventory
- Parameters:
instance- The item instance.inventory- The inventory to set or null if instance is not instance ofStorageContainerItem.
-