Class VersusScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.battles.VersusScreen
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler
,net.minecraft.client.gui.components.events.GuiEventListener
,net.minecraft.client.gui.components.Renderable
,net.minecraft.client.gui.components.TabOrderedElement
- Direct Known Subclasses:
AcceptDenyScreen
,TeamSelectScreen
public abstract class VersusScreen
extends net.minecraft.client.gui.screens.Screen
A screen that displays two players against each other.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
The height of the GUI.protected static final int
The width of the GUI.protected boolean
Whether the opponent is an NPC Trainer.protected int
The x coordinate of the left of the screen.protected int
The animated offset of the left parts of the GUI.protected int
The animated offset of the right parts of the GUI.protected int
The x coordinate of the left of the opponent's party.protected int
The y coordinate of the left of the opponent's party.static final int
The distance of party Poké Balls/Pokémon from each other.protected int
The x coordinate of the left of the player's party.protected int
The y coordinate of the left of the player's party.protected int
Counter to update the screen.protected int
The y coordinate of the top of the screen.Fields inherited from class net.minecraft.client.gui.screens.Screen
BACKGROUND_LOCATION, children, font, height, minecraft, renderables, screenExecutor, title, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawEntity
(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation name, net.minecraft.resources.ResourceLocation frame, net.minecraft.world.entity.LivingEntity entity, String entityName, int tickOffset, int nameBoxX, int nameBoxY, int headX, int headY, int frameX, int frameY, int holderX, int holderY, int nameX, int nameY) Draws the player's side of the screen.protected void
drawEntity
(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.entity.LivingEntity entity, int x, int y) Draws an entity's head on the GUI.protected void
drawOpponentPokeBalls
(net.minecraft.client.gui.GuiGraphics graphics, int numPokeBalls) Draws the opponent's party Poké Balls.protected void
drawPokeBalls
(net.minecraft.client.gui.GuiGraphics graphics, String[] pokeBalls, int startX, int startY, int tickOffset) Draws the player's team Poké Balls.protected abstract net.minecraft.world.entity.LivingEntity
Gets the player's opponent for the battle.void
init()
boolean
Returns true if this GUI should pause the game when it is displayed in single-playervoid
render
(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float f) void
renderBackground
(net.minecraft.client.gui.GuiGraphics p_283688_, int mouseX, int mouseY, float partialTicks) void
renderDirtBackground
(net.minecraft.client.gui.GuiGraphics p_282281_) void
tick()
Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addEventWidget, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, confirmLink, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removed, removeWidget, renderTransparentBackground, renderWithTooltip, repositionElements, resize, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
leftX
protected int leftXThe x coordinate of the left of the screen. -
topY
protected int topYThe y coordinate of the top of the screen. -
ticks
protected int ticksCounter to update the screen. -
offset1
protected int offset1The animated offset of the left parts of the GUI. -
offset2
protected int offset2The animated offset of the right parts of the GUI. -
playerPartyX
protected int playerPartyXThe x coordinate of the left of the player's party. -
playerPartyY
protected int playerPartyYThe y coordinate of the left of the player's party. -
opponentPartyX
protected int opponentPartyXThe x coordinate of the left of the opponent's party. -
opponentPartyY
protected int opponentPartyYThe y coordinate of the left of the opponent's party. -
isNPC
protected boolean isNPCWhether the opponent is an NPC Trainer. -
GUI_WIDTH
protected static final int GUI_WIDTHThe width of the GUI.- See Also:
-
GUI_HEIGHT
protected static final int GUI_HEIGHTThe height of the GUI.- See Also:
-
PARTY_SEPARATOR
public static final int PARTY_SEPARATORThe distance of party Poké Balls/Pokémon from each other.- See Also:
-
-
Constructor Details
-
VersusScreen
protected VersusScreen()Initializes a screen.
-
-
Method Details
-
init
public void init()- Overrides:
init
in classnet.minecraft.client.gui.screens.Screen
-
renderBackground
public void renderBackground(net.minecraft.client.gui.GuiGraphics p_283688_, int mouseX, int mouseY, float partialTicks) - Overrides:
renderBackground
in classnet.minecraft.client.gui.screens.Screen
-
renderDirtBackground
public void renderDirtBackground(net.minecraft.client.gui.GuiGraphics p_282281_) - Overrides:
renderDirtBackground
in classnet.minecraft.client.gui.screens.Screen
-
tick
public void tick()- Overrides:
tick
in classnet.minecraft.client.gui.screens.Screen
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float f) - Specified by:
render
in interfacenet.minecraft.client.gui.components.Renderable
- Overrides:
render
in classnet.minecraft.client.gui.screens.Screen
-
isPauseScreen
public boolean isPauseScreen()Returns true if this GUI should pause the game when it is displayed in single-player- Overrides:
isPauseScreen
in classnet.minecraft.client.gui.screens.Screen
-
getOpponent
protected abstract net.minecraft.world.entity.LivingEntity getOpponent()Gets the player's opponent for the battle.- Returns:
- The player's opponent for the battle.
-
drawEntity
protected void drawEntity(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation name, net.minecraft.resources.ResourceLocation frame, net.minecraft.world.entity.LivingEntity entity, String entityName, int tickOffset, int nameBoxX, int nameBoxY, int headX, int headY, int frameX, int frameY, int holderX, int holderY, int nameX, int nameY) Draws the player's side of the screen.- Parameters:
name
- The resource for the name box.frame
- The resource for the head frame.entity
- The entity to draw.entityName
- The name of the entity.tickOffset
- The offset from the center to use for animation.nameBoxX
- The x coordinate of the name box.nameBoxY
- The y coordinate of the name box.headX
- The x coordinate of the player's head.headY
- The y coordinate of the player's head.frameX
- The x coordinate of the player's head frame.frameY
- The y coordinate of the player's head frame.holderX
- The x coordinate of the Poké Ball holder.holderY
- The y coordinate of the Poké Ball holder.nameX
- The x coordinate of the player's name.nameY
- The y coordinate of the player's name.
-
drawPokeBalls
protected void drawPokeBalls(net.minecraft.client.gui.GuiGraphics graphics, String[] pokeBalls, int startX, int startY, int tickOffset) Draws the player's team Poké Balls.- Parameters:
pokeBalls
- The indices of the player's Poké Ball types.startX
- The x coordinate of the left side of the first Poké Ball.startY
- The y coordinate of the top of the first Poké Ball.tickOffset
- The offset from the center to use for animation.
-
drawOpponentPokeBalls
protected void drawOpponentPokeBalls(net.minecraft.client.gui.GuiGraphics graphics, int numPokeBalls) Draws the opponent's party Poké Balls.- Parameters:
numPokeBalls
- The number of Poké Balls to draw.
-
drawEntity
protected void drawEntity(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.entity.LivingEntity entity, int x, int y) Draws an entity's head on the GUI.- Parameters:
entity
- The entity to draw.x
- The x coordinate of the head.y
- The y coordinate of the head.
-