Package net.minecraftforge.client
Class ForgeHooksClient
java.lang.Object
net.minecraftforge.client.ForgeHooksClient
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.logging.log4j.Marker
private static Matrix4f
private static Matrix3f
static String
Contains the *extra* GUI layers.private static ResourceLocation
private static Map<ModelLayerLocation,Supplier<LayerDefinition>>
private static org.apache.logging.log4j.Logger
(package private) static ThreadLocal<RenderType>
private static int
(package private) static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
bossBarRenderPost(PoseStack mStack, Window res)
bossBarRenderPre(PoseStack mStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment)
static void
clearGuiLayers(Minecraft minecraft)
static RenderTooltipEvent.Color
colorTooltipEvent(ItemStack stack, PoseStack matrixStack, int x, int y, Font font, List<ClientTooltipComponent> components)
static void
dispatchRenderLast(LevelRenderer context, PoseStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano)
static void
drawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, PoseStack mStack, int x, int y, int width, int relativeMouseX, int relativeMouseY)
static void
drawItemLayered(ItemRenderer renderer, BakedModel modelIn, ItemStack itemStackIn, PoseStack matrixStackIn, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, boolean fabulous)
static void
drawScreen(Screen screen, PoseStack mStack, int mouseX, int mouseY, float partialTicks)
private static void
drawScreenInternal(Screen screen, PoseStack mStack, int mouseX, int mouseY, float partialTicks)
static void
fillNormal(int[] faceData, Direction facing)
internal, relies on fixed format of FaceBakerystatic void
fireKeyInput(int key, int scanCode, int action, int modifiers)
static void
fireMouseInput(int button, int action, int mods)
static void
firePlayerLogin(MultiPlayerGameMode pc, LocalPlayer player, Connection networkManager)
static void
firePlayerLogout(MultiPlayerGameMode pc, LocalPlayer player)
static void
firePlayerRespawn(MultiPlayerGameMode pc, LocalPlayer oldPlayer, LocalPlayer newPlayer, Connection networkManager)
static String
static void
gatherFluidTextures(Set<Material> textures)
static List<ClientTooltipComponent>
gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, int mouseX, int screenWidth, int screenHeight, Font forcedFont, Font fallbackFont)
static List<ClientTooltipComponent>
gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, Optional<TooltipComponent> itemComponent, int mouseX, int screenWidth, int screenHeight, Font forcedFont, Font fallbackFont)
static <A extends HumanoidModel<?>>
AgetArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, A _default)
static String
getArmorTexture(Entity entity, ItemStack armor, String _default, EquipmentSlot slot, String type)
static WorldPreset.PresetEditor
getBiomeGeneratorTypeScreenFactory(Optional<WorldPreset> generator, WorldPreset.PresetEditor biomegeneratortypescreens$ifactory)
static Material
private static Connection
static int
getColorIndex(VertexFormat fmt)
static Optional<WorldPreset>
getFluidMaterials(Fluid fluid)
static TextureAtlasSprite[]
getFluidSprites(BlockAndTintGetter world, BlockPos pos, FluidState fluidStateIn)
static float
getFogDensity(FogRenderer.FogMode type, Camera info, float partial, float density)
static double
getFOVModifier(GameRenderer renderer, Camera info, double renderPartialTicks, double fov)
static float
static float
getOffsetFOV(Player entity, float fov)
static Font
getTooltipFont(Font forcedFont, ItemStack stack, Font fallbackFont)
private static Vector3f
getVertexPos(int[] data, int vertex)
static int
static Optional<WorldPreset>
getWorldTypeFromGenerator(WorldGenSettings dimensionGeneratorSettings)
static BakedModel
handleCameraTransforms(PoseStack matrixStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery)
static void
handleClientWorldClosing(ClientLevel world)
static BakedModel
handlePerspective(BakedModel model, ItemTransforms.TransformType type, PoseStack stack)
static boolean
hasBiomeGeneratorSettingsOptionsScreen(Optional<WorldPreset> generator)
static boolean
isNameplateInRenderDistance(Entity entity, double squareDistance)
static void
loadEntityShader(Entity entity, GameRenderer entityRenderer)
static void
loadLayerDefinitions(com.google.common.collect.ImmutableMap.Builder<ModelLayerLocation,LayerDefinition> builder)
static TextureAtlasSprite
loadTextureAtlasSprite(TextureAtlas textureAtlas, ResourceManager resourceManager, TextureAtlasSprite.Info textureInfo, Resource resource, int atlasWidth, int atlasHeight, int spriteX, int spriteY, int mipmapLevel, NativeImage image)
static void
onBlockColorsInit(BlockColors blockColors)
onCameraSetup(GameRenderer renderer, Camera info, float partial)
static InputEvent.ClickInputEvent
onClickInput(int button, KeyMapping keyBinding, InteractionHand hand)
static void
onClientChangeGameMode(PlayerInfo info, GameType currentGameMode, GameType newGameMode)
static boolean
onDrawBlockHighlight(LevelRenderer context, Camera info, HitResult target, float partialTicks, PoseStack matrix, MultiBufferSource buffers)
static void
onFogRender(FogRenderer.FogMode type, Camera info, float partial, float distance)
static boolean
onGuiCharTypedPost(Screen guiScreen, char codePoint, int modifiers)
static boolean
onGuiCharTypedPre(Screen guiScreen, char codePoint, int modifiers)
static boolean
onGuiKeyPressedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers)
static boolean
onGuiKeyPressedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers)
static boolean
onGuiKeyReleasedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers)
static boolean
onGuiKeyReleasedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers)
static boolean
onGuiMouseClickedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled)
static boolean
onGuiMouseClickedPre(Screen guiScreen, double mouseX, double mouseY, int button)
static boolean
onGuiMouseDragPost(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY)
static boolean
onGuiMouseDragPre(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY)
static boolean
onGuiMouseReleasedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled)
static boolean
onGuiMouseReleasedPre(Screen guiScreen, double mouseX, double mouseY, int button)
static boolean
onGuiMouseScrollPost(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta)
static boolean
onGuiMouseScrollPre(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta)
static void
onInputUpdate(Player player, Input movementInput)
static void
onItemColorsInit(ItemColors itemColors, BlockColors blockColors)
static void
onModelBake(ModelManager modelManager, Map<ResourceLocation,BakedModel> modelRegistry, ModelLoader modelLoader)
static boolean
onMouseScroll(MouseHandler mouseHelper, double scrollDelta)
static boolean
onRawMouseClicked(int button, int action, int mods)
static void
static ScreenshotEvent
onScreenshot(NativeImage image, File screenshotFile)
static void
static void
onTextureStitchedPre(TextureAtlas map, Set<ResourceLocation> resourceLocations)
static SoundInstance
playSound(SoundEngine manager, SoundInstance sound)
static void
popGuiLayer(Minecraft minecraft)
private static void
popGuiLayerInternal(Minecraft minecraft)
static void
postDraw(VertexFormatElement.Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
static void
preDraw(VertexFormatElement.Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
static RenderTooltipEvent.Pre
preTooltipEvent(ItemStack stack, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, List<ClientTooltipComponent> components, Font forcedFont, Font fallbackFont)
static void
processForgeListPingData(ServerStatus packet, ServerData target)
static void
pushGuiLayer(Minecraft minecraft, Screen screen)
static void
refreshResources(Minecraft mc, VanillaResourceType... types)
Deprecated, for removal: This API element is subject to removal in a future version.static void
static void
registerLayerDefinition(ModelLayerLocation layerLocation, Supplier<LayerDefinition> supplier)
static void
renderMainMenu(TitleScreen gui, PoseStack mStack, Font font, int width, int height, int alpha)
static void
renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource buffer, Level world, boolean checkSides, int combinedOverlay, BlockRenderDispatcher blockRenderer)
static boolean
renderSpecificFirstPersonHand(InteractionHand hand, PoseStack mat, MultiBufferSource buffers, int light, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack)
static void
resizeGuiLayers(Minecraft minecraft, int width, int height)
static void
setRenderLayer(RenderType layer)
static boolean
shouldCauseReequipAnimation(ItemStack from, ItemStack to, int slot)
static boolean
shouldRender(MobEffectInstance effectInstance)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
CLIENTHOOKS
private static final org.apache.logging.log4j.Marker CLIENTHOOKS -
guiLayers
Contains the *extra* GUI layers. The current top layer stays in Minecraft#currentScreen, and the rest serve as a background for it. -
renderLayer
-
forgeStatusLine
-
worldRenderPass
static int worldRenderPass -
flipX
-
flipXNormal
-
slotMainHand
private static int slotMainHand -
layerDefinitions
-
ICON_SHEET
-
-
Constructor Details
-
ForgeHooksClient
public ForgeHooksClient()
-
-
Method Details
-
resizeGuiLayers
-
clearGuiLayers
-
popGuiLayerInternal
-
pushGuiLayer
-
popGuiLayer
-
getGuiFarPlane
public static float getGuiFarPlane() -
getArmorTexture
-
onDrawBlockHighlight
public static boolean onDrawBlockHighlight(LevelRenderer context, Camera info, HitResult target, float partialTicks, PoseStack matrix, MultiBufferSource buffers) -
dispatchRenderLast
public static void dispatchRenderLast(LevelRenderer context, PoseStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano) -
renderSpecificFirstPersonHand
public static boolean renderSpecificFirstPersonHand(InteractionHand hand, PoseStack mat, MultiBufferSource buffers, int light, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) -
onTextureStitchedPre
-
onTextureStitchedPost
-
onBlockColorsInit
-
onItemColorsInit
-
setRenderLayer
-
getArmorModel
public static <A extends HumanoidModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, A _default) -
fixDomain
-
getOffsetFOV
-
getFOVModifier
public static double getFOVModifier(GameRenderer renderer, Camera info, double renderPartialTicks, double fov) -
renderMainMenu
public static void renderMainMenu(TitleScreen gui, PoseStack mStack, Font font, int width, int height, int alpha) -
playSound
-
getWorldRenderPass
public static int getWorldRenderPass() -
drawScreen
-
drawScreenInternal
-
getFogDensity
public static float getFogDensity(FogRenderer.FogMode type, Camera info, float partial, float density) -
onFogRender
public static void onFogRender(FogRenderer.FogMode type, Camera info, float partial, float distance) -
onCameraSetup
public static EntityViewRenderEvent.CameraSetup onCameraSetup(GameRenderer renderer, Camera info, float partial) -
onModelBake
public static void onModelBake(ModelManager modelManager, Map<ResourceLocation,BakedModel> modelRegistry, ModelLoader modelLoader) -
handleCameraTransforms
public static BakedModel handleCameraTransforms(PoseStack matrixStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery) -
preDraw
public static void preDraw(VertexFormatElement.Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer) -
postDraw
public static void postDraw(VertexFormatElement.Usage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer) -
getColorIndex
-
getFluidSprites
public static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter world, BlockPos pos, FluidState fluidStateIn) -
gatherFluidTextures
-
getFluidMaterials
-
getBlockMaterial
-
fillNormal
internal, relies on fixed format of FaceBakery -
getVertexPos
-
loadEntityShader
-
shouldCauseReequipAnimation
-
bossBarRenderPre
public static RenderGameOverlayEvent.BossInfo bossBarRenderPre(PoseStack mStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment) -
bossBarRenderPost
-
onScreenshot
-
onClientChangeGameMode
public static void onClientChangeGameMode(PlayerInfo info, GameType currentGameMode, GameType newGameMode) -
handlePerspective
public static BakedModel handlePerspective(BakedModel model, ItemTransforms.TransformType type, PoseStack stack) -
onInputUpdate
-
refreshResources
@Deprecated(since="1.17.1", forRemoval=true) public static void refreshResources(Minecraft mc, VanillaResourceType... types)Deprecated, for removal: This API element is subject to removal in a future version.useMinecraft.reloadResourcePacks()
instead -
onGuiMouseClickedPre
public static boolean onGuiMouseClickedPre(Screen guiScreen, double mouseX, double mouseY, int button) -
onGuiMouseClickedPost
public static boolean onGuiMouseClickedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) -
onGuiMouseReleasedPre
public static boolean onGuiMouseReleasedPre(Screen guiScreen, double mouseX, double mouseY, int button) -
onGuiMouseReleasedPost
public static boolean onGuiMouseReleasedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) -
onGuiMouseDragPre
public static boolean onGuiMouseDragPre(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) -
onGuiMouseDragPost
public static boolean onGuiMouseDragPost(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) -
onGuiMouseScrollPre
public static boolean onGuiMouseScrollPre(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) -
onGuiMouseScrollPost
public static boolean onGuiMouseScrollPost(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) -
onGuiKeyPressedPre
public static boolean onGuiKeyPressedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onGuiKeyPressedPost
public static boolean onGuiKeyPressedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onGuiKeyReleasedPre
public static boolean onGuiKeyReleasedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onGuiKeyReleasedPost
public static boolean onGuiKeyReleasedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onGuiCharTypedPre
-
onGuiCharTypedPost
-
onRecipesUpdated
-
fireMouseInput
public static void fireMouseInput(int button, int action, int mods) -
fireKeyInput
public static void fireKeyInput(int key, int scanCode, int action, int modifiers) -
onMouseScroll
-
onRawMouseClicked
public static boolean onRawMouseClicked(int button, int action, int mods) -
onClickInput
public static InputEvent.ClickInputEvent onClickInput(int button, KeyMapping keyBinding, InteractionHand hand) -
drawItemLayered
public static void drawItemLayered(ItemRenderer renderer, BakedModel modelIn, ItemStack itemStackIn, PoseStack matrixStackIn, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, boolean fabulous) -
isNameplateInRenderDistance
-
renderPistonMovedBlocks
public static void renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource buffer, Level world, boolean checkSides, int combinedOverlay, BlockRenderDispatcher blockRenderer) -
registerForgeWorldTypeScreens
public static void registerForgeWorldTypeScreens() -
getBiomeGeneratorTypeScreenFactory
public static WorldPreset.PresetEditor getBiomeGeneratorTypeScreenFactory(Optional<WorldPreset> generator, @Nullable WorldPreset.PresetEditor biomegeneratortypescreens$ifactory) -
hasBiomeGeneratorSettingsOptionsScreen
-
getWorldTypeFromGenerator
public static Optional<WorldPreset> getWorldTypeFromGenerator(WorldGenSettings dimensionGeneratorSettings) -
getDefaultWorldType
-
shouldRender
-
loadTextureAtlasSprite
@Nullable public static TextureAtlasSprite loadTextureAtlasSprite(TextureAtlas textureAtlas, ResourceManager resourceManager, TextureAtlasSprite.Info textureInfo, Resource resource, int atlasWidth, int atlasHeight, int spriteX, int spriteY, int mipmapLevel, NativeImage image) -
registerLayerDefinition
public static void registerLayerDefinition(ModelLayerLocation layerLocation, Supplier<LayerDefinition> supplier) -
loadLayerDefinitions
public static void loadLayerDefinitions(com.google.common.collect.ImmutableMap.Builder<ModelLayerLocation,LayerDefinition> builder) -
processForgeListPingData
-
drawForgePingInfo
public static void drawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, PoseStack mStack, int x, int y, int width, int relativeMouseX, int relativeMouseY) -
getClientToServerNetworkManager
-
handleClientWorldClosing
-
firePlayerLogin
public static void firePlayerLogin(MultiPlayerGameMode pc, LocalPlayer player, Connection networkManager) -
firePlayerLogout
-
firePlayerRespawn
public static void firePlayerRespawn(MultiPlayerGameMode pc, LocalPlayer oldPlayer, LocalPlayer newPlayer, Connection networkManager) -
getTooltipFont
-
preTooltipEvent
public static RenderTooltipEvent.Pre preTooltipEvent(@Nonnull ItemStack stack, PoseStack matrixStack, int x, int y, int screenWidth, int screenHeight, @Nonnull List<ClientTooltipComponent> components, @Nullable Font forcedFont, @Nonnull Font fallbackFont) -
colorTooltipEvent
public static RenderTooltipEvent.Color colorTooltipEvent(@Nonnull ItemStack stack, PoseStack matrixStack, int x, int y, @Nonnull Font font, @Nonnull List<ClientTooltipComponent> components) -
gatherTooltipComponents
public static List<ClientTooltipComponent> gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, int mouseX, int screenWidth, int screenHeight, @Nullable Font forcedFont, Font fallbackFont) -
gatherTooltipComponents
public static List<ClientTooltipComponent> gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, Optional<TooltipComponent> itemComponent, int mouseX, int screenWidth, int screenHeight, @Nullable Font forcedFont, Font fallbackFont)
-
Minecraft.reloadResourcePacks()
instead