Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Maxmad68/Minecraft-TouchBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft-TouchBar

This is a proof-of-concept of a use of the MacBook Pro's TouchBar.
It relies on the Forge Modding API, and on JTouchBar (https://github.com/Thizzer/jtouchbar).
By default, it shows the health, the coordinates and the amount of arrows in the player inventory.
As it relies on JTouchBar, you can modify the TouchBar as you want during the game.

Currently, the mod only supports 1.12.2.
Other versions will come soon, when I'll have more time.

Screenshots and Touchbarshots




Downloading

To use this mod, you'll need Forge (https://files.minecraftforge.net). You can download the mod in the Release section (Here). Then, copy the .jar file into you mods folder. To do so:
If you are on a Mac:

  • Open the Finder
  • Go to the "Go" menu, then "Go to folder" (or press ⇧⌘G)
  • Type ~/Library/Application Support/minecraft/mods
  • Copy the .jar here

If you are on Windows:

  • Buy a Mac

User guide / How it works

If you want to adapt the mod to fit all your needs, you can do so. Basically, you just need to know how Forge modding works, and to use the JTouchBar library. Some useful functions are already implemented.

  • getNSWindowUUID() : Retrieves the NSWindow UUID. Used to setup the JTouchBar.
  • setupTouchBar() : Sets up the TouchBar. Called as mod initialises.
  • populateTouchBar() : This function adds content to the TouchBar. Modify this one if you want more or other items.
  • getTouchBarImageForPath() : This function returns an Image object usable in JTouchBar control. It takes a string as a parameter, corresponding to the relative path (from the .jar root) to the image.

    Note:
    You can only add items to the TouchBar in the main thread. So, you can't add controls on Forge events. Then, I advice creating all controls in the populateTouchBar function, having your controls being public and so modify them later.

    Note again:
    Modifying TouchBar items makes the game very laggy for a short time (mostly on servers, idk why). Please ensure you REALLY need to modify it's content before doing it.

About

Use MacBook Pro’s TouchBar in Minecraft

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages