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
FieldsModifier and TypeFieldDescriptionprotected static final intThe height of the GUI.protected static final intThe width of the GUI.protected booleanWhether the opponent is an NPC Trainer.protected intThe x coordinate of the left of the screen.protected intThe animated offset of the left parts of the GUI.protected intThe animated offset of the right parts of the GUI.protected intThe x coordinate of the left of the opponent's party.protected intThe y coordinate of the left of the opponent's party.static final intThe distance of party Poké Balls/Pokémon from each other.protected intThe x coordinate of the left of the player's party.protected intThe y coordinate of the left of the player's party.protected intCounter to update the screen.protected intThe y coordinate of the top of the screen.Fields inherited from class net.minecraft.client.gui.screens.Screen
children, CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawEntity(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 voiddrawEntity(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 voiddrawOpponentPokeBalls(net.minecraft.client.gui.GuiGraphics graphics, int numPokeBalls) Draws the opponent's party Poké Balls.protected voiddrawPokeBalls(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.LivingEntityGets the player's opponent for the battle.protected Stringvoidinit()booleanReturns true if this GUI should pause the game when it is displayed in single-playervoidrender(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float f) voidtick()Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, onClose, onFilesDrop, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods 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:
initin classnet.minecraft.client.gui.screens.Screen
-
tick
public void tick()- Overrides:
tickin classnet.minecraft.client.gui.screens.Screen
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float f) - Specified by:
renderin interfacenet.minecraft.client.gui.components.Renderable- Overrides:
renderin classnet.minecraft.client.gui.screens.Screen
-
getOpponentName
-
isPauseScreen
public boolean isPauseScreen()Returns true if this GUI should pause the game when it is displayed in single-player- Overrides:
isPauseScreenin 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.
-