From 13f9e169f001173b9588e0c0ffeaf96c1ddaddbd Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 4 Aug 2018 15:31:52 -0400 Subject: [PATCH] lambdas are hard --- src/main/java/baritone/bot/GameEventHandler.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/bot/GameEventHandler.java b/src/main/java/baritone/bot/GameEventHandler.java index a378c9d0..c0f12d87 100755 --- a/src/main/java/baritone/bot/GameEventHandler.java +++ b/src/main/java/baritone/bot/GameEventHandler.java @@ -15,11 +15,12 @@ import java.util.function.Consumer; */ public final class GameEventHandler implements IGameEventListener { - GameEventHandler() {} + GameEventHandler() { + } @Override public final void onTick() { - dispatch(behavior -> onTick()); + dispatch(Behavior::onTick); } @Override @@ -38,17 +39,17 @@ public final class GameEventHandler implements IGameEventListener { } } - dispatch(behavior -> onProcessKeyBinds()); + dispatch(Behavior::onProcessKeyBinds); } @Override public void onSendChatMessage(ChatEvent event) { - dispatch(behavior -> onSendChatMessage(event)); + dispatch(behavior -> behavior.onSendChatMessage(event)); } @Override public void onChunkEvent(ChunkEvent event) { - dispatch(behavior -> onChunkEvent(event)); + dispatch(behavior -> behavior.onChunkEvent(event)); } private void dispatch(Consumer dispatchFunction) {