lambdas are hard
This commit is contained in:
parent
e2030eeba9
commit
13f9e169f0
@ -15,11 +15,12 @@ import java.util.function.Consumer;
|
|||||||
*/
|
*/
|
||||||
public final class GameEventHandler implements IGameEventListener {
|
public final class GameEventHandler implements IGameEventListener {
|
||||||
|
|
||||||
GameEventHandler() {}
|
GameEventHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onTick() {
|
public final void onTick() {
|
||||||
dispatch(behavior -> onTick());
|
dispatch(Behavior::onTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,17 +39,17 @@ public final class GameEventHandler implements IGameEventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(behavior -> onProcessKeyBinds());
|
dispatch(Behavior::onProcessKeyBinds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSendChatMessage(ChatEvent event) {
|
public void onSendChatMessage(ChatEvent event) {
|
||||||
dispatch(behavior -> onSendChatMessage(event));
|
dispatch(behavior -> behavior.onSendChatMessage(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChunkEvent(ChunkEvent event) {
|
public void onChunkEvent(ChunkEvent event) {
|
||||||
dispatch(behavior -> onChunkEvent(event));
|
dispatch(behavior -> behavior.onChunkEvent(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatch(Consumer<Behavior> dispatchFunction) {
|
private void dispatch(Consumer<Behavior> dispatchFunction) {
|
||||||
|
Loading…
Reference in New Issue
Block a user