Class ContainerExtended
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
org.cyclops.cyclopscore.inventory.container.ContainerExtended
- All Implemented Interfaces:
IContainerButtonClickAcceptorServer<ContainerExtended>,IValueNotifiable,IValueNotifier
- Direct Known Subclasses:
InventoryContainer,ItemInventoryContainer
@Deprecated
public abstract class ContainerExtended
extends net.minecraft.world.inventory.AbstractContainerMenu
implements IContainerButtonClickAcceptorServer<ContainerExtended>, IValueNotifier, IValueNotifiable
Deprecated.
A container with inventory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intDeprecated.protected intDeprecated.protected intDeprecated.protected final net.minecraft.world.entity.player.PlayerDeprecated.Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsConstructorDescriptionContainerExtended(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inventory) Deprecated.Make a new ContainerExtended. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddInventory(net.minecraft.world.Container inventory, int indexOffset, int offsetX, int offsetY, int rows, int cols) Deprecated.protected voidaddPlayerArmorInventory(net.minecraft.world.entity.player.Inventory inventory, int offsetX, int offsetY) Deprecated.Add player armor inventory to the GUI.protected voidaddPlayerInventory(net.minecraft.world.entity.player.Inventory inventory, int offsetX, int offsetY) Deprecated.Add player inventory and hotbar to the GUI.protected net.minecraft.world.inventory.SlotaddSlot(net.minecraft.world.inventory.Slot slot) Deprecated.voidaddSlotListener(net.minecraft.world.inventory.ContainerListener listener) Deprecated.protected voidadjustPhantomSlot(net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType) Deprecated.voidDeprecated.voidclicked(int slotId, int dragType, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player) Deprecated.protected net.minecraft.world.inventory.SlotcreateNewSlot(net.minecraft.world.Container inventory, int index, int x, int y) Deprecated.protected voidfillPhantomSlot(net.minecraft.world.inventory.Slot slot, net.minecraft.world.item.ItemStack stackHeld, int mouseButton, net.minecraft.world.inventory.ClickType clickType) Deprecated.net.minecraft.core.HolderLookup.ProviderDeprecated.protected intDeprecated.net.minecraft.world.entity.player.InventoryDeprecated.Get the inventory of the player for which this container is instantiated.protected abstract intDeprecated.protected intgetSlotRange(int originSlot, int slotRange, boolean reverse) Deprecated.protected intgetSlotStart(int originSlot, int slotStart, boolean reverse) Deprecated.net.minecraft.nbt.CompoundTaggetValue(int valueId) Deprecated.Get the value for the given value id.Deprecated.net.minecraft.world.inventory.MenuType<?> Deprecated.protected voidDeprecated.This is the place to initialize values server-side so that they can be sent to the client for the first time.protected booleanmoveItemStackTo(net.minecraft.world.item.ItemStack stack, int slotStart, int slotRange, boolean reverse) Deprecated.booleanonButtonClick(String buttonId) Deprecated.When the button is clicked, both server and client side.voidonUpdate(int valueId, net.minecraft.nbt.CompoundTag value) Deprecated.Called by the server if the value has changed.voidputButtonAction(String buttonId, IContainerButtonAction<ContainerExtended> action) Deprecated.Set a button action.net.minecraft.world.item.ItemStackquickMoveStack(net.minecraft.world.entity.player.Player player, int slotID) Deprecated.<T> Supplier<T> registerSyncedVariable(Class<T> clazz, Supplier<T> serverValueSupplier) Deprecated.Register the given variable for automatically sychronizing between client and server.protected voidDeprecated.voidsetGuiValueListener(IValueNotifiable listener) Deprecated.Set the listener that will be triggered when a value in this container is updated by the server.static voidsetSlotPosX(net.minecraft.world.inventory.Slot slot, int newValue) Deprecated.static voidsetSlotPosY(net.minecraft.world.inventory.Slot slot, int newValue) Deprecated.voidsetValue(int valueId, net.minecraft.nbt.CompoundTag value) Deprecated.Set the value for given value id.Methods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, createCarriedSlotAccess, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removed, removeSlotListener, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
ITEMBOX
protected static final int ITEMBOXDeprecated.- See Also:
-
player
protected final net.minecraft.world.entity.player.Player playerDeprecated. -
offsetX
protected int offsetXDeprecated. -
offsetY
protected int offsetYDeprecated.
-
-
Constructor Details
-
ContainerExtended
public ContainerExtended(@Nullable net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory inventory) Deprecated.Make a new ContainerExtended.- Parameters:
type- The container type.id- The container id.inventory- The player inventory.
-
-
Method Details
-
broadcastChanges
public void broadcastChanges()Deprecated.- Overrides:
broadcastChangesin classnet.minecraft.world.inventory.AbstractContainerMenu
-
setGuiValueListener
Deprecated.Set the listener that will be triggered when a value in this container is updated by the server.- Parameters:
listener- The listener that will be triggered.
-
getHolderLookupProvider
public net.minecraft.core.HolderLookup.Provider getHolderLookupProvider()Deprecated.- Specified by:
getHolderLookupProviderin interfaceIValueNotifier
-
addSlotListener
public void addSlotListener(net.minecraft.world.inventory.ContainerListener listener) Deprecated.- Overrides:
addSlotListenerin classnet.minecraft.world.inventory.AbstractContainerMenu
-
initializeValues
protected void initializeValues()Deprecated.This is the place to initialize values server-side so that they can be sent to the client for the first time. This is only called on the server. Make sure not to initialize the value id's here, but do that inside the constructor, because these must be equal for client and server. -
createNewSlot
protected net.minecraft.world.inventory.Slot createNewSlot(net.minecraft.world.Container inventory, int index, int x, int y) Deprecated. -
setSlotPosX
public static void setSlotPosX(net.minecraft.world.inventory.Slot slot, int newValue) Deprecated. -
setSlotPosY
public static void setSlotPosY(net.minecraft.world.inventory.Slot slot, int newValue) Deprecated. -
addSlot
protected net.minecraft.world.inventory.Slot addSlot(net.minecraft.world.inventory.Slot slot) Deprecated.- Overrides:
addSlotin classnet.minecraft.world.inventory.AbstractContainerMenu
-
addInventory
protected void addInventory(net.minecraft.world.Container inventory, int indexOffset, int offsetX, int offsetY, int rows, int cols) Deprecated. -
addPlayerInventory
protected void addPlayerInventory(net.minecraft.world.entity.player.Inventory inventory, int offsetX, int offsetY) Deprecated.Add player inventory and hotbar to the GUI.- Parameters:
inventory- Inventory of the playeroffsetX- Offset to XoffsetY- Offset to Y
-
addPlayerArmorInventory
protected void addPlayerArmorInventory(net.minecraft.world.entity.player.Inventory inventory, int offsetX, int offsetY) Deprecated.Add player armor inventory to the GUI.- Parameters:
inventory- Inventory of the playeroffsetX- Offset to XoffsetY- Offset to Y
-
getSizeInventory
protected abstract int getSizeInventory()Deprecated. -
getSlotStart
protected int getSlotStart(int originSlot, int slotStart, boolean reverse) Deprecated. -
getSlotRange
protected int getSlotRange(int originSlot, int slotRange, boolean reverse) Deprecated. -
quickMoveStack
public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player player, int slotID) Deprecated.- Specified by:
quickMoveStackin classnet.minecraft.world.inventory.AbstractContainerMenu
-
moveItemStackTo
protected boolean moveItemStackTo(net.minecraft.world.item.ItemStack stack, int slotStart, int slotRange, boolean reverse) Deprecated.- Overrides:
moveItemStackToin classnet.minecraft.world.inventory.AbstractContainerMenu
-
getPlayerIInventory
public net.minecraft.world.entity.player.Inventory getPlayerIInventory()Deprecated.Get the inventory of the player for which this container is instantiated.- Returns:
- The player inventory.
-
clicked
public void clicked(int slotId, int dragType, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player) Deprecated.- Overrides:
clickedin classnet.minecraft.world.inventory.AbstractContainerMenu
-
resetQuickCraft
protected void resetQuickCraft()Deprecated.- Overrides:
resetQuickCraftin classnet.minecraft.world.inventory.AbstractContainerMenu
-
adjustPhantomSlot
protected void adjustPhantomSlot(net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType) Deprecated. -
fillPhantomSlot
protected void fillPhantomSlot(net.minecraft.world.inventory.Slot slot, net.minecraft.world.item.ItemStack stackHeld, int mouseButton, net.minecraft.world.inventory.ClickType clickType) Deprecated. -
putButtonAction
Deprecated.Description copied from interface:IContainerButtonClickAcceptorServerSet a button action. The used button id should correspond to id that was used to create the button's pressable in the gui.- Specified by:
putButtonActionin interfaceIContainerButtonClickAcceptorServer<ContainerExtended>- Parameters:
buttonId- The button id.action- The action to set for the given button id.
-
onButtonClick
Deprecated.Description copied from interface:IContainerButtonClickAcceptorServerWhen the button is clicked, both server and client side.- Specified by:
onButtonClickin interfaceIContainerButtonClickAcceptorServer<ContainerExtended>- Parameters:
buttonId- The button id.- Returns:
- If an action was found and executed.
-
getNextValueId
protected int getNextValueId()Deprecated.- Returns:
- The next unique value id.
-
setValue
public void setValue(int valueId, net.minecraft.nbt.CompoundTag value) Deprecated.Description copied from interface:IValueNotifierSet the value for given value id. This will send a packet if it has changed. If called on the client, a packet to the server will be sent. If called on the server, a packet to the client will be sent.- Specified by:
setValuein interfaceIValueNotifier- Parameters:
valueId- The value id.value- The new value.
-
getValue
public net.minecraft.nbt.CompoundTag getValue(int valueId) Deprecated.Description copied from interface:IValueNotifierGet the value for the given value id.- Specified by:
getValuein interfaceIValueNotifier- Parameters:
valueId- The value id.- Returns:
- The value or null.
-
getValueIds
Deprecated.- Specified by:
getValueIdsin interfaceIValueNotifier- Returns:
- All available value ids.
-
getValueNotifiableType
public net.minecraft.world.inventory.MenuType<?> getValueNotifiableType()Deprecated.- Specified by:
getValueNotifiableTypein interfaceIValueNotifiable- Returns:
- The container type.
-
onUpdate
public void onUpdate(int valueId, net.minecraft.nbt.CompoundTag value) Deprecated.Description copied from interface:IValueNotifiableCalled by the server if the value has changed.- Specified by:
onUpdatein interfaceIValueNotifiable- Parameters:
valueId- The value id.value- The new value.
-
registerSyncedVariable
Deprecated.Register the given variable for automatically sychronizing between client and server. This method should be called in the constructor of a container, and the resulting supplier should be stored. This resulting supplier can be called at any time by the client to lookup values.- Type Parameters:
T- The variable type.- Parameters:
clazz- The class of the variable to sync.serverValueSupplier- A supplier for the server-side variable value.- Returns:
- A supplier that can be called for retrieving the value.
-