From c0823bb903dddcaf65d0dd1e3cc6e0900bd3f6fd Mon Sep 17 00:00:00 2001 From: Ali-RS Date: Mon, 3 Dec 2018 12:35:02 +0330 Subject: [PATCH] Added a getState() method that will optionally fail on state misses. --- .../src/main/java/com/jme3/app/state/BaseAppState.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/app/state/BaseAppState.java b/jme3-core/src/main/java/com/jme3/app/state/BaseAppState.java index a8a80f19e..cee045355 100644 --- a/jme3-core/src/main/java/com/jme3/app/state/BaseAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/state/BaseAppState.java @@ -142,7 +142,11 @@ public abstract class BaseAppState implements AppState { } public final T getState( Class type ) { - return getStateManager().getState(type); + return getState( type, false ); + } + + public final T getState( Class type, boolean failOnMiss ) { + return getStateManager().getState( type, failOnMiss ); } @Override