Package net.minecraftforge.client
Class ForgeHooksClient
java.lang.Object
net.minecraftforge.client.ForgeHooksClient
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Markerstatic StringContains the *extra* GUI layers.private static final ResourceLocationprivate static booleanprivate static final Map<ModelLayerLocation,Supplier<LayerDefinition>> private static final org.apache.logging.log4j.Loggerprivate static intprivate static final ChatTypeprivate static final ChatType.Boundprivate static final ChatTypeDecoration
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancalculateFaceWithoutAO(BlockAndTintGetter getter, BlockState state, BlockPos pos, BakedQuad quad, boolean isFaceCubic, float[] brightness, int[] lightmap) static voidclearGuiLayers(Minecraft minecraft) static <T extends LivingEntity>
 voidcopyModelProperties(HumanoidModel<T> original, HumanoidModel<?> replacement) Copies humanoid model properties from the original model to another, used for armor modelsstatic voidcreateWorldConfirmationScreen(Runnable doConfirmedWorldLoad) static voiddispatchRenderStage(RenderType renderType, LevelRenderer levelRenderer, PoseStack poseStack, org.joml.Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) static voiddrawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, GuiGraphics guiGraphics, int x, int y, int width, int relativeMouseX, int relativeMouseY) static voiddrawScreen(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) private static voiddrawScreenInternal(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) static voidfillNormal(int[] faceData, Direction facing) static voidfillNormal(int[] faceData, Direction facing, boolean calculateNormals) internal, relies on fixed format of FaceBakerystatic voidfirePlayerLogin(MultiPlayerGameMode pc, LocalPlayer player, Connection networkManager) static voidfirePlayerLogout(@Nullable MultiPlayerGameMode pc, @Nullable LocalPlayer player) static voidfirePlayerRespawn(MultiPlayerGameMode pc, LocalPlayer oldPlayer, LocalPlayer newPlayer, Connection networkManager) static Stringstatic List<ClientTooltipComponent>gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, int mouseX, int screenWidth, int screenHeight, Font fallbackFont) static List<ClientTooltipComponent>gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, Optional<TooltipComponent> itemComponent, int mouseX, int screenWidth, int screenHeight, Font fallbackFont) static ModelgetArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, HumanoidModel<?> _default) static StringgetArmorTexture(Entity entity, ItemStack armor, String _default, EquipmentSlot slot, String type) static Materialprivate static Connectionstatic @NotNull RenderTypegetEntityRenderType(RenderType chunkRenderType, boolean cull) Mimics the behavior ofItemBlockRenderTypes.getRenderType(BlockState, boolean)for the inputRenderType.static doublegetFieldOfView(GameRenderer renderer, Camera camera, double partialTick, double fov, boolean usedConfiguredFov) static floatgetFieldOfViewModifier(Player entity, float fovModifier) static TextureAtlasSprite[]getFluidSprites(BlockAndTintGetter level, BlockPos pos, FluidState fluidStateIn) static org.joml.Vector3fgetFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, float fogRed, float fogGreen, float fogBlue) static floatstatic intgetMaxMipmapLevel(int width, int height) static DirectiongetNearestStable(float nX, float nY, float nZ) This function is a clone ofDirection.getNearest(float, float, float)designed to return a consistent direction when the normal is at an inflection point (ie 45 degrees) rounding errors from associated matrix multiplication (such as duringSheetedDecalTextureGenerator.endVertex()can cause the direction chosen to be unstable.static ResourceLocationgetShaderImportLocation(String basePath, boolean isRelative, String importPath) static FontgetTooltipFont(@NotNull ItemStack stack, Font fallbackFont) private static org.joml.Vector3fgetVertexPos(int[] data, int vertex) static BakedModelhandleCameraTransforms(PoseStack poseStack, BakedModel model, ItemDisplayContext cameraTransformType, boolean applyLeftHandTransform) static voidstatic voidinitClientHooks(Minecraft mc, ReloadableResourceManager resourceManager) static booleanisBlockInSolidLayer(BlockState state) static booleanisNameplateInRenderDistance(Entity entity, double squareDistance) static voidloadEntityShader(Entity entity, GameRenderer entityRenderer) static voidloadLayerDefinitions(com.google.common.collect.ImmutableMap.Builder<ModelLayerLocation, LayerDefinition> builder) static @Nullable SpriteContentsloadSpriteContents(ResourceLocation name, Resource resource, FrameSize frameSize, NativeImage image, ResourceMetadata animationMeta) static @Nullable TextureAtlasSpriteloadTextureAtlasSprite(ResourceLocation atlasName, SpriteContents contents, int atlasWidth, int atlasHeight, int spriteX, int spriteY, int mipmapLevel) static Comparator<ParticleRenderType>makeParticleRenderTypeComparator(List<ParticleRenderType> renderOrder) static voidonBlockColorsInit(BlockColors blockColors) onCameraSetup(GameRenderer renderer, Camera camera, float partial) onClickInput(int button, KeyMapping keyBinding, InteractionHand hand) static voidonClientChangeGameType(PlayerInfo info, GameType currentGameMode, GameType newGameMode) static @Nullable ComponentonClientChat(ChatType.Bound boundChatType, Component message, UUID sender) static booleanonClientDisconnect(Connection connection, Minecraft mc, Screen parent, Component message) static @Nullable ComponentonClientPlayerChat(ChatType.Bound boundChatType, Component message, PlayerChatMessage playerChatMessage, UUID sender) static @NotNull StringonClientSendMessage(String message) static @Nullable ComponentonClientSystemChat(Component message, boolean overlay) onCustomizeBossEventProgress(GuiGraphics guiGraphics, Window window, LerpingBossEvent bossInfo, int x, int y, int increment) static booleanonDrawHighlight(LevelRenderer context, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) static voidonFogRender(FogRenderer.FogMode mode, FogType type, Camera camera, float partialTick, float renderDistance, float nearDistance, float farDistance, FogShape shape) static voidonItemColorsInit(ItemColors itemColors, BlockColors blockColors) static voidonKeyInput(int key, int scanCode, int action, int modifiers) static voidonModelBake(ModelManager modelManager, Map<ResourceLocation, BakedModel> models, ModelBakery modelBakery) static voidonModifyBakingResult(Map<ResourceLocation, BakedModel> models, ModelBakery modelBakery) static voidonMovementInputUpdate(Player player, Input movementInput) static voidstatic voidonRegisterAdditionalModels(Set<ResourceLocation> additionalModels) static voidonRegisterKeyMappings(Options options) static voidonRegisterParticleProviders(ParticleEngine particleEngine) static RenderTooltipEvent.ColoronRenderTooltipColor(@NotNull ItemStack stack, GuiGraphics graphics, int x, int y, @NotNull Font font, @NotNull List<ClientTooltipComponent> components) static RenderTooltipEvent.PreonRenderTooltipPre(@NotNull ItemStack stack, GuiGraphics graphics, int x, int y, int screenWidth, int screenHeight, @NotNull List<ClientTooltipComponent> components, @NotNull Font fallbackFont, @NotNull ClientTooltipPositioner positioner) static voidonScreenCharTypedPost(Screen guiScreen, char codePoint, int modifiers) static booleanonScreenCharTypedPre(Screen guiScreen, char codePoint, int modifiers) static booleanonScreenKeyPressedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) static booleanonScreenKeyPressedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) static booleanonScreenKeyReleasedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) static booleanonScreenKeyReleasedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) onScreenPotionSize(Screen screen, int availableSpace, boolean compact, int horizontalOffset) static ScreenshotEventonScreenshot(NativeImage image, File screenshotFile) static voidstatic booleanonToastAdd(Toast toast) static @Nullable SoundInstanceplaySound(SoundEngine manager, SoundInstance sound) static voidpopGuiLayer(Minecraft minecraft) private static voidpopGuiLayerInternal(Minecraft minecraft) static voidprocessForgeListPingData(ServerStatus packet, ServerData target) static voidpushGuiLayer(Minecraft minecraft, Screen screen) static voidregisterLayerDefinition(ModelLayerLocation layerLocation, Supplier<LayerDefinition> supplier) static booleanrenderBlockOverlay(Player player, PoseStack mat, RenderBlockScreenEffectEvent.OverlayType type, BlockState block, BlockPos pos) static booleanrenderFireOverlay(Player player, PoseStack mat) static voidrenderMainMenu(TitleScreen gui, GuiGraphics graphics, Font font, int width, int height, int alpha) static voidrenderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource bufferSource, Level level, boolean checkSides, int packedOverlay, BlockRenderDispatcher blockRenderer) static booleanrenderSpecificFirstPersonArm(PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, AbstractClientPlayer player, HumanoidArm arm) static booleanrenderSpecificFirstPersonHand(InteractionHand hand, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, float partialTick, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) static booleanrenderWaterOverlay(Player player, PoseStack mat) static voidresizeGuiLayers(Minecraft minecraft, int width, int height) static booleanshouldCauseReequipAnimation(@NotNull ItemStack from, @NotNull ItemStack to, int slot) static booleanshouldRenderEffect(MobEffectInstance effectInstance) private static Stream<ClientTooltipComponent>splitLine(FormattedText text, Font font, int maxWidth) 
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
CLIENTHOOKSprivate static final org.apache.logging.log4j.Marker CLIENTHOOKS
- 
guiLayersContains the *extra* GUI layers. The current top layer stays in Minecraft#currentScreen, and the rest serve as a background for it.
- 
forgeStatusLine
- 
slotMainHandprivate static int slotMainHand
- 
layerDefinitions
- 
ICON_SHEET
- 
SYSTEM_CHAT_TYPE_DECORATION
- 
SYSTEM_CHAT_TYPE
- 
SYSTEM_CHAT_TYPE_BOUND
- 
initializedClientHooksprivate static boolean initializedClientHooks
 
- 
- 
Constructor Details- 
ForgeHooksClientpublic ForgeHooksClient()
 
- 
- 
Method Details- 
resizeGuiLayers
- 
clearGuiLayers
- 
popGuiLayerInternal
- 
pushGuiLayer
- 
popGuiLayer
- 
getGuiFarPlanepublic static float getGuiFarPlane()
- 
getArmorTexture
- 
onDrawHighlightpublic static boolean onDrawHighlight(LevelRenderer context, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) 
- 
dispatchRenderStagepublic static void dispatchRenderStage(RenderType renderType, LevelRenderer levelRenderer, PoseStack poseStack, org.joml.Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) 
- 
renderSpecificFirstPersonHandpublic static boolean renderSpecificFirstPersonHand(InteractionHand hand, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, float partialTick, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) 
- 
renderSpecificFirstPersonArmpublic static boolean renderSpecificFirstPersonArm(PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, AbstractClientPlayer player, HumanoidArm arm) 
- 
onTextureStitchedPost
- 
onBlockColorsInit
- 
onItemColorsInit
- 
getArmorModelpublic static Model getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, HumanoidModel<?> _default) 
- 
copyModelPropertiespublic static <T extends LivingEntity> void copyModelProperties(HumanoidModel<T> original, HumanoidModel<?> replacement) Copies humanoid model properties from the original model to another, used for armor models
- 
fixDomain
- 
getFieldOfViewModifier
- 
getFieldOfViewpublic static double getFieldOfView(GameRenderer renderer, Camera camera, double partialTick, double fov, boolean usedConfiguredFov) 
- 
renderMainMenupublic static void renderMainMenu(TitleScreen gui, GuiGraphics graphics, Font font, int width, int height, int alpha) 
- 
playSound
- 
drawScreenpublic static void drawScreen(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) 
- 
drawScreenInternalprivate static void drawScreenInternal(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) 
- 
getFogColorpublic static org.joml.Vector3f getFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, float fogRed, float fogGreen, float fogBlue) 
- 
onFogRenderpublic static void onFogRender(FogRenderer.FogMode mode, FogType type, Camera camera, float partialTick, float renderDistance, float nearDistance, float farDistance, FogShape shape) 
- 
onCameraSetuppublic static ViewportEvent.ComputeCameraAngles onCameraSetup(GameRenderer renderer, Camera camera, float partial) 
- 
onModifyBakingResultpublic static void onModifyBakingResult(Map<ResourceLocation, BakedModel> models, ModelBakery modelBakery) 
- 
onModelBakepublic static void onModelBake(ModelManager modelManager, Map<ResourceLocation, BakedModel> models, ModelBakery modelBakery) 
- 
handleCameraTransformspublic static BakedModel handleCameraTransforms(PoseStack poseStack, BakedModel model, ItemDisplayContext cameraTransformType, boolean applyLeftHandTransform) 
- 
getFluidSpritespublic static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter level, BlockPos pos, FluidState fluidStateIn) 
- 
getBlockMaterial
- 
fillNormal
- 
fillNormalinternal, relies on fixed format of FaceBakery
- 
getVertexPosprivate static org.joml.Vector3f getVertexPos(int[] data, int vertex) 
- 
calculateFaceWithoutAOpublic static boolean calculateFaceWithoutAO(BlockAndTintGetter getter, BlockState state, BlockPos pos, BakedQuad quad, boolean isFaceCubic, float[] brightness, int[] lightmap) 
- 
loadEntityShader
- 
shouldCauseReequipAnimation
- 
onCustomizeBossEventProgresspublic static CustomizeGuiOverlayEvent.BossEventProgress onCustomizeBossEventProgress(GuiGraphics guiGraphics, Window window, LerpingBossEvent bossInfo, int x, int y, int increment) 
- 
onScreenshot
- 
onClientChangeGameTypepublic static void onClientChangeGameType(PlayerInfo info, GameType currentGameMode, GameType newGameMode) 
- 
onMovementInputUpdate
- 
onScreenKeyPressedPrepublic static boolean onScreenKeyPressedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) 
- 
onScreenKeyPressedPostpublic static boolean onScreenKeyPressedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) 
- 
onScreenKeyReleasedPrepublic static boolean onScreenKeyReleasedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) 
- 
onScreenKeyReleasedPostpublic static boolean onScreenKeyReleasedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) 
- 
onScreenCharTypedPre
- 
onScreenCharTypedPost
- 
onRecipesUpdated
- 
onKeyInputpublic static void onKeyInput(int key, int scanCode, int action, int modifiers) 
- 
onClickInputpublic static InputEvent.InteractionKeyMappingTriggered onClickInput(int button, KeyMapping keyBinding, InteractionHand hand) 
- 
isNameplateInRenderDistance
- 
renderPistonMovedBlockspublic static void renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource bufferSource, Level level, boolean checkSides, int packedOverlay, BlockRenderDispatcher blockRenderer) 
- 
shouldRenderEffect
- 
loadSpriteContents@Nullable public static @Nullable SpriteContents loadSpriteContents(ResourceLocation name, Resource resource, FrameSize frameSize, NativeImage image, ResourceMetadata animationMeta) 
- 
loadTextureAtlasSprite@Nullable public static @Nullable TextureAtlasSprite loadTextureAtlasSprite(ResourceLocation atlasName, SpriteContents contents, int atlasWidth, int atlasHeight, int spriteX, int spriteY, int mipmapLevel) 
- 
registerLayerDefinitionpublic static void registerLayerDefinition(ModelLayerLocation layerLocation, Supplier<LayerDefinition> supplier) 
- 
loadLayerDefinitionspublic static void loadLayerDefinitions(com.google.common.collect.ImmutableMap.Builder<ModelLayerLocation, LayerDefinition> builder) 
- 
processForgeListPingData
- 
drawForgePingInfopublic static void drawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, GuiGraphics guiGraphics, int x, int y, int width, int relativeMouseX, int relativeMouseY) 
- 
getClientConnection
- 
handleClientLevelClosing
- 
firePlayerLoginpublic static void firePlayerLogin(MultiPlayerGameMode pc, LocalPlayer player, Connection networkManager) 
- 
firePlayerLogoutpublic static void firePlayerLogout(@Nullable @Nullable MultiPlayerGameMode pc, @Nullable @Nullable LocalPlayer player) 
- 
firePlayerRespawnpublic static void firePlayerRespawn(MultiPlayerGameMode pc, LocalPlayer oldPlayer, LocalPlayer newPlayer, Connection networkManager) 
- 
onRegisterParticleProviders
- 
onRegisterKeyMappings
- 
onRegisterAdditionalModels
- 
onClientChat@Nullable public static @Nullable Component onClientChat(ChatType.Bound boundChatType, Component message, UUID sender) 
- 
onClientPlayerChat@Nullable public static @Nullable Component onClientPlayerChat(ChatType.Bound boundChatType, Component message, PlayerChatMessage playerChatMessage, UUID sender) 
- 
onClientSystemChat
- 
onClientSendMessage
- 
getEntityRenderType@NotNull public static @NotNull RenderType getEntityRenderType(RenderType chunkRenderType, boolean cull) Mimics the behavior ofItemBlockRenderTypes.getRenderType(BlockState, boolean)for the inputRenderType.
- 
getTooltipFont
- 
onRenderTooltipPrepublic static RenderTooltipEvent.Pre onRenderTooltipPre(@NotNull @NotNull ItemStack stack, GuiGraphics graphics, int x, int y, int screenWidth, int screenHeight, @NotNull @NotNull List<ClientTooltipComponent> components, @NotNull @NotNull Font fallbackFont, @NotNull @NotNull ClientTooltipPositioner positioner) 
- 
onRenderTooltipColorpublic static RenderTooltipEvent.Color onRenderTooltipColor(@NotNull @NotNull ItemStack stack, GuiGraphics graphics, int x, int y, @NotNull @NotNull Font font, @NotNull @NotNull List<ClientTooltipComponent> components) 
- 
gatherTooltipComponentspublic static List<ClientTooltipComponent> gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, int mouseX, int screenWidth, int screenHeight, Font fallbackFont) 
- 
gatherTooltipComponentspublic static List<ClientTooltipComponent> gatherTooltipComponents(ItemStack stack, List<? extends FormattedText> textElements, Optional<TooltipComponent> itemComponent, int mouseX, int screenWidth, int screenHeight, Font fallbackFont) 
- 
splitLineprivate static Stream<ClientTooltipComponent> splitLine(FormattedText text, Font font, int maxWidth) 
- 
makeParticleRenderTypeComparatorpublic static Comparator<ParticleRenderType> makeParticleRenderTypeComparator(List<ParticleRenderType> renderOrder) 
- 
onScreenPotionSizepublic static ScreenEvent.RenderInventoryMobEffects onScreenPotionSize(Screen screen, int availableSpace, boolean compact, int horizontalOffset) 
- 
onToastAdd
- 
isBlockInSolidLayer
- 
createWorldConfirmationScreen
- 
renderFireOverlay
- 
renderWaterOverlay
- 
renderBlockOverlaypublic static boolean renderBlockOverlay(Player player, PoseStack mat, RenderBlockScreenEffectEvent.OverlayType type, BlockState block, BlockPos pos) 
- 
getMaxMipmapLevelpublic static int getMaxMipmapLevel(int width, int height) 
- 
getShaderImportLocationpublic static ResourceLocation getShaderImportLocation(String basePath, boolean isRelative, String importPath) 
- 
getNearestStableThis function is a clone ofDirection.getNearest(float, float, float)designed to return a consistent direction when the normal is at an inflection point (ie 45 degrees) rounding errors from associated matrix multiplication (such as duringSheetedDecalTextureGenerator.endVertex()can cause the direction chosen to be unstable. The function will only take effect if the Forge Client config option "stabilizeDirectionGetNearest" is enabled. This is a port of the downstream changes from https://github.com/neoforged/NeoForge PR #26- Parameters:
- nX- X component of the normal
- nY- Y component of the normal
- nZ- Z component of the normal
- Returns:
- the nearest Direction to the passed in normal, biased slightly in favor of the order of declaration
 
- 
initClientHooks@Internal public static void initClientHooks(Minecraft mc, ReloadableResourceManager resourceManager) 
- 
onClientDisconnectpublic static boolean onClientDisconnect(Connection connection, Minecraft mc, Screen parent, Component message) 
 
-