More Events
Adds more cancellable events to the ECS by overriding the class files that Hytale associates with certain interactions.
Описание
Больше событий
С тех пор Hytale пока не поддерживает определенные события, которые можно отменить, я сделал мод, который добавляет их!
С помощью этого мода вы можете относиться к таким событиям, как:
- сбор
- сбор урожая
- Заполнение ведер
- Размещение жидкостей
- Изменение стилей блоков
Как и другие отменяемые события, такие как взлом или размещение блоков, не мешая другим модам настраивать поведение этих событий.
Это довольно аккуратно, потому что, например, если вы хотите изменить поведение взаимодействия между двумя плагинами, используя только регистрацию класса, то логика обоих плагинов должна будет перейти в один, так как оверрайд - это настройка для сервера (не для плагина).
Как его использовать
Скачать MoreEvents
Больше событий. jar в папку зависимости от плагина (та же папка, что и Hytale). jar ваши ссылки на плагины для зависимостей
Марк Море Эвентс. jar как компиляторная зависимость в build.gradle.kts (или эквиваленте):
зависимости {
CompileOnly (файлы (libs/HytaleServer.jar))
CompileOnly (файлы ("libs/MoreEvents-1.0.jar")
?
Добавьте больше событий в манифест вашего мода. json как зависимость в формате:
"Зависимость" : {
"Моды: Больше событий" : ">=1.0.0"
?
Импорт события, которое вы хотели бы использовать
Зарегистрируйте систему с импортным событием! Бывший:
Общественный класс YourPlugin расширяется Java-плагин {
@Override
Защищенная установка void() {
GetEntityStoreRegistry(.registerSystem)
новый PlaceFluidEventSystem (PlaceFluidEvent.class)
?
?
общественный класс PlaceFluidEventSystem расширяет EntityEventSystem<EntityStore, PlaceFluidEvent>
публичный PlaceFluidEventSystem(@Nonnull) Класс <PlaceFluidEvent> eventType
Super (событие)
?
@Override
public void handle (int i, @Nonnull ArchetypeChunk<EntityStore>) архетип Чанк,
@Nonnull Store<EntityStore> магазин,
@Nonnull CommandBuffer<EntityStore> CommandBuffer,
@Nonnull PlaceFluidEvent PlaceFluidEvent
?
@Nullable
@Override
Публичный запрос <EntityStore> getQuery() {
вернуть Player.getComponentType();
?
?
Вы не видите события, которое хотите?
Теперь есть общие события, которые вы можете слушать, когда игрок нажимает или взаимодействует с блоком и обрабатывает до вашего конкретного события.
Если вы хотите, чтобы было добавлено определенное событие, чтобы вам не приходилось фильтровать так много, просто спросите, и я посмотрю, смогу ли я добавить его.
Показать оригинальное описание (English)
More Events
Since Hytale doesn't support certain cancellable events yet, I've made a mod that adds them!
With this mod you can treat events like :
- Gathering
- Harvesting
- Filling Buckets
- Placing Fluids
- Changing block styles
As you would other cancellable events like breaking or placing blocks without interfering with the ability of other mods to customize the behavior of those events.
This is pretty neat because if, for example, you wanted to modify an interaction behavior across two plugins using only class registration overrides the logic of BOTH plugins would have to go into one, as the override is a server-wide (not plugin-specific) setting.
How to use it
Download MoreEvents
Move MoreEvents.jar into your plugin dependency folder (the same folder as the Hytale.jar your plugin references for dependencies)
Mark MoreEvents.jar as a compile-only dependency in build.gradle.kts (or your equivalent) :
dependencies {
compileOnly(files("libs/HytaleServer.jar"))
compileOnly(files("libs/MoreEvents-1.0.jar"))
}
Add MoreEvents to your mod's manifest.json as a dependency in the format :
"Dependencies" : {
"Mods:MoreEvents" : ">=1.0.0"
}
Import the event you'd like to use
Register a system with the imported event! Ex :
public class YourPlugin extends JavaPlugin {
@Override
protected void setup() {
getEntityStoreRegistry().registerSystem(
new PlaceFluidEventSystem(PlaceFluidEvent.class));
}
}
public class PlaceFluidEventSystem extends EntityEventSystem<EntityStore, PlaceFluidEvent> {
public PlaceFluidEventSystem(@Nonnull Class<PlaceFluidEvent> eventType) {
super(eventType);
}
@Override
public void handle(int i, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk,
@Nonnull Store<EntityStore> store,
@Nonnull CommandBuffer<EntityStore> commandBuffer,
@Nonnull PlaceFluidEvent placeFluidEvent) {
}
@Nullable
@Override
public Query<EntityStore> getQuery() {
return Player.getComponentType();
}
}
Don't see the event you want?
There are now generic events you can listen for when a player hits or interacts (F Key) with a block and process down to your specific event.
If you'd like to request that a specific kind of event be added so you don't have to filter so many, just ask and I'll see if I can add it.
Последние версии
MoreEvents-1.1.jar
MoreEvents-1.0.jar
Информация
Авторы:
Категории:
Версии игры:
Создан: 21.01.2026