Package net.minecraftforge.client
Class ForgeHooksClient
java.lang.Object
net.minecraftforge.client.ForgeHooksClient
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Marker
private static final Matrix4f
private static final Matrix3f
static String
Contains the *extra* GUI layers.private static final ResourceLocation
private static final Map<ModelLayerLocation,
Supplier<LayerDefinition>> private static final org.apache.logging.log4j.Logger
(package private) static final ThreadLocal<RenderType>
private static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearGuiLayers
(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 void
createWorldConfirmationScreen
(LevelStorageSource save, String worldName, boolean creatingWorld, Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier> worldData, Function<Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier>, Runnable> runAfter) static void
dispatchRenderLast
(LevelRenderer context, PoseStack poseStack, float partialTick, Matrix4f projectionMatrix, long finishTimeNano) Deprecated, for removal: This API element is subject to removal in a future version.static void
dispatchRenderStage
(RenderType renderType, LevelRenderer levelRenderer, PoseStack poseStack, Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) static void
dispatchRenderStage
(RenderLevelStageEvent.Stage stage, LevelRenderer levelRenderer, PoseStack poseStack, Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) static void
drawForgePingInfo
(JoinMultiplayerScreen gui, ServerData target, PoseStack poseStack, int x, int y, int width, int relativeMouseX, int relativeMouseY) static void
drawItemLayered
(ItemRenderer renderer, BakedModel modelIn, ItemStack itemStackIn, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay, boolean fabulous) static void
drawScreen
(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick) private static void
drawScreenInternal
(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick) 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 Model
getArmorModel
(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, HumanoidModel<?> _default) static String
getArmorTexture
(Entity entity, ItemStack armor, String _default, EquipmentSlot slot, String type) static Material
private static Connection
static Optional<WorldPreset>
static double
getFieldOfView
(GameRenderer renderer, Camera camera, double partialTick, double fov) static float
getFieldOfView
(Player entity, float fov) getFluidMaterials
(Fluid fluid) static TextureAtlasSprite[]
getFluidSprites
(BlockAndTintGetter level, BlockPos pos, FluidState fluidStateIn) static float
getFogDensity
(FogRenderer.FogMode type, Camera camera, float partialTick, float density) static float
static int
getMaxMipmapLevel
(int width, int height) static WorldPreset.PresetEditor
getPresetEditor
(Optional<WorldPreset> generator, WorldPreset.PresetEditor biomegeneratortypescreens$ifactory) static Font
getTooltipFont
(Font forcedFont, ItemStack stack, Font fallbackFont) private static Vector3f
getVertexPos
(int[] data, int vertex) static Optional<WorldPreset>
getWorldPresetFromGenerator
(WorldGenSettings dimensionGeneratorSettings) static BakedModel
handleCameraTransforms
(PoseStack poseStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery) static void
static BakedModel
handlePerspective
(BakedModel model, ItemTransforms.TransformType type, PoseStack stack) static boolean
hasPresetEditor
(Optional<WorldPreset> generator) static boolean
isBlockInSolidLayer
(BlockState state) 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 Comparator<ParticleRenderType>
makeParticleRenderTypeComparator
(List<ParticleRenderType> renderOrder) static void
onBlockColorsInit
(BlockColors blockColors) onCameraSetup
(GameRenderer renderer, Camera camera, float partial) static InputEvent.ClickInputEvent
onClickInput
(int button, KeyMapping keyBinding, InteractionHand hand) static void
onClientChangeGameType
(PlayerInfo info, GameType currentGameMode, GameType newGameMode) static boolean
onDrawHighlight
(LevelRenderer context, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) static void
onFogRender
(FogRenderer.FogMode type, Camera camera, float partialTick, float distance) Deprecated, for removal: This API element is subject to removal in a future version.to be removed in 1.19, use other onFogRender hook with more paramsstatic void
onFogRender
(FogRenderer.FogMode type, Camera camera, float partialTick, float nearDistance, float farDistance, FogShape shape) static void
onItemColorsInit
(ItemColors itemColors, BlockColors blockColors) static void
onModelBake
(ModelManager modelManager, Map<ResourceLocation, BakedModel> modelRegistry, ForgeModelBakery modelLoader) static boolean
onMouseScroll
(MouseHandler mouseHelper, double scrollDelta) static void
onMovementInputUpdate
(Player player, Input movementInput) static boolean
onRawMouseClicked
(int button, int action, int mods) static void
static RenderTooltipEvent.Color
onRenderTooltipColor
(ItemStack stack, PoseStack poseStack, int x, int y, Font font, List<ClientTooltipComponent> components) static RenderTooltipEvent.Pre
onRenderTooltipPre
(ItemStack stack, PoseStack poseStack, int x, int y, int screenWidth, int screenHeight, List<ClientTooltipComponent> components, Font forcedFont, Font fallbackFont) static boolean
onScreenCharTypedPost
(Screen guiScreen, char codePoint, int modifiers) static boolean
onScreenCharTypedPre
(Screen guiScreen, char codePoint, int modifiers) static boolean
onScreenKeyPressedPost
(Screen guiScreen, int keyCode, int scanCode, int modifiers) static boolean
onScreenKeyPressedPre
(Screen guiScreen, int keyCode, int scanCode, int modifiers) static boolean
onScreenKeyReleasedPost
(Screen guiScreen, int keyCode, int scanCode, int modifiers) static boolean
onScreenKeyReleasedPre
(Screen guiScreen, int keyCode, int scanCode, int modifiers) static boolean
onScreenMouseClickedPost
(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) static boolean
onScreenMouseClickedPre
(Screen guiScreen, double mouseX, double mouseY, int button) static boolean
onScreenMouseDragPost
(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) static boolean
onScreenMouseDragPre
(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) static boolean
onScreenMouseReleasedPost
(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) static boolean
onScreenMouseReleasedPre
(Screen guiScreen, double mouseX, double mouseY, int button) static boolean
onScreenMouseScrollPost
(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) static boolean
onScreenMouseScrollPre
(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) static net.minecraftforge.eventbus.api.Event.Result
onScreenPotionSize
(Screen screen) 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
processForgeListPingData
(ServerStatus packet, ServerData target) static void
pushGuiLayer
(Minecraft minecraft, Screen screen) static void
static void
registerLayerDefinition
(ModelLayerLocation layerLocation, Supplier<LayerDefinition> supplier) static void
renderBossEventPost
(PoseStack poseStack, Window res) renderBossEventPre
(PoseStack poseStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment) static void
renderMainMenu
(TitleScreen gui, PoseStack poseStack, Font font, int width, int height, int alpha) static void
renderPistonMovedBlocks
(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource bufferSource, Level level, boolean checkSides, int packedOverlay, BlockRenderDispatcher blockRenderer) static boolean
renderSpecificFirstPersonArm
(PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, AbstractClientPlayer player, HumanoidArm arm) static boolean
renderSpecificFirstPersonHand
(InteractionHand hand, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, float partialTick, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) static void
resizeGuiLayers
(Minecraft minecraft, int width, int height) static void
setRenderType
(RenderType layer) static boolean
shouldCauseReequipAnimation
(ItemStack from, ItemStack to, int slot) static boolean
shouldRenderEffect
(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. -
renderType
-
forgeStatusLine
-
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
-
onDrawHighlight
public static boolean onDrawHighlight(LevelRenderer context, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) -
dispatchRenderLast
@Deprecated(forRemoval=true, since="1.18.2") public static void dispatchRenderLast(LevelRenderer context, PoseStack poseStack, float partialTick, Matrix4f projectionMatrix, long finishTimeNano) Deprecated, for removal: This API element is subject to removal in a future version. -
dispatchRenderStage
public static void dispatchRenderStage(RenderLevelStageEvent.Stage stage, LevelRenderer levelRenderer, PoseStack poseStack, Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) -
dispatchRenderStage
public static void dispatchRenderStage(RenderType renderType, LevelRenderer levelRenderer, PoseStack poseStack, Matrix4f projectionMatrix, int renderTick, Camera camera, Frustum frustum) -
renderSpecificFirstPersonHand
public static boolean renderSpecificFirstPersonHand(InteractionHand hand, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, float partialTick, float interpPitch, float swingProgress, float equipProgress, ItemStack stack) -
renderSpecificFirstPersonArm
public static boolean renderSpecificFirstPersonArm(PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, AbstractClientPlayer player, HumanoidArm arm) -
onTextureStitchedPre
-
onTextureStitchedPost
-
onBlockColorsInit
-
onItemColorsInit
-
setRenderType
-
getArmorModel
public static Model getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlot slot, HumanoidModel<?> _default) -
copyModelProperties
public 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
-
getFieldOfView
-
getFieldOfView
public static double getFieldOfView(GameRenderer renderer, Camera camera, double partialTick, double fov) -
renderMainMenu
public static void renderMainMenu(TitleScreen gui, PoseStack poseStack, Font font, int width, int height, int alpha) -
playSound
-
drawScreen
-
drawScreenInternal
-
getFogDensity
public static float getFogDensity(FogRenderer.FogMode type, Camera camera, float partialTick, float density) -
onFogRender
@Deprecated(forRemoval=true, since="1.18.2") public static void onFogRender(FogRenderer.FogMode type, Camera camera, float partialTick, float distance) Deprecated, for removal: This API element is subject to removal in a future version.to be removed in 1.19, use other onFogRender hook with more params -
onFogRender
public static void onFogRender(FogRenderer.FogMode type, Camera camera, float partialTick, float nearDistance, float farDistance, FogShape shape) -
onCameraSetup
public static EntityViewRenderEvent.CameraSetup onCameraSetup(GameRenderer renderer, Camera camera, float partial) -
onModelBake
public static void onModelBake(ModelManager modelManager, Map<ResourceLocation, BakedModel> modelRegistry, ForgeModelBakery modelLoader) -
handleCameraTransforms
public static BakedModel handleCameraTransforms(PoseStack poseStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery) -
getFluidSprites
public static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter level, BlockPos pos, FluidState fluidStateIn) -
gatherFluidTextures
-
getFluidMaterials
-
getBlockMaterial
-
fillNormal
internal, relies on fixed format of FaceBakery -
getVertexPos
-
loadEntityShader
-
shouldCauseReequipAnimation
-
renderBossEventPre
public static RenderGameOverlayEvent.BossInfo renderBossEventPre(PoseStack poseStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment) -
renderBossEventPost
-
onScreenshot
-
onClientChangeGameType
public static void onClientChangeGameType(PlayerInfo info, GameType currentGameMode, GameType newGameMode) -
handlePerspective
public static BakedModel handlePerspective(BakedModel model, ItemTransforms.TransformType type, PoseStack stack) -
onMovementInputUpdate
-
onScreenMouseClickedPre
public static boolean onScreenMouseClickedPre(Screen guiScreen, double mouseX, double mouseY, int button) -
onScreenMouseClickedPost
public static boolean onScreenMouseClickedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) -
onScreenMouseReleasedPre
public static boolean onScreenMouseReleasedPre(Screen guiScreen, double mouseX, double mouseY, int button) -
onScreenMouseReleasedPost
public static boolean onScreenMouseReleasedPost(Screen guiScreen, double mouseX, double mouseY, int button, boolean handled) -
onScreenMouseDragPre
public static boolean onScreenMouseDragPre(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) -
onScreenMouseDragPost
public static boolean onScreenMouseDragPost(Screen guiScreen, double mouseX, double mouseY, int mouseButton, double dragX, double dragY) -
onScreenMouseScrollPre
public static boolean onScreenMouseScrollPre(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) -
onScreenMouseScrollPost
public static boolean onScreenMouseScrollPost(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) -
onScreenKeyPressedPre
public static boolean onScreenKeyPressedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onScreenKeyPressedPost
public static boolean onScreenKeyPressedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onScreenKeyReleasedPre
public static boolean onScreenKeyReleasedPre(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onScreenKeyReleasedPost
public static boolean onScreenKeyReleasedPost(Screen guiScreen, int keyCode, int scanCode, int modifiers) -
onScreenCharTypedPre
-
onScreenCharTypedPost
-
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 poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay, boolean fabulous) -
isNameplateInRenderDistance
-
renderPistonMovedBlocks
public static void renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource bufferSource, Level level, boolean checkSides, int packedOverlay, BlockRenderDispatcher blockRenderer) -
registerForgeWorldPresetScreens
public static void registerForgeWorldPresetScreens() -
getPresetEditor
public static WorldPreset.PresetEditor getPresetEditor(Optional<WorldPreset> generator, @Nullable WorldPreset.PresetEditor biomegeneratortypescreens$ifactory) -
hasPresetEditor
-
getWorldPresetFromGenerator
public static Optional<WorldPreset> getWorldPresetFromGenerator(WorldGenSettings dimensionGeneratorSettings) -
getDefaultWorldPreset
-
shouldRenderEffect
-
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 poseStack, int x, int y, int width, int relativeMouseX, int relativeMouseY) -
getClientConnection
-
handleClientLevelClosing
-
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
-
onRenderTooltipPre
public static RenderTooltipEvent.Pre onRenderTooltipPre(@Nonnull ItemStack stack, PoseStack poseStack, int x, int y, int screenWidth, int screenHeight, @Nonnull List<ClientTooltipComponent> components, @Nullable Font forcedFont, @Nonnull Font fallbackFont) -
onRenderTooltipColor
public static RenderTooltipEvent.Color onRenderTooltipColor(@Nonnull ItemStack stack, PoseStack poseStack, 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) -
makeParticleRenderTypeComparator
public static Comparator<ParticleRenderType> makeParticleRenderTypeComparator(List<ParticleRenderType> renderOrder) -
onScreenPotionSize
-
isBlockInSolidLayer
-
createWorldConfirmationScreen
public static void createWorldConfirmationScreen(LevelStorageSource save, String worldName, boolean creatingWorld, Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier> worldData, Function<Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier>, Runnable> runAfter) -
getMaxMipmapLevel
public static int getMaxMipmapLevel(int width, int height)
-