Placeholders
PlaceholderAPI for developers to use in their code with unlimited options to use - use one of the default placeholders or register your own
Описание
Плагин для пользователей Hytale
Плагин, который обеспечивает систему заполнителей для Hytale, аналогичную PlaceholderAPI для Minecraft. Этот плагин позволяет использовать в тексте заполнители, которые будут заменены динамическими значениями.
Версия
Этот мод/плагин сделан для игровой версии «2026.01.17-4b0f30090». Очень вероятно, что он будет использоваться для других версий - на свой страх и риск. Как только будет выпущена стабильная версия игры, все версии будут поддерживаться.
Особенности
- Парсовые заполнители в формате
%placeholder % - Регистрация пользовательских заполнителей из других плагинов
- Встроенные держатели для общих ценностей
- Простой API для разработчиков
Использование для владельцев серверов
Просто установите плагин на свой сервер Hytale. Плагин автоматически регистрирует заполнители по умолчанию, которые вы можете использовать на своем сервере.
Заполнители по умолчанию:
%current_time % %- Текущее время%current_date%- Текущая дата%current_year % %- Текущий год%current_datetime%- Текущее время даты
Заполнители серверов:
%server_name %- Название сервера%server_motd%- Сервер Motd%server_password %- Пароль сервера%server_max_players %- Серверный плеер ограничивает%server_max_view_radius %- Максимальный радиус обзора%server_default_world_name %- Мировое имя по умолчанию%server_default_gamemode %- Режим игры по умолчанию
Заполнители места игрока (когда объект игрока предоставляется в качестве контекста → Должен быть PlayerRef):
%player_uuid%- UUID игрока%player_name%- Имя игрока%player_fall_distance%- Текущее расстояние падения игрока%player_gamemode %- игровой режим игрока%player_language %- Язык игрока%player_world_name%- Текущее имя игрока в мире%player_world_uuu %- В современном мире UUID игрок находится в%player_player_is_first_spawn%- Первый нерест игрока%player_x%- Координаты x игрока%player_y%- Координаты y игрока%player_z%- z координаты игрока%player_x_exact%- Точная координата x игрока%player_y_exact%- Точная координата игрока%player_z_exact%- Точная координата z игрока%player_health%- Здоровье игрока%player_max_health%- Максимальное здоровье игрока%player_min_health%- Мин здоровье игрока%player_mana%- Мана игрока%player_max_mana%- Максимальная мана игрока%player_min_mana%- Мин мана игрока%player_oxygen %Кислород игрока%player_max_oxygen%- Максимальный кислород игрока%player_min_oxygen%- Мин кислород игрока%player_stamina%- Выносливость игрока%player_max_stamina%- Максимальная выносливость игрока%player_min_stamina%- Выносливость игрока%player_ammo%- Боеприпасы игрока%player_max_ammo%- Максимальный боеприпас игрока%player_min_ammo%Мин патроны игрока
конфигурация
Конфигурация обновляется автоматически все 10 секунд.
{
"TimeFormat": "HH:mm:ss",
"ДатаФормат": "dd.MM.yyyyy",
"DateTimeFormat": "dd.MM.yyyy HH:mm:ss"
?
командование
/testplaceholdersПоказывает всем держателям места с ценностями для игрока
Использование для разработчиков
Добавление плагина в зависимость
стеллаж
Добавьте плагин в качестве зависимости от вашей сборки. gradle.kts файл:
зависимости {
CompileOnly (файлы ("libs/Placeholders-1.1.0.jar")
?
Мэйвен
Добавьте плагин в зависимости от вашего pom.xml
<зависимости>
<зависимость>
<groupId>com.texisoft</groupId>
<artifactId>placeholderapi</artifactId>
<version>1.1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/Placeholders-1.1.0-.jar</systemPath>
</зависимость>
</зависимость>
Изменить имя на имя файла .jar Если необходимо изменить версию (только для детей) Файл .jar должен быть в папке /libs. Создайте его, если его нет. Папка libs находится на той же глубине, что и папка src.
Регистрация пользовательских держателей
импортировать com.texisoft.plugin.api.PlaceholderAPI;
импортировать com.texisoft.plugin.api.Placeholder;
импортировать com.texisoft.plugin.placeholders.DefaultPlaceholder;
Получить экземпляр PlaceholderAPI
PlaceholderAPI api = PlaceholderAPI.getInstance();
// Регистрация простого заполнителя с статическим значением
api.registerPlaceholder(DefaultPlaceholder.ofStatic("my_placeholder", "My Value"));
// Регистрация заполнителя с динамическим значением
api.registerPlaceholder (новый) DefaultPlaceholder("my_dynamic_placeholder", контекст ->{)
// Вы можете использовать контекст для определения значения
// Например, если контекст является игроком, вы можете получить значения для конкретного игрока.
возврат «динамической ценности»;
));
Текст парсинга с держателями мест
импортировать com.texisoft.plugin.api.PlaceholderAPI;
Получить экземпляр PlaceholderAPI
PlaceholderAPI api = PlaceholderAPI.getInstance();
// Парсовый текст с заполнителями
Текст строки = "Добро пожаловать в %server_name%!";
String parsed = api.parse (текст, нуль);
// Если у вас есть специальные заполнители для игроков, вы можете передать игрока в качестве контекста. В настоящее время он должен быть «PlayerRef»
// String parsed = api.parse (текст, playerRef);
Создание пользовательских внедрений Placeholder
Вы можете создать свою собственную реализацию владелец интерфейс:
импортировать com.texisoft.plugin.api.Placeholder;
Общественный класс MyCustom Исполнитель Местонахождение {
@Override
Публичный String getIdentifier()
возврат «my_custom_placeholder»;
?
@Override
Публичная струнная ценность (объектный контекст) {
// Реализуйте свою логику здесь
возврат «Таможенная стоимость»;
?
?
Зарегистрируйте свой пользовательский хостинг
PlaceholderAPI.getInstance(.registerPlaceholder) MyCustomPlaceholder()
Использование PlayerPlaceholder для динамического извлечения данных
Плагин включает в себя a PlayerPlaceholder класс, который может динамически извлекать данные из объектов игрока с помощью отражения. Это полезно, когда вы хотите получить доступ к свойствам объектов игрока, не зная их точную структуру заранее.
импортировать com.texisoft.plugin.placeholders.PlayerPlaceholder;
// Создать заполнитель, который извлекает «имя» из объектов игрока
PlayerPlaceholder namePlaceholder = PlayerPlaceholder.of("player_name", "name", "Unknown Player");
// Создать заполнитель, который извлекает вложенное свойство (например, "location.x")
PlayerPlaceholder xPlaceholder = PlayerPlaceholder.of("player_x", "location.x") "0";
// Регистрация владельцев
PlaceholderAPI api = PlaceholderAPI.getInstance();
api.registerPlaceholder (имя Владельца);
api.registerPlaceholder (xPlaceholder);
// Используйте заполнители в тексте
Струнный текст = "Player %player_name% is at X: %player_x%";
String parsed = api.parse (текст, playerObject);
The PlayerPlaceholder Класс пытается использовать несколько подходов для извлечения данных:
- Использование методов геттера (например,
GetName()«Имя» собственности - Использование методов "есть" для булевых свойств (например,
IsOp()Для собственности «op» - Использование прямого доступа к полю, если методы недоступны
Он также поддерживает вложенные свойства (например, «location.x»), пересекая иерархию объектов.
Вы можете присоединиться к нашей кампании поддержки: https://discord.texisoft.com
Показать оригинальное описание (English)
Placeholders Plugin for Hytale
A plugin that provides a placeholder system for Hytale, similar to PlaceholderAPI for Minecraft. This plugin allows you to use placeholders in text, which will be replaced with dynamic values.
Version
This mod/plugin is made for the game version "2026.01.17-4b0f30090". It is very likely to be usable for other versions - at your own risk. As soon as a stable game version is released, all versions will be supported.
Features
- Parse placeholders in the format
%placeholder% - Register custom placeholders from other plugins
- Built-in placeholders for common values
- Simple API for developers
Usage for Server Owners
Simply install the plugin in your Hytale server. The plugin will automatically register default placeholders that you can use in your server.
Default placeholders:
%current_time%- The current time%current_date%- The current date%current_year%- The current year%current_datetime%- The current datetime
Server placeholders:
%server_name%- The server name%server_motd%- The server motd%server_password%- The server password%server_max_players%- The server player limit%server_max_view_radius%- The max view radius%server_default_world_name%- The default world name%server_default_gamemode%- The default game mode
Player placeholders (when a player object is provided as context → Must be a PlayerRef):
%player_uuid%- The UUID of the player%player_name%- The name of the player%player_fall_distance%- The current fall distance of the player%player_gamemode%- The game mode of the player%player_language%- The language of the player%player_world_name%- The current world name the player is in%player_world_uuid%- The current world UUID the player is in%player_player_is_first_spawn%- Is first spawn of player%player_x%- The x coordinate of the player%player_y%- The y coordinate of the player%player_z%- The z coordinate of the player%player_x_exact%- The exact x coordinate of the player%player_y_exact%- The exact y coordinate of the player%player_z_exact%- The exact z coordinate of the player%player_health%- The health of the player%player_max_health%- The max health of the player%player_min_health%- The min health of the player%player_mana%- The mana of the player%player_max_mana%- The max mana of the player%player_min_mana%- The min mana of the player%player_oxygen%- The oxygen of the player%player_max_oxygen%- The max oxygen of the player%player_min_oxygen%- The min oxygen of the player%player_stamina%- The stamina of the player%player_max_stamina%- The max stamina of the player%player_min_stamina%- The min stamina of the player%player_ammo%- The ammo of the player%player_max_ammo%- The max ammo of the player%player_min_ammo%- The min ammo of the player
Config
Config updates all 10 seconds automatically.
{
"TimeFormat": "HH:mm:ss",
"DateFormat": "dd.MM.yyyy",
"DateTimeFormat": "dd.MM.yyyy HH:mm:ss"
}
Commands
/testplaceholders- Shows all placeholders with values to the player
Usage for Developers
Adding the Plugin as a Dependency
Gradle
Add the plugin as a dependency in your build.gradle.kts file:
dependencies {
compileOnly(files("libs/Placeholders-1.1.0.jar"))
}
Maven
Add the plugin as a dependency in your pom.xml
<dependencies>
<dependency>
<groupId>com.texisoft</groupId>
<artifactId>placeholderapi</artifactId>
<version>1.1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/Placeholders-1.1.0-.jar</systemPath>
</dependency>
</dependencies>
Change the name to the name of the .jar file If needed change the version too (maven only) The .jar file has to be in the /libs folder. Create it if it is not present. The libs folder is in the same depth as the src folder
Registering Custom Placeholders
import com.texisoft.plugin.api.PlaceholderAPI;
import com.texisoft.plugin.api.Placeholder;
import com.texisoft.plugin.placeholders.DefaultPlaceholder;
// Get the PlaceholderAPI instance
PlaceholderAPI api = PlaceholderAPI.getInstance();
// Register a simple placeholder with a static value
api.registerPlaceholder(DefaultPlaceholder.ofStatic("my_placeholder", "My Value"));
// Register a placeholder with a dynamic value
api.registerPlaceholder(new DefaultPlaceholder("my_dynamic_placeholder", context -> {
// You can use the context to determine the value
// For example, if the context is a player, you can get player-specific values
return "Dynamic Value";
}));
Parsing Text with Placeholders
import com.texisoft.plugin.api.PlaceholderAPI;
// Get the PlaceholderAPI instance
PlaceholderAPI api = PlaceholderAPI.getInstance();
// Parse text with placeholders
String text = "Welcome to %server_name%!";
String parsed = api.parse(text, null);
// If you have player-specific placeholders, you can pass the player as the context. Current it must be a `PlayerRef`
// String parsed = api.parse(text, playerRef);
Creating Custom Placeholder Implementations
You can create your own implementation of the Placeholder interface:
import com.texisoft.plugin.api.Placeholder;
public class MyCustomPlaceholder implements Placeholder {
@Override
public String getIdentifier() {
return "my_custom_placeholder";
}
@Override
public String getValue(Object context) {
// Implement your custom logic here
return "Custom Value";
}
}
// Register your custom placeholder
PlaceholderAPI.getInstance().registerPlaceholder(new MyCustomPlaceholder());
Using PlayerPlaceholder for Dynamic Data Extraction
The plugin includes a PlayerPlaceholder class that can dynamically extract data from player objects using reflection. This is useful when you want to access properties of player objects without knowing their exact structure in advance.
import com.texisoft.plugin.placeholders.PlayerPlaceholder;
// Create a placeholder that extracts the "name" property from player objects
PlayerPlaceholder namePlaceholder = PlayerPlaceholder.of("player_name", "name", "Unknown Player");
// Create a placeholder that extracts a nested property (e.g., "location.x")
PlayerPlaceholder xPlaceholder = PlayerPlaceholder.of("player_x", "location.x", "0");
// Register the placeholders
PlaceholderAPI api = PlaceholderAPI.getInstance();
api.registerPlaceholder(namePlaceholder);
api.registerPlaceholder(xPlaceholder);
// Use the placeholders in text
String text = "Player %player_name% is at X: %player_x%";
String parsed = api.parse(text, playerObject);
The PlayerPlaceholder class tries multiple approaches to extract data:
- Using getter methods (e.g.,
getName()for "name" property) - Using "is" methods for boolean properties (e.g.,
isOp()for "op" property) - Using direct field access if methods are not available
It also supports nested properties (e.g., "location.x") by traversing the object hierarchy.
You can join our discord for support: https://discord.texisoft.com
Последние версии
Placeholders-1.1.0,jar
Placeholders-1.0.0.jar
Информация
Авторы:
Категории:
Версии игры:
Создан: 17.01.2026