2
0

s_env.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include "cpp_api/s_base.h"
  18. #include "irr_v3d.h"
  19. #include "mapnode.h"
  20. #include <vector>
  21. class ServerEnvironment;
  22. struct ScriptCallbackState;
  23. class ScriptApiEnv : virtual public ScriptApiBase
  24. {
  25. public:
  26. // Called on environment step
  27. void environment_Step(float dtime);
  28. // Called after generating a piece of map
  29. void environment_OnGenerated(v3s16 minp, v3s16 maxp, u32 blockseed);
  30. // Called on player event
  31. void player_event(ServerActiveObject *player, const std::string &type);
  32. // Called after emerge of a block queued from core.emerge_area()
  33. void on_emerge_area_completion(v3s16 blockpos, int action,
  34. ScriptCallbackState *state);
  35. // Called after liquid transform changes
  36. void on_liquid_transformed(const std::vector<std::pair<v3s16, MapNode>> &list);
  37. void initializeEnvironment(ServerEnvironment *env);
  38. };