use of io.xol.chunkstories.api.exceptions.UnauthorizedClientActionException in project chunkstories-api by Hugobros3.
the class EntityComponentController method setController.
public void setController(Controller controller) {
// Checks we are entitled to do this
if (!(entity.getWorld() instanceof WorldMaster))
throw new UnauthorizedClientActionException("setController()");
Controller formerController = this.controller;
this.controller = controller;
// Tell the new controller he his
if (controller != null)
pushComponent(controller);
// Tell the former one he's no longer
if (formerController != null && (controller == null || !controller.equals(formerController)))
pushComponent(formerController);
}
Aggregations