Class InventoryPixelmon<T extends net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen & InventoryPixelmonBase>
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.inventory.InventoryPixelmon<T>
public class InventoryPixelmon<T extends net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen & InventoryPixelmonBase>
extends Object
Changes the Minecraft inventory GUI to include a Pokémon party.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cursorOverCharmsDrawerCloser
(double mouseX, double mouseY, int bX, int bY) Determines if the cursor is hovering over the right-pointing arrow that closes the charms drawer.boolean
cursorOverCharmsDrawerOpener
(double mouseX, double mouseY, int bX, int bY) Determines if the cursor is hovering over the left-pointing arrow that opens the charms drawer.boolean
cursorOverLureSlot
(double mouseX, double mouseY) Determines if the cursor is hovering over the lure slot.boolean
cursorOverPokemonSlot
(double mouseX, double mouseY, int slotX, int slotY) Determines if the cursor is hovering over the slot of a Pokémon.boolean
cursorWithinXBoundsOfCharms
(double mouseX, int bX) Determines if the x position of the cursor lines up within the column of charms in the charms drawer of Pixelmon's extended inventory screen.void
drawCharmsInCharmsDrawer
(net.minecraft.client.gui.GuiGraphics graphics, int bX, int bY) Renders the sprites of the charms in the charms drawer of the Pixelmon Extended Screen.void
drawGuiContainerBackgroundLayer
(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Draws the GUI background.void
drawLureSlotHighlighted
(net.minecraft.client.gui.GuiGraphics graphics) Render the lure slot as highlighted.void
drawPokemonSlot
(net.minecraft.client.gui.GuiGraphics graphics, SlotInventoryPixelmon slot, Pokemon pokemon) Renders whether this player's party is in temporary mode, the sprite of a Pokémon, the sprite of that Pokémon's held item, and the highlight inside the four corners of a slot indicating what slot has been selected.int
int
int
getSlotClicked
(double mouseX, double mouseY) net.minecraft.world.item.ItemStack
handleAddingItems
(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack currentItem) Add an item to a Pokémon via the Minecraft Inventory Menu.boolean
Determines what item the cursor might be holding, what lure might be in the lure slot, and calls functions to add, remove or swap items for the lure slot.void
handleDrawingCharmsDrawer
(net.minecraft.client.gui.GuiGraphics graphics, double mouseX, double mouseY, int bX, int bY) Renders the grey background of the charms drawer based on whether it has been opened or closed.void
handleDrawingLureSlotHighlighted
(net.minecraft.client.gui.GuiGraphics graphics, double mouseX, double mouseY) Handles checking if the cursor is over the lure slot and then rendering the lure slot as highlighted.void
handleDrawingPokemonSlots
(net.minecraft.client.gui.GuiGraphics graphics) Loops through all the Pokémon slots available to call the function that renders each Pokémon.void
handlePokemonHeldItems
(StoragePosition position, Pokemon pokemon) Handles setting up what items the cursor and Pokémon are carrying, and whether the cursor will add, remove, or swap their item with the Pokémon's.void
handleRemovingItems
(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack oldItem) Removes an item from a Pokémon via the Minecraft Inventory Menu.boolean
handleSelectingPokemonSlots
(double mouseX, double mouseY, int mouseButton) Determines whether the player left- or right-clicked a Pokémon's slot in the Minecraft Inventory and handles swapping Pokémon, switching items, or getting the PokeChecker (Pokémon Summary stuff).void
handleSwappingItems
(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack currentItem, net.minecraft.world.item.ItemStack oldItem) Handles giving, removing, or swapping the item a Pokémon is holding while the cursor is holding an item.void
initGui()
Initializes the GUI.boolean
boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) Handles mouse input.protected void
newPokechecker
(int x, int y, Pokemon[] pokemon) void
pickUpLureInLureSlot
(net.minecraft.world.item.ItemStack lure) Takes the lure that is currently in the player's lure slot and sets it as being carried by the cursor.void
placeLureInLureSlot
(net.minecraft.world.item.ItemStack held, boolean creative) Places the lure being carried by the cursor in the lure slot.void
render
(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) Draws the GUI screen.void
setSelected
(StoragePosition selected) void
swapLureInLureSlotWithHeldLure
(net.minecraft.world.item.ItemStack held, net.minecraft.world.item.ItemStack lure, boolean creative) Takes the lure that is currently in the player's lure slot and swaps it with the lure being carried by the cursor.void
tick()
boolean
toggleCharms
(double mouseY, int bY) Turns on or turns off the player's charms.
-
Constructor Details
-
InventoryPixelmon
Opens the party GUI.- Parameters:
gui
- The GUI to render on.partyWidth
- The width of the party GUI.
-
-
Method Details
-
initGui
public void initGui()Initializes the GUI. -
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) Draws the GUI screen.- Parameters:
mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.partialTicks
- The current amount of partial ticks.
-
drawGuiContainerBackgroundLayer
public void drawGuiContainerBackgroundLayer(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Draws the GUI background.- Parameters:
partialTicks
- The current amount of partial ticks.mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) Handles mouse input.- Parameters:
mouseX
- The mouseX coordinate of the mouse.mouseY
- The mouseY coordinate of the mouse.mouseButton
- The mouse button that was clicked.- Returns:
- Whether to execute normal inventory mouse input.
-
tick
public void tick() -
getSlotClicked
public int getSlotClicked(double mouseX, double mouseY) -
newPokechecker
-
getSelected
-
setSelected
-
isDrawerOut
public boolean isDrawerOut() -
getDrawerOffset
public int getDrawerOffset() -
getPartyWidth
public int getPartyWidth() -
cursorOverPokemonSlot
public boolean cursorOverPokemonSlot(double mouseX, double mouseY, int slotX, int slotY) Determines if the cursor is hovering over the slot of a Pokémon.- Parameters:
mouseX
- The cursor's x position.mouseY
- The cursor's y position.slotX
- The slot's x position.slotY
- The slot's y position.- Returns:
- Whether the cursor is within the x and y boundaries of the slot of a Pokémon.
-
handleDrawingPokemonSlots
public void handleDrawingPokemonSlots(net.minecraft.client.gui.GuiGraphics graphics) Loops through all the Pokémon slots available to call the function that renders each Pokémon.- Parameters:
graphics
- The PoseStack context.
-
drawPokemonSlot
public void drawPokemonSlot(net.minecraft.client.gui.GuiGraphics graphics, SlotInventoryPixelmon slot, Pokemon pokemon) Renders whether this player's party is in temporary mode, the sprite of a Pokémon, the sprite of that Pokémon's held item, and the highlight inside the four corners of a slot indicating what slot has been selected.- Parameters:
graphics
- The PoseStack context.slot
- The square in the player's inventory representing the party position of a Pokémon.pokemon
- The Pokémon being rendered.
-
handleDrawingLureSlotHighlighted
public void handleDrawingLureSlotHighlighted(net.minecraft.client.gui.GuiGraphics graphics, double mouseX, double mouseY) Handles checking if the cursor is over the lure slot and then rendering the lure slot as highlighted.- Parameters:
graphics
- The PoseStack context.mouseX
- The cursor's x position.mouseY
- The cursor's y position.
-
cursorOverLureSlot
public boolean cursorOverLureSlot(double mouseX, double mouseY) Determines if the cursor is hovering over the lure slot.- Parameters:
mouseX
- The cursor's x position.mouseY
- The cursor's y position.- Returns:
- Whether the cursor is within the x and y boundaries of the lure slot.
-
handleClickingLureSlot
public boolean handleClickingLureSlot()Determines what item the cursor might be holding, what lure might be in the lure slot, and calls functions to add, remove or swap items for the lure slot.- Returns:
- Whether the click will not be consumed.
-
drawLureSlotHighlighted
public void drawLureSlotHighlighted(net.minecraft.client.gui.GuiGraphics graphics) Render the lure slot as highlighted.- Parameters:
graphics
- The PoseStack context.
-
placeLureInLureSlot
public void placeLureInLureSlot(net.minecraft.world.item.ItemStack held, boolean creative) Places the lure being carried by the cursor in the lure slot.- Parameters:
held
- TheLureItem
held by the cursor.creative
- Whether the player is in creative mode.
-
swapLureInLureSlotWithHeldLure
public void swapLureInLureSlotWithHeldLure(net.minecraft.world.item.ItemStack held, net.minecraft.world.item.ItemStack lure, boolean creative) Takes the lure that is currently in the player's lure slot and swaps it with the lure being carried by the cursor. -
pickUpLureInLureSlot
public void pickUpLureInLureSlot(net.minecraft.world.item.ItemStack lure) Takes the lure that is currently in the player's lure slot and sets it as being carried by the cursor.- Parameters:
lure
- TheLureItem
being moved.
-
handleDrawingCharmsDrawer
public void handleDrawingCharmsDrawer(net.minecraft.client.gui.GuiGraphics graphics, double mouseX, double mouseY, int bX, int bY) Renders the grey background of the charms drawer based on whether it has been opened or closed.- Parameters:
graphics
- The PoseStack context.mouseX
- The cursor's x position.mouseY
- The cursor's y position.bX
- The x position corresponding to the leftmost position of the Minecraft inventory, including the Pokémon party slots.bY
- The y position of the middle of the GUI.
-
drawCharmsInCharmsDrawer
public void drawCharmsInCharmsDrawer(net.minecraft.client.gui.GuiGraphics graphics, int bX, int bY) Renders the sprites of the charms in the charms drawer of the Pixelmon Extended Screen.- Parameters:
graphics
- The PoseStack context.bX
- The x position corresponding to the leftmost position of the Minecraft inventory, including the Pokémon party slots.bY
- The y position of the middle of the GUI.
-
cursorOverCharmsDrawerOpener
public boolean cursorOverCharmsDrawerOpener(double mouseX, double mouseY, int bX, int bY) Determines if the cursor is hovering over the left-pointing arrow that opens the charms drawer.- Parameters:
mouseX
- The cursor's x position.mouseY
- The cursor's y position.bX
- The x position corresponding to the leftmost position of the Minecraft inventory, including the Pokémon party slots.bY
- The y position of the middle of the GUI.- Returns:
- Whether the cursor is hovering over the charms drawer opener.
-
cursorOverCharmsDrawerCloser
public boolean cursorOverCharmsDrawerCloser(double mouseX, double mouseY, int bX, int bY) Determines if the cursor is hovering over the right-pointing arrow that closes the charms drawer.- Parameters:
mouseX
- The cursor's x position.mouseY
- The cursor's y position.bX
- The x position corresponding to the leftmost position of the Minecraft inventory, including the Pokémon party slots.bY
- The y position of the middle of the GUI.- Returns:
- Whether the cursor is hovering over the charms drawer closer.
-
cursorWithinXBoundsOfCharms
public boolean cursorWithinXBoundsOfCharms(double mouseX, int bX) Determines if the x position of the cursor lines up within the column of charms in the charms drawer of Pixelmon's extended inventory screen.- Parameters:
mouseX
- The cursor's x position.bX
- The x position corresponding to the leftmost position of the Minecraft inventory, including the Pokémon party slots.- Returns:
- Whether the cursor is within the x position of the left and right sides of the charm icons.
-
toggleCharms
public boolean toggleCharms(double mouseY, int bY) Turns on or turns off the player's charms.- Parameters:
mouseY
- The cursor's y position.bY
- The y position of the middle of the GUI.- Returns:
- Whether the mouse click wasn't consumed.
-
handleSelectingPokemonSlots
public boolean handleSelectingPokemonSlots(double mouseX, double mouseY, int mouseButton) Determines whether the player left- or right-clicked a Pokémon's slot in the Minecraft Inventory and handles swapping Pokémon, switching items, or getting the PokeChecker (Pokémon Summary stuff).- Parameters:
mouseX
- the cursor's x positionmouseY
- the cursor's y positionmouseButton
- Whether the mouse's left-button (0) or right-button (1) was clicked.- Returns:
- Whether the mouse click wasn't consumed.
-
handlePokemonHeldItems
Handles setting up what items the cursor and Pokémon are carrying, and whether the cursor will add, remove, or swap their item with the Pokémon's.- Parameters:
position
- The Pokémon's position within the Party or the PC.pokemon
- The Pokémon that is having their item changed.
-
handleAddingItems
public net.minecraft.world.item.ItemStack handleAddingItems(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack currentItem) Add an item to a Pokémon via the Minecraft Inventory Menu.- Parameters:
pokemon
- The Pokémon that is having their item changed.inventory
- The Minecraft Inventory menu.currentItem
- The item the cursor is holding.- Returns:
- The item to add to the Pokémon.
-
handleRemovingItems
public void handleRemovingItems(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack oldItem) Removes an item from a Pokémon via the Minecraft Inventory Menu.- Parameters:
pokemon
- The Pokémon that is having their item changed.inventory
- The Minecraft Inventory menu.oldItem
- The item the Pokémon is holding.
-
handleSwappingItems
public void handleSwappingItems(Pokemon pokemon, net.minecraft.world.inventory.InventoryMenu inventory, net.minecraft.world.item.ItemStack currentItem, net.minecraft.world.item.ItemStack oldItem) Handles giving, removing, or swapping the item a Pokémon is holding while the cursor is holding an item.- Parameters:
pokemon
- The Pokémon that is having their item changed.inventory
- The Minecraft Inventory menu.currentItem
- The item the cursor is holding.oldItem
- The item the Pokémon is holding.
-