Class AmadronMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
me.desht.pneumaticcraft.common.inventory.AbstractPneumaticCraftMenu<AbstractPneumaticCraftBlockEntity>
me.desht.pneumaticcraft.common.inventory.AmadronMenu
- All Implemented Interfaces:
IGUIButtonSensitive
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List<AmadronRecipe>final boolean[]intstatic final intstatic final intintFields inherited from class me.desht.pneumaticcraft.common.inventory.AbstractPneumaticCraftMenu
teFields 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
ConstructorsConstructorDescriptionAmadronMenu(int windowId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer) AmadronMenu(int windowId, net.minecraft.world.entity.player.Inventory invPlayer, net.minecraft.world.InteractionHand hand) -
Method Summary
Modifier and TypeMethodDescriptionvoidclickOffer(net.minecraft.resources.ResourceLocation offerId, int mouseButton, boolean shiftPressed, net.minecraft.server.level.ServerPlayer player) Called server-side via PacketAmadronOrderUpdate to handle an offer being clicked.net.minecraft.world.InteractionHandgetHand()intgetShoppingBasketUnits(net.minecraft.resources.ResourceLocation offerId) voidhandleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) booleannet.minecraft.world.item.ItemStackquickMoveStack(net.minecraft.world.entity.player.Player player, int slot) voidremoved(net.minecraft.world.entity.player.Player player) static AmadroneEntityretrieveOrder(String playerName, AmadronRecipe offer, int units, net.minecraft.core.GlobalPos itemGPos, net.minecraft.core.GlobalPos liquidGPos) booleanstillValid(net.minecraft.world.entity.player.Player player) voidupdateBasket(net.minecraft.resources.ResourceLocation offerId, int amount) static booleanvalidateStockLevel(String playerName, AmadronRecipe offer, int units, boolean isAmadronRestock) Methods inherited from class me.desht.pneumaticcraft.common.inventory.AbstractPneumaticCraftMenu
addPlayerSlots, addPlayerSlots, addUpgradeSlots, broadcastChanges, clicked, moveItemStackTo, putHand, updateFieldMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
HARD_MAX_STACKS
public static final int HARD_MAX_STACKS- See Also:
-
HARD_MAX_MB
public static final int HARD_MAX_MB- See Also:
-
activeOffers
-
affordableOffers
public final boolean[] affordableOffers -
problemState
-
maxPlayerOffers
public int maxPlayerOffers -
currentPlayerOffers
public int currentPlayerOffers
-
-
Constructor Details
-
AmadronMenu
public AmadronMenu(int windowId, net.minecraft.world.entity.player.Inventory invPlayer, net.minecraft.world.InteractionHand hand) -
AmadronMenu
public AmadronMenu(int windowId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer)
-
-
Method Details
-
updateBasket
public void updateBasket(net.minecraft.resources.ResourceLocation offerId, int amount) -
isBasketEmpty
public boolean isBasketEmpty() -
getHand
public net.minecraft.world.InteractionHand getHand() -
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Overrides:
stillValidin classAbstractPneumaticCraftMenu<AbstractPneumaticCraftBlockEntity>
-
quickMoveStack
@Nonnull public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player player, int slot) - Overrides:
quickMoveStackin classAbstractPneumaticCraftMenu<AbstractPneumaticCraftBlockEntity>
-
clickOffer
public void clickOffer(net.minecraft.resources.ResourceLocation offerId, int mouseButton, boolean shiftPressed, net.minecraft.server.level.ServerPlayer player) Called server-side via PacketAmadronOrderUpdate to handle an offer being clicked.- Parameters:
offerId- the offer idmouseButton- which mouse buttonshiftPressed- true if shift-clickedplayer- the player
-
handleGUIButtonPress
public void handleGUIButtonPress(String tag, boolean shiftHeld, net.minecraft.server.level.ServerPlayer player) - Specified by:
handleGUIButtonPressin interfaceIGUIButtonSensitive- Overrides:
handleGUIButtonPressin classAbstractPneumaticCraftMenu<AbstractPneumaticCraftBlockEntity>
-
retrieveOrder
public static AmadroneEntity retrieveOrder(String playerName, AmadronRecipe offer, int units, net.minecraft.core.GlobalPos itemGPos, net.minecraft.core.GlobalPos liquidGPos) -
validateStockLevel
public static boolean validateStockLevel(String playerName, AmadronRecipe offer, int units, boolean isAmadronRestock) -
getShoppingBasketUnits
public int getShoppingBasketUnits(net.minecraft.resources.ResourceLocation offerId) -
removed
public void removed(net.minecraft.world.entity.player.Player player) - Overrides:
removedin classnet.minecraft.world.inventory.AbstractContainerMenu
-