Class WirelessGrid
java.lang.Object
com.refinedmods.refinedstorage.blockentity.grid.WirelessGrid
- All Implemented Interfaces:
IGrid
,INetworkAwareGrid
-
Field Summary
Fields inherited from interface com.refinedmods.refinedstorage.api.network.grid.IGrid
SEARCH_BOX_MODE_JEI_SYNCHRONIZED, SEARCH_BOX_MODE_JEI_SYNCHRONIZED_2WAY, SEARCH_BOX_MODE_JEI_SYNCHRONIZED_2WAY_AUTOSELECTED, SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED, SEARCH_BOX_MODE_NORMAL, SEARCH_BOX_MODE_NORMAL_AUTOSELECTED, SIZE_LARGE, SIZE_MEDIUM, SIZE_SMALL, SIZE_STRETCH, SORTING_DIRECTION_ASCENDING, SORTING_DIRECTION_DESCENDING, SORTING_TYPE_ID, SORTING_TYPE_LAST_MODIFIED, SORTING_TYPE_NAME, SORTING_TYPE_QUANTITY, TABS_PER_PAGE, VIEW_TYPE_CRAFTABLES, VIEW_TYPE_NON_CRAFTABLES, VIEW_TYPE_NORMAL
-
Constructor Summary
ConstructorDescriptionWirelessGrid
(net.minecraft.world.item.ItemStack stack, net.minecraft.server.MinecraftServer server, PlayerSlot slot) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCraftingListener
(ICraftingGridListener listener) createListener
(net.minecraft.server.level.ServerPlayer player) net.minecraft.world.inventory.CraftingContainer
net.minecraft.world.inventory.ResultContainer
net.neoforged.neoforge.items.IItemHandlerModifiable
int
int
getSize()
int
int
int
net.minecraft.world.item.ItemStack
getStack()
int
getTabs()
int
net.minecraft.network.chat.Component
getTitle()
int
int
boolean
void
onClear
(net.minecraft.world.entity.player.Player player) Called when the clear button is pressed in the pattern grid or crafting grid.void
onClosed
(net.minecraft.world.entity.player.Player player) Called when the grid is closed.void
onCrafted
(net.minecraft.world.entity.player.Player player, IStackList<net.minecraft.world.item.ItemStack> availableItems, IStackList<net.minecraft.world.item.ItemStack> usedItems) Called when an item is crafted in a crafting grid.void
onCraftedShift
(net.minecraft.world.entity.player.Player player) Called when an item is crafted with shift click (up to 64 items) in a crafting grid.void
Called when the crafting matrix changes.void
onRecipeTransfer
(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack[][] recipe) Called when a JEI recipe transfer occurs.void
onSearchBoxModeChanged
(int searchBoxMode) void
onSizeChanged
(int size) void
onSortingDirectionChanged
(int direction) void
onSortingTypeChanged
(int type) void
onTabPageChanged
(int page) void
onTabSelectionChanged
(int tab) void
onViewTypeChanged
(int type) void
removeCraftingListener
(ICraftingGridListener listener)
-
Constructor Details
-
WirelessGrid
public WirelessGrid(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.server.MinecraftServer server, PlayerSlot slot)
-
-
Method Details
-
getStack
public net.minecraft.world.item.ItemStack getStack() -
getGridType
- Specified by:
getGridType
in interfaceIGrid
- Returns:
- the grid type
-
getNetwork
- Specified by:
getNetwork
in interfaceINetworkAwareGrid
- Returns:
- the network, or null if no network is available
-
createListener
- Specified by:
createListener
in interfaceIGrid
- Parameters:
player
- the player to create a listener for- Returns:
- a listener for this grid, will be attached to the storage cache in
IGrid.getStorageCache()
-
getStorageCache
- Specified by:
getStorageCache
in interfaceIGrid
- Returns:
- the storage cache for this grid, or null if this grid is unavailable
-
getItemHandler
- Specified by:
getItemHandler
in interfaceIGrid
- Returns:
- the item grid handler, or null if there is no handler available
-
getFluidHandler
- Specified by:
getFluidHandler
in interfaceIGrid
- Returns:
- the fluid grid handler, or null if there is no handler available
-
addCraftingListener
- Specified by:
addCraftingListener
in interfaceIGrid
- Parameters:
listener
- the listener
-
removeCraftingListener
- Specified by:
removeCraftingListener
in interfaceIGrid
- Parameters:
listener
- the listener
-
getTitle
public net.minecraft.network.chat.Component getTitle() -
getViewType
public int getViewType()- Specified by:
getViewType
in interfaceIGrid
- Returns:
- the view type
-
getSortingType
public int getSortingType()- Specified by:
getSortingType
in interfaceIGrid
- Returns:
- the sorting type
-
getSortingDirection
public int getSortingDirection()- Specified by:
getSortingDirection
in interfaceIGrid
- Returns:
- the sorting direction
-
getSearchBoxMode
public int getSearchBoxMode()- Specified by:
getSearchBoxMode
in interfaceIGrid
- Returns:
- the search box mode
-
getTabSelected
public int getTabSelected()- Specified by:
getTabSelected
in interfaceIGrid
- Returns:
- the current tab that is selected
-
getTabPage
public int getTabPage()- Specified by:
getTabPage
in interfaceIGrid
- Returns:
- the current page that the tab is on
-
getTotalTabPages
public int getTotalTabPages()- Specified by:
getTotalTabPages
in interfaceIGrid
- Returns:
- the total amount of tab pages
-
getSize
public int getSize() -
onViewTypeChanged
public void onViewTypeChanged(int type) - Specified by:
onViewTypeChanged
in interfaceIGrid
- Parameters:
type
- the new view type
-
onSortingTypeChanged
public void onSortingTypeChanged(int type) - Specified by:
onSortingTypeChanged
in interfaceIGrid
- Parameters:
type
- the new sorting type
-
onSortingDirectionChanged
public void onSortingDirectionChanged(int direction) - Specified by:
onSortingDirectionChanged
in interfaceIGrid
- Parameters:
direction
- the new direction
-
onSearchBoxModeChanged
public void onSearchBoxModeChanged(int searchBoxMode) - Specified by:
onSearchBoxModeChanged
in interfaceIGrid
- Parameters:
searchBoxMode
- the new search box mode
-
onSizeChanged
public void onSizeChanged(int size) - Specified by:
onSizeChanged
in interfaceIGrid
- Parameters:
size
- the new size mode
-
onTabSelectionChanged
public void onTabSelectionChanged(int tab) - Specified by:
onTabSelectionChanged
in interfaceIGrid
- Parameters:
tab
- the new selected tab
-
onTabPageChanged
public void onTabPageChanged(int page) - Specified by:
onTabPageChanged
in interfaceIGrid
- Parameters:
page
- the new selected page
-
getFilters
- Specified by:
getFilters
in interfaceIGrid
- Returns:
- the filters
-
getTabs
-
getFilter
public net.neoforged.neoforge.items.IItemHandlerModifiable getFilter() -
getCraftingMatrix
public net.minecraft.world.inventory.CraftingContainer getCraftingMatrix()- Specified by:
getCraftingMatrix
in interfaceIGrid
- Returns:
- the crafting matrix, or null if not a crafting grid
-
getCraftingResult
public net.minecraft.world.inventory.ResultContainer getCraftingResult()- Specified by:
getCraftingResult
in interfaceIGrid
- Returns:
- the crafting result inventory, or null if not a crafting grid
-
onCraftingMatrixChanged
public void onCraftingMatrixChanged()Description copied from interface:IGrid
Called when the crafting matrix changes.- Specified by:
onCraftingMatrixChanged
in interfaceIGrid
-
onCrafted
public void onCrafted(net.minecraft.world.entity.player.Player player, @Nullable IStackList<net.minecraft.world.item.ItemStack> availableItems, @Nullable IStackList<net.minecraft.world.item.ItemStack> usedItems) Description copied from interface:IGrid
Called when an item is crafted in a crafting grid. -
onClear
public void onClear(net.minecraft.world.entity.player.Player player) Description copied from interface:IGrid
Called when the clear button is pressed in the pattern grid or crafting grid. -
onCraftedShift
public void onCraftedShift(net.minecraft.world.entity.player.Player player) Description copied from interface:IGrid
Called when an item is crafted with shift click (up to 64 items) in a crafting grid.- Specified by:
onCraftedShift
in interfaceIGrid
- Parameters:
player
- the player that crafted the item
-
onRecipeTransfer
public void onRecipeTransfer(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack[][] recipe) Description copied from interface:IGrid
Called when a JEI recipe transfer occurs.- Specified by:
onRecipeTransfer
in interfaceIGrid
- Parameters:
player
- the playerrecipe
- a 9*x array stack array, where x is the possible combinations for the given slot
-
isGridActive
public boolean isGridActive()- Specified by:
isGridActive
in interfaceIGrid
- Returns:
- true if the grid is active, false otherwise
-
getSlotId
public int getSlotId() -
onClosed
public void onClosed(net.minecraft.world.entity.player.Player player) Description copied from interface:IGrid
Called when the grid is closed.
-