Creates a new instance of UI.Container.
Creates a new instance of UI.Container and initializes it's parent.
See UI.Container.setParent for details.
Drops the contents of all the slots in the container on the specified coordinates and clears them.
Client only, use BlockSource.spawnDroppedItem instead.
Drops slot's contents on the specified coordinates and clears the slot.
slot name
Client only, use BlockSource.spawnDroppedItem instead.
Gets any value from the element.
element name
binding name, you can access the value from the element by this name. Some binding names are reserved for additional element information, e.g. "element_obj" contains pointer to the current object and "element_rect" contains android.graphics.Rect object containing drawing rectangle
Value that was get from the element or null
if the
element doesn't exist.
slot index
Workbench slot instance by slot index.
Window's content object (usually specified in the window's
constructor) if a window was opened in the container, null
otherwise.
Getter for UI.Container.parent field.
Currently opened UI.IWindow
or null
if no window is currently opened in the container.
Forces ui elements and drawables of the window to refresh.
if true
, the drawables will be refreshed
immediately, otherwise refresh event will be posted; ensure you are
in the UI thread if you pass true
as the parameter
Forces ui elements and drawables of the window to refresh.
Forces ui drawables of the window to refresh.
if true
, the drawables will be refreshed
immediately, otherwise refresh event will be posted; ensure you are
in the UI thread if you pass true
as the parameter
Forces ui elements of the window to refresh.
if true
, the drawables will be refreshed
immediately, otherwise refresh event will be posted; ensure you are
in the UI thread if you pass true
as the parameter
Forces ui elements of the window to refresh.
Opens UI.IWindow object in the container.
UI.IWindow object to be opened
Sets an object to be notified when the window is closed.
object to be notified when the window is closed
Sets an object to be notified when the window is opened.
object to be notified when the window is opened
Sets container's parent object, for TileEntity's container it should be a TileEntity reference, otherwise you can pass any value to be used in your code later.
an object to be set as container's parent
Set slot's content by it's name. If a slot with specified name doesn't exists, creates an empty one with specified name and item.
slot name
Set slot's content by it's name. If a slot with specified name doesn't exists, creates new with specified name and item.
slot name
item extra value; note that it should be an instance of ItemExtraData and not it's numeric ID
If the container is a custom workbench, you can set the slot prefix
via this method call. UI.Container.getFieldSlot
will get field slot by prefix + slot
name.
custom workbench slot prefix
If container is a part of TileEntity, this field stores reference to it, otherwise null. You can also assign any value of any type to it using UI.Container.setParent method or using constructor parameter. Consider using UI.Container.getParent instead of direct field access.
Same as UI.Container.parent.
Static
Readonly
isCopyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.
Containers are used to properly manipulate windows and save slots contents and windows state between window opens. Every TileEntity has a built-in container that can be accessed as TileEntity.container.
Remarks
This is a legacy container that does not synchronize between clients and server. It should be used to store data on one side either server or client.