Skip to content

Commit

Permalink
feat: Add ManagedKeyMapping.getBoundKeyDisplayName() #4
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Oct 30, 2024
1 parent e643478 commit 16d1733
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.blaze3d.platform.InputConstants;
import net.blay09.mods.kuma.api.*;
import net.minecraft.network.chat.Component;

public abstract class AbstractManagedKeyMapping implements ManagedKeyMapping {

Expand Down Expand Up @@ -73,4 +74,9 @@ public boolean handleWorldInput(WorldInputEvent event) {

return worldInputEventHandler.handle(event);
}

@Override
public Component getBoundKeyDisplayName() {
return getBinding().key().getDisplayName();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.blay09.mods.kuma.api;

import net.minecraft.network.chat.Component;

public interface ManagedKeyMapping {
InputBinding getBinding();

Expand Down Expand Up @@ -31,6 +33,8 @@ default boolean isActiveAndMatchesKey(int key, int scanCode, int modifiers) {

boolean handleWorldInput(WorldInputEvent event);

Component getBoundKeyDisplayName();

interface Builder {
Builder overrideCategory(String category);

Expand Down

0 comments on commit 16d1733

Please sign in to comment.