-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eefd8e3
commit 99cb674
Showing
12 changed files
with
161 additions
and
57 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
#include "GMLIB/Macros.h" | ||
#include "mc/util/Random.h" | ||
#include "mc/world/level/BlockPos.h" | ||
#include "mc/world/level/BlockSource.h" | ||
#include "mc/world/level/levelgen/feature/helpers/RenderParams.h" | ||
#include "nlohmann/json.hpp" | ||
|
||
namespace GMLIB::Mod { | ||
|
||
class GMLIB_Feature { | ||
public: | ||
virtual ~GMLIB_Feature(); | ||
virtual std::optional<BlockPos> | ||
place(class BlockSource& source, class BlockPos const& pos, class Random& random, class RenderParams& renderParams) | ||
const = 0; | ||
}; | ||
class CustomFeature { | ||
public: | ||
GMLIB_API static void registerFeature(std::string const& name, std::shared_ptr<GMLIB_Feature> feature); | ||
GMLIB_API static void registerFeatureRule(nlohmann::json const& json); | ||
}; | ||
|
||
} // namespace GMLIB::Mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,83 @@ | ||
#pragma once | ||
#include "GMLIB/Macros.h" | ||
#include "ll/api/form/CustomForm.h" | ||
#include "mc/world/actor/player/Player.h" | ||
|
||
class GMLIB_ServerSettingForm { | ||
namespace GMLIB::Server::Form { | ||
|
||
enum class IconType : uchar { Texture = 0, Url = 1 }; | ||
|
||
class ServerSettingForm { | ||
public: | ||
ll::form::CustomForm mForm; | ||
GMLIB_API static int getDefaultPriority(); | ||
|
||
GMLIB_API static bool hasTitle(); | ||
|
||
GMLIB_API static std::string getTitle(); | ||
|
||
GMLIB_API static bool setTitle(std::string const& title, bool forceModify = false); | ||
|
||
GMLIB_API static bool hasIcon(); | ||
|
||
GMLIB_API static std::optional<std::string> getIconData(); | ||
|
||
GMLIB_API static std::optional<IconType> getIconType(); | ||
|
||
GMLIB_API static bool setIcon(std::string const& data, IconType type = IconType::Texture, bool forceModify = false); | ||
|
||
GMLIB_API static uint addLabel( | ||
std::string const& text, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static uint addInput( | ||
std::string const& text, | ||
std::string const& placeholder = {}, | ||
std::string const& defaultVal = {}, | ||
std::function<void(Player&, std::string const&)> callback = nullptr, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static uint addToggle( | ||
std::string const& text, | ||
bool defaultVal = false, | ||
std::function<void(Player&, bool)> callback = nullptr, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static uint addDropdown( | ||
std::string const& text, | ||
std::vector<std::string> const& options, | ||
size_t defaultVal = 0, | ||
std::function<void(Player&, int64)> callback = nullptr, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static uint addSlider( | ||
std::string const& text, | ||
double min, | ||
double max, | ||
double step = 0.0, | ||
double defaultVal = 0.0, | ||
std::function<void(Player&, double)> callback = nullptr, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static uint addStepSlider( | ||
std::string const& text, | ||
std::vector<std::string> const& steps, | ||
size_t defaultVal = 0, | ||
std::function<void(Player&, int64)> callback = nullptr, | ||
std::function<bool(Player&)> playerDetector = [](Player& pl) -> bool { return true; }, | ||
uint priority = getDefaultPriority() | ||
); | ||
|
||
GMLIB_API static bool removeElement(uint id); | ||
}; | ||
|
||
} // namespace GMLIB::Server::Form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters