use of org.terasology.engine.core.modes.GameState in project Terasology by MovingBlocks.
the class LoadingChunkEventSystem method onNewChunk.
/**
* Event handler which waits for new chunk events, then sends those
* events to the current game state
* @param chunkAvailable an event which includes the position of the new chunk
* @param worldEntity the world entity that this event was sent to
*/
@ReceiveEvent(components = WorldComponent.class)
public void onNewChunk(OnChunkLoaded chunkAvailable, EntityRef worldEntity) {
GameEngine gameEngine = context.get(GameEngine.class);
GameState gameState = gameEngine.getState();
gameState.onChunkLoaded(chunkAvailable, worldEntity);
}
use of org.terasology.engine.core.modes.GameState in project Terasology by MovingBlocks.
the class SceneProperties method getProperties.
@Override
public List<Property<?>> getProperties() {
List<Property<?>> result = Lists.newArrayList();
GameState gameState = engine.getState();
if (!(gameState instanceof StateIngame)) {
return result;
}
StateIngame ingameState = (StateIngame) gameState;
Context ingameContext = ingameState.getContext();
BackdropProvider backdropProvider = ingameContext.get(BackdropProvider.class);
if (backdropProvider != null) {
result.addAll(new ReflectionProvider(backdropProvider, ingameContext).getProperties());
}
/*FrameBuffersManager renderingProcess = ingameContext.get(FrameBuffersManager.class);
if (renderingProcess != null) {
result.addAll(new ReflectionProvider(renderingProcess, ingameContext).getProperties());
}*/
return result;
}
Aggregations