Update key-binding-api-v1 example ()

Switches from events-lifecycle-v0 to lifecycle-events-v1
This commit is contained in:
Grayray 2021-02-14 18:42:19 +01:00 committed by GitHub
parent cd0f1d33c1
commit 4ee10f8910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions
fabric-key-binding-api-v1
build.gradle
src/testmod
java/net/fabricmc/fabric/test/client/keybinding
resources

View file

@ -3,6 +3,6 @@ version = getSubprojectVersion(project, "1.0.2")
dependencies {
testmodCompile project(path: ':fabric-api-base', configuration: 'dev')
testmodCompile project(path: ':fabric-events-lifecycle-v0', configuration: 'dev')
testmodCompile project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodCompile project(path: ':fabric-resource-loader-v0', configuration: 'dev')
}

View file

@ -25,7 +25,7 @@ import net.minecraft.text.LiteralText;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.event.client.ClientTickCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
public class KeyBindingsTest implements ClientModInitializer {
@Override
@ -34,7 +34,7 @@ public class KeyBindingsTest implements ClientModInitializer {
KeyBinding binding2 = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.fabric-key-binding-api-v1-testmod.test_keybinding_2", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_U, "key.category.second.test"));
KeyBinding stickyBinding = KeyBindingHelper.registerKeyBinding(new StickyKeyBinding("key.fabric-key-binding-api-v1-testmod.test_keybinding_sticky", GLFW.GLFW_KEY_R, "key.category.first.test", () -> true));
ClientTickCallback.EVENT.register(client -> {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
while (binding1.wasPressed()) {
client.player.sendMessage(new LiteralText("Key 1 was pressed!"), false);
}

View file

@ -7,7 +7,7 @@
"license": "Apache-2.0",
"depends": {
"fabric-api-base": "*",
"fabric-events-lifecycle-v0": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-key-binding-api-v1": "*"
},
"entrypoints": {