Controlify 2.0.0-beta.9
This version has the following builds - make sure you select the right one for your Minecraft version:
- 1.20.1
- 1.20.4
- 1.20.6 (also supports 1.20.5)
Rewritten binding system
The way Controlify consumes inputs from the controller has been completely rewritten. The aim of this rewrite was to make the system more data-driven and have a more robust API.
controller.bindings()
is now completely gone. Instead, you access a static supplier for a bind
in ControlifyBindings
and use that to get the instance of a bind for a controller.
if (ControlifyBindings.JUMP.on(controller).justPressed()) {
// do something!
}
Here's an example of how you can create your own InputBinding
:
public static InputBindingSupplier MY_CUSTOM_BINDING = ControlifyBindingApi.get().registerBinding(builder ->
.id("my_mod", "my_custom_binding")
.category(Component.literal("Cool category"))
.allowedContexts(BindContexts.IN_GAME) // highly recommended - will suppress outputs like justPressed() if incorrect context
.keyEmulation(options.keyJump) // example, optional
.addKeyCorrelation(options.keyAttack) // example, optional
.radialCandidate(RadialIcons.getEffect(MobEffect.JUMP_BOOST))); // example, optional
You should have this field in your Controlify entrypoint to ensure that the class is initialised before the registry is locked.
Remember, defaults are now data-driven, see below for how to use that. For this example, the key would be
my_mod:my_custom_binding
. If it is not set, your binding will be bound to empty. You can optionally hard-code a
default bind with .defaultBind
(layered bottom-most) though this is highly recommended against and is only useful
when generating bindings on-the-fly.
What is a bind context?
Bind contexts is a new system that suppresses binding outputs if the current context doesn't match. This prevents problems like binding the same input to, for example, Drop and Gui Back, as it could cause both to trigger.
It also lets Controlify know when binds will conflict, and display them in red in the options so the user knows when they've done something wrong.
This is something I'd like to expand on in the future, like making some UI to easily filter between contexts.
What is a key correlation?
Currently, key correlations don't do anything. Their intended use is to display a button in the Key Bindings vanilla
menu to direct users to bind their controller instead. Calling keyEmulation
implicitly calls addKeyCorrelation
with
the same key mapping.
Controller types are now namespaced
Controller types are now namespaced to allow for more flexibility.
Instead of
"theme": "xbox_one"
you now write
"namespace": "controlify:xbox_one"
Nothing else has changed for the controller identification file format.
Data-driven defaults
Resource packs can now define the default input for any binding.
- Can be specific to certain controller types using their namespaces.
- Layered through packs and default namespace (controlify:default)
assets/controlify/controllers/default_bind/dualsense.json
Note: if using a custom namespace, make sure to change assets/controlify
into your controller ID's namespace.
{
"defaults": {
"controlify:jump": {
"button": "controlify:button/touchpad",
// OR
"axis": "controlify:axis/left_stick_up",
// OR
"hat": "controlify:hat/custom_hat",
"target_state": "up",
// OR
"type": "empty",
// ALL ABOVE HAVE AN IMPLICIT TYPE EQUAL TO ITS KEY, e.g. `type: button`
}
}
}
Here is an example of overriding the default jump binding, only for DualSense controllers. All the other defaults not specified in this file will be taken from the default namespace.
These changes are safely loaded between reloading packs (applying packs in the resource pack screen without restart).
A side effect of these changes is that bindings that are set to the default are no longer serialized. This allows packs that modify defaults to fully apply their changes without having to reset the binds individually.
Reloadable controller identification
Changes made in controller_identification.json5
are now properly reloaded.
Controllers which have already been added will be checked to see if their identification has changed and automatically disconnect/reconnect in order to apply those changes.
Legacy Console Edition defaults
Using all of the new stuff above, Controlify now includes a built-in pack that applies the Legacy Console Edition controller defaults to all controllers. This pack will be off by default. In the future, I hope to expand this pack to add the old-style controller button glyphs.
You can use this by going to the resource packs screen and enabling the "Legacy Console" pack.
Controlify Event refactor
An effort is being made to port Controlify to architectury (NeoForge support). This means a slow
abstraction away from Fabric API throughout the mod. Controlify was previously using Fabric API's Event
class
for custom events.
Starting from this version, Controlify Events use a custom API (behind the scenes it still uses the FAPI one!). The side effect of this is that all events now consume a single record type, containing the old arguments for the callback. This makes it simpler to abstract the existing forge event bus stuff when the time comes.
Controlify 2.0.0 (Beta 8)
This version has the following builds - make sure you select the right one for your Minecraft version:
- 1.20.1
- 1.20.4
- 1.20.6 (also supports 1.20.5)
Bug fixes
- Fix 1.20.1 specific issue where Controlify never initialised
- Fix issue where Controlify would not initialise in quiet mode
Controlify 2.0.0 (Beta 7)
This version has the following builds - make sure you select the right one for your Minecraft version:
- 1.20.1
- 1.20.4
- 1.20.6 (also supports 1.20.5)
On-screen keyboard
This build adds a new on-screen keyboard that is currently only available in the chat screen.
This replaces the old functionality of attempting to open the system keyboard which could lead to the game window being minimized or the keyboard being hidden behind the window.
This feature is currently experimental, and can be disabled per-controller in the settings menu. The layout is not final and feedback is appreciated while I continue to improve it such as the layout.
Yes, it is planned that this keyboard will automatically appear for any other text input fields in the future.
Other changes
- Add DualSense mute button light integration with simple voice chat mod.
- Re-enable mod compatibilities on 1.20.6 build. (except Iris for now)
- Update the SDL controller mapping definitions
Bug fixes
- Fix crash when pressing B on the title screen and other glitches with buttons in menus.
- Fix rumble master volume not doing anything
- Fix DualShock 4 and DualShock 3 icons not working.
Controlify 2.0.0-beta.6
Bug Fixes
- Fix crash when joining multiplayer
Bug Fixes
- Fix YACL version constraint being set to an unreleased version of YACL
This build targets 1.20.1
, 1.20.4
and 1.20.5-rc2
More supported controllers!
- Added support for Switch Pro controllers and any switch controllers that emulate it.
- A new icon set is also present for switch controllers
- This is not support for JoyCons
- Added support for a new firmware of Xbox controllers.
Bind icons - now powered by fonts!
The button icon rendering system has been completely overhauled. It now utilises the font renderer. Other mods can now embed these icons within their text components, and servers can now send these through the chat.
// will display as the missing character square on clients without Controlify
{"key": "controlify:walk_forward", "font": "controlify:inputs"}
// will display 'No controlify here' with clients without Controlify
{"translate": "controlify.placeholder","with":[{"key": "controlify:walk_forward", "font": "controlify:inputs"},"No controlify here!"]}
This also allows for resource packs to provide HD icons!
New button icon set!
Many previous icons have been redrawn. They are now using 16x textures.
- DualSense controllers now have an additional texture for the mute button (this is functional by the way!)
- Xbox Series controllers now have an additional texture for the share button (also functional!)
- Generic controllers now have textures for paddles and an extra miscellaneous button for controllers that support it
- A completely new Switch Pro icon set to go along with Switch Pro controller support.
Server handshake
Servers with Controlify installed will now initiate a handshake with the player;
- If a client does not have Controlify installed, it will allow them to connect
- If a client has Controlify installed but the protocol is not the same as the server, it will be disconnected
- If a client has Controlify with a matching protocol version, it will allow them to connect
Note: protocol version is not the same thing as mod version. It is only changed when a change is made to the way packets are sent and received.
Note: the client will not make itself known to a server unless the server implements the handshake protocol.
Changes
- Controlify will now hard-crash when it fails to create a controller
- This is useful because it will be more obvious to you that there was an issue, rather than Controlify just not detecting it and silently failing. You will be able to submit a crash report to me to get it sorted.
- A new toast is now displayed after an unfixable error occurred and the controller config had to be reset
- Prevent the 'use the mouse' tutorial from appearing when a new world is started in controller mode.
- Switch use-item rumble to be under the 'Interaction' category, rather than 'Player'
Bug fixes
- Fix a memory leak that retained world data through the 'Loading Terrain' screen. (#293)
- Fix vibration not disabling when 'Allow Vibration' is off (#263)
- Fix 'cannot find SDL3.dll' logs spamming (#294)
- Don't enable the HD Haptics component if on macOS since it's broken
- Fix an error that was causing controller configuration to reset (#290)
Update target version from potato snapshot to 1.20.5-pre1
Additions
- Radial menus for creative hotbar save/load
- Radial menu to select hotbar slot
- Now publishing a secondary offline jar that bundles all the natives inside the JAR This jar will not ask to load SDL. It will attempt to do so automatically.
Translations
Controlify is now on Crowdin, if you'd like to help, join my discord and ask!
- 100% complete French translation - thanks Myuui!
- 100% complete Mexican Spanish translation - thanks TheLegendofSaram and Zetsphiron!
Bug Fixes
- Fix water splash rumble being applied when flying through water in spectator mode
- Fix mixed input not working after enabling explicitly in config screen (closes #267)
- Fix radial button not being able to be changed (closes #275)
- Fix disconnecting/reconnecting the same controller being detect as a second controller (closes #276)
- Fix axes not working when rebound in the settings (closes #274)
- Fix in-game drop key conflicting with gui back/exit bind (close #272)
- Optimise some mixins
Added support for 1.20.1, please report any weird issues concerning this!
Changes
- Only let users change 'Load Natives' option if they are supported on the system
- Fix DualSense
left_stick_up
icon being broken - Game Mode Switcher - you can now bind a key to open a radial menu to change the current game mode
- Rewritten flick stick to be accurate
- Fix crash when the config can't be read