Skip to content

Commit

Permalink
feat: Move flight status into its own data type, use lombok for data …
Browse files Browse the repository at this point in the history
…class (#273)

* refactor: use lombok, separate flight, close #191

* refactor: suppress some warnings

* refactor: suppress unused `from` warnings

* refactor: correct bad null-annotations on Items

* refactor: fix null annotation on `getStack`

* refactor: override methods for getting flight status

* docs: add deprecation docs for flight in gamemode data
  • Loading branch information
WiIIiam278 authored Apr 10, 2024
1 parent be5d112 commit a35e83a
Show file tree
Hide file tree
Showing 16 changed files with 196 additions and 370 deletions.
15 changes: 6 additions & 9 deletions bukkit/src/main/java/net/william278/husksync/BukkitHuskSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
import net.william278.husksync.config.Locales;
import net.william278.husksync.config.Server;
import net.william278.husksync.config.Settings;
import net.william278.husksync.data.BukkitSerializer;
import net.william278.husksync.data.Data;
import net.william278.husksync.data.Identifier;
import net.william278.husksync.data.Serializer;
import net.william278.husksync.data.*;
import net.william278.husksync.database.Database;
import net.william278.husksync.database.MongoDbDatabase;
import net.william278.husksync.database.MySqlDatabase;
Expand Down Expand Up @@ -144,12 +141,13 @@ public void onEnable() {
registerSerializer(Identifier.ENDER_CHEST, new BukkitSerializer.EnderChest(this));
registerSerializer(Identifier.ADVANCEMENTS, new BukkitSerializer.Advancements(this));
registerSerializer(Identifier.LOCATION, new BukkitSerializer.Location(this));
registerSerializer(Identifier.HEALTH, new BukkitSerializer.Health(this));
registerSerializer(Identifier.HUNGER, new BukkitSerializer.Hunger(this));
registerSerializer(Identifier.GAME_MODE, new BukkitSerializer.GameMode(this));
registerSerializer(Identifier.HEALTH, new BukkitSerializer.Json<>(this, BukkitData.Health.class));
registerSerializer(Identifier.HUNGER, new BukkitSerializer.Json<>(this, BukkitData.Hunger.class));
registerSerializer(Identifier.GAME_MODE, new BukkitSerializer.Json<>(this, BukkitData.GameMode.class));
registerSerializer(Identifier.FLIGHT_STATUS, new BukkitSerializer.Json<>(this, BukkitData.FlightStatus.class));
registerSerializer(Identifier.POTION_EFFECTS, new BukkitSerializer.PotionEffects(this));
registerSerializer(Identifier.STATISTICS, new BukkitSerializer.Statistics(this));
registerSerializer(Identifier.EXPERIENCE, new BukkitSerializer.Experience(this));
registerSerializer(Identifier.EXPERIENCE, new BukkitSerializer.Json<>(this, BukkitData.Experience.class));
registerSerializer(Identifier.PERSISTENT_DATA, new BukkitSerializer.PersistentData(this));
});

Expand All @@ -168,7 +166,6 @@ public void onEnable() {
case MYSQL, MARIADB -> new MySqlDatabase(this);
case POSTGRES -> new PostgresDatabase(this);
case MONGO -> new MongoDbDatabase(this);
default -> throw new IllegalStateException("Invalid database type");
};
this.database.initialize();
});
Expand Down
Loading

0 comments on commit a35e83a

Please sign in to comment.