A LordOfTheTales adapter
This is a Platform Adapter (sa-*).
This is the ONLY module that can import Hytale classes.
All platform-specific code is isolated here to protect business logic from API changes.
- Implement Accessor Interfaces - Provide concrete implementations of all
accessor-apiinterfaces - Type Conversion - Convert between Hytale types and platform-agnostic DTOs
- Event Translation - Translate Hytale events to accessor events
- Lifecycle Management - Handle plugin lifecycle with Hytale server
<dependency>
<groupId>com.argonathsystems.adapter</groupId>
<artifactId>hytale-adapter</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency># Build
just build
# Run tests
just test
# Deploy to Hytale mods folder
just deploycom/argonathsystems/adapter/hytaleadapter/
├── HytaleAdapterPlugin.java # Main plugin entry point
├── HytaleAdapterProvider.java # AccessorProvider implementation
├── accessor/ # Accessor implementations
│ ├── HytalePlayerAccessor.java
│ ├── HytaleItemAccessor.java
│ ├── HytaleWorldAccessor.java
│ └── ...
├── converter/ # DTO <-> Hytale converters
│ ├── LocationConverter.java
│ ├── ItemDataConverter.java
│ └── ...
└── event/ # Event translation
└── HytaleEventAdapter.java
// ✅ ALLOWED - Hytale imports in adapter module
import com.hytale.api.entity.Player;
import com.hytale.api.Server;
// Implement the accessor interface
public class HytalePlayerAccessor implements PlayerAccessor {
private final Server server;
public HytalePlayerAccessor(Server server) {
this.server = server;
}
@Override
public Optional<PlayerData> getPlayer(UUID playerId) {
// Convert Hytale Player to platform-agnostic DTO
Player hytalePlayer = server.getPlayer(playerId);
if (hytalePlayer == null) {
return Optional.empty();
}
return Optional.of(PlayerConverter.toDto(hytalePlayer));
}
}
⚠️ Hytale is in Alpha/Pre-releaseThe Hytale API will change significantly before 1.0. By isolating all Hytale calls to this module:
- Breaking changes only affect this adapter
- Business logic in framework/mods remains stable
- Updates can be done quickly in one place
MIT