fix up some things

This commit is contained in:
Tofaa 2024-01-28 17:41:34 +04:00
parent 9cc097aab2
commit 522e31ef12
10 changed files with 59 additions and 104 deletions

View file

@ -5,49 +5,16 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9d5d9b6f-43c8-41a4-bb42-a66ffc96c9b0" name="Changes" comment=""> <list default="true" id="9d5d9b6f-43c8-41a4-bb42-a66ffc96c9b0" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityIdProvider.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityUuidProvider.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EventBus.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EventBusAsync.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EventBusSync.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EventListener.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/extras/VersionChecker.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/MetaConverterRegistry.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/UsedVersion.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/VersionCompatCheck.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/display/AbstractDisplayMeta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/display/BlockDisplayMeta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/display/ItemDisplayMeta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/display/TextDisplayMeta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntityEquipment.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperLivingEntity.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractEntityLibAPI.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractPlatform.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractWorldWrapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotWorld.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestEntityLibPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/APISettings.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/APISettings.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/APISettings.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/APIConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLib.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLib.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLib.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLib.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLibAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLibAPI.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLibAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/EntityLibAPI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/Platform.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/Platform.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/Platform.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/Platform.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/WorldWrapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/WorldWrapper.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractEntityLibAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractEntityLibAPI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EntityLibEvent.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/EntityLibEvent.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractPlatform.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/me/tofaa/entitylib/common/AbstractPlatform.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/UserReceiveMetaUpdateEvent.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/event/types/UserReceiveMetaUpdateEvent.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/platforms/spigot/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibAPI.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibAPI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibPlatform.java" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibPlatform.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibPlatform.java" beforeDir="false" afterPath="$PROJECT_DIR$/platforms/spigot/src/main/java/me/tofaa/entitylib/spigot/SpigotEntityLibPlatform.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/settings.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/settings.gradle" afterDir="false" /> <change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestEntityLibPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/testentitylib/TestEntityLibPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/EntityLibPlugin.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/SpawnClickableFrogCommand.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestCommand.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestDisplayCommand.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestEntityCommand.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/resources/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/resources/plugin.yml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -110,35 +77,35 @@
<option name="showExcludedFiles" value="false" /> <option name="showExcludedFiles" value="false" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"Downloaded.Files.Path.Enabled": "false", &quot;Downloaded.Files.Path.Enabled&quot;: &quot;false&quot;,
"Gradle.Build EntityLib.executor": "Run", &quot;Gradle.Build EntityLib.executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib [dependencies].executor": "Run", &quot;Gradle.EntityLib [dependencies].executor&quot;: &quot;Run&quot;,
"Gradle.EntityLib:test-plugin [runServer].executor": "Run", &quot;Gradle.EntityLib:test-plugin [runServer].executor&quot;: &quot;Run&quot;,
"Repository.Attach.Annotations": "false", &quot;Repository.Attach.Annotations&quot;: &quot;false&quot;,
"Repository.Attach.JavaDocs": "false", &quot;Repository.Attach.JavaDocs&quot;: &quot;false&quot;,
"Repository.Attach.Sources": "false", &quot;Repository.Attach.Sources&quot;: &quot;false&quot;,
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"git-widget-placeholder": "feat/platform-api", &quot;git-widget-placeholder&quot;: &quot;feat/platform-api&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"jdk.selected.JAVA_MODULE": "corretto-17", &quot;jdk.selected.JAVA_MODULE&quot;: &quot;corretto-17&quot;,
"kotlin-language-version-configured": "true", &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
"last_opened_file_path": "D:/Github/EntityLib/api/src/main/java/me/tofaa/entitylib/meta", &quot;last_opened_file_path&quot;: &quot;D:/Github/EntityLib/api/src/main/java/me/tofaa/entitylib/meta&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"project.structure.last.edited": "Modules", &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
"project.structure.proportion": "0.15", &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
"project.structure.side.proportion": "0.2", &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
"settings.editor.selected.configurable": "preferences.pluginManager", &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="D:\Github\EntityLib\api\src\main\java\me\tofaa\entitylib\meta" /> <recent name="D:\Github\EntityLib\api\src\main\java\me\tofaa\entitylib\meta" />
@ -288,6 +255,8 @@
<workItem from="1706187926445" duration="4339000" /> <workItem from="1706187926445" duration="4339000" />
<workItem from="1706248178234" duration="17096000" /> <workItem from="1706248178234" duration="17096000" />
<workItem from="1706284605696" duration="11691000" /> <workItem from="1706284605696" duration="11691000" />
<workItem from="1706371324325" duration="1187000" />
<workItem from="1706443875388" duration="3245000" />
</task> </task>
<servers /> <servers />
</component> </component>

View file

@ -10,7 +10,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.URL; import java.net.URL;
public final class APISettings { public final class APIConfig {
private final PacketEventsAPI<?> packetEvents; private final PacketEventsAPI<?> packetEvents;
private boolean debugMode = false; private boolean debugMode = false;
@ -20,7 +20,7 @@ public final class APISettings {
private boolean useAsyncEvents = false; private boolean useAsyncEvents = false;
private boolean defaultCommands = false; private boolean defaultCommands = false;
public APISettings(PacketEventsAPI<?> packetEvents) { public APIConfig(PacketEventsAPI<?> packetEvents) {
this.packetEvents = packetEvents; this.packetEvents = packetEvents;
} }
@ -39,32 +39,32 @@ public final class APISettings {
return !version.equalsIgnoreCase(latest); return !version.equalsIgnoreCase(latest);
} }
public @NotNull APISettings usePlatformLogger() { public @NotNull APIConfig usePlatformLogger() {
this.platformLogger = true; this.platformLogger = true;
return this; return this;
} }
public @NotNull APISettings checkForUpdates() { public @NotNull APIConfig checkForUpdates() {
this.checkForUpdates = true; this.checkForUpdates = true;
return this; return this;
} }
public @NotNull APISettings tickTickables() { public @NotNull APIConfig tickTickables() {
this.tickTickables = true; this.tickTickables = true;
return this; return this;
} }
public @NotNull APISettings debugMode() { public @NotNull APIConfig debugMode() {
this.debugMode = true; this.debugMode = true;
return this; return this;
} }
public @NotNull APISettings registerDefaultCommands() { public @NotNull APIConfig registerDefaultCommands() {
this.defaultCommands = true; this.defaultCommands = true;
return this; return this;
} }
public @NotNull APISettings useAsyncEvents() { public @NotNull APIConfig useAsyncEvents() {
this.useAsyncEvents = true; this.useAsyncEvents = true;
return this; return this;
} }

View file

@ -10,7 +10,7 @@ public final class EntityLib {
private static Platform platform; private static Platform platform;
private static EntityLibAPI api; private static EntityLibAPI api;
public static void init(Platform<?> platform, APISettings settings) { public static void init(Platform<?> platform, APIConfig settings) {
EntityLib.platform = platform; EntityLib.platform = platform;
platform.setupApi(settings); platform.setupApi(settings);
api = platform.getAPI(); api = platform.getAPI();

View file

@ -5,7 +5,6 @@ import me.tofaa.entitylib.tick.TickContainer;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.Collection; import java.util.Collection;
import java.util.UUID;
/** /**
* Represents the API for EntityLib. * Represents the API for EntityLib.
@ -34,9 +33,9 @@ public interface EntityLibAPI<W, T> {
@NotNull WorldWrapper<W> wrapWorld(W world); @NotNull WorldWrapper<W> wrapWorld(W world);
/** /**
* @return The {@link APISettings} for the API. * @return The {@link APIConfig} for the API.
*/ */
@NotNull APISettings getSettings(); @NotNull APIConfig getSettings();
/** /**
* @return An unmodifiable collection of TickContainers. * @return An unmodifiable collection of TickContainers.

View file

@ -1,10 +1,8 @@
package me.tofaa.entitylib; package me.tofaa.entitylib;
import me.tofaa.entitylib.event.EntityLibEvent;
import me.tofaa.entitylib.event.EventBus; import me.tofaa.entitylib.event.EventBus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.function.Consumer;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
@ -45,7 +43,7 @@ public interface Platform<P> {
/** /**
* Gets the event bus for the platform. * Gets the event bus for the platform.
* WARNING: If you have {@link APISettings#shouldUseAsyncEvents()} set to true, cast this to {@link EventBus.Async} when handling cancelled events. * WARNING: If you have {@link APIConfig#shouldUseAsyncEvents()} set to true, cast this to {@link EventBus.Async} when handling cancelled events.
* @return * @return
*/ */
@NotNull EventBus getEventBus(); @NotNull EventBus getEventBus();
@ -54,7 +52,7 @@ public interface Platform<P> {
* Sets up the API for the platform. This method should be called automatically by the platform. Don't call it yourself. * Sets up the API for the platform. This method should be called automatically by the platform. Don't call it yourself.
* @param settings * @param settings
*/ */
void setupApi(@NotNull APISettings settings); void setupApi(@NotNull APIConfig settings);
/** /**
* @return The API instance. * @return The API instance.

View file

@ -1,7 +1,7 @@
package me.tofaa.entitylib.common; package me.tofaa.entitylib.common;
import com.github.retrooper.packetevents.PacketEventsAPI; import com.github.retrooper.packetevents.PacketEventsAPI;
import me.tofaa.entitylib.APISettings; import me.tofaa.entitylib.APIConfig;
import me.tofaa.entitylib.EntityLibAPI; import me.tofaa.entitylib.EntityLibAPI;
import me.tofaa.entitylib.Platform; import me.tofaa.entitylib.Platform;
import me.tofaa.entitylib.tick.TickContainer; import me.tofaa.entitylib.tick.TickContainer;
@ -15,10 +15,10 @@ public abstract class AbstractEntityLibAPI<P, W, T> implements EntityLibAPI<W, T
protected final Platform<P> platform; protected final Platform<P> platform;
protected final PacketEventsAPI<?> packetEvents; protected final PacketEventsAPI<?> packetEvents;
protected final APISettings settings; protected final APIConfig settings;
protected final Collection<TickContainer<?, T>> tickContainers; protected final Collection<TickContainer<?, T>> tickContainers;
protected AbstractEntityLibAPI(Platform<P> platform, APISettings settings) { protected AbstractEntityLibAPI(Platform<P> platform, APIConfig settings) {
this.platform = platform; this.platform = platform;
this.packetEvents = settings.getPacketEvents(); this.packetEvents = settings.getPacketEvents();
this.settings = settings; this.settings = settings;
@ -27,7 +27,7 @@ public abstract class AbstractEntityLibAPI<P, W, T> implements EntityLibAPI<W, T
@NotNull @NotNull
@Override @Override
public APISettings getSettings() { public APIConfig getSettings() {
return settings; return settings;
} }

View file

@ -1,6 +1,6 @@
package me.tofaa.entitylib.common; package me.tofaa.entitylib.common;
import me.tofaa.entitylib.APISettings; import me.tofaa.entitylib.APIConfig;
import me.tofaa.entitylib.EntityIdProvider; import me.tofaa.entitylib.EntityIdProvider;
import me.tofaa.entitylib.EntityUuidProvider; import me.tofaa.entitylib.EntityUuidProvider;
import me.tofaa.entitylib.Platform; import me.tofaa.entitylib.Platform;
@ -26,7 +26,7 @@ public abstract class AbstractPlatform<P> implements Platform<P> {
@Override @Override
public void setupApi(@NotNull APISettings settings) { public void setupApi(@NotNull APIConfig settings) {
this.eventBus = EventBus.newBus(settings.shouldUseAsyncEvents()); this.eventBus = EventBus.newBus(settings.shouldUseAsyncEvents());
this.entityIdProvider = new EntityIdProvider.DefaultEntityIdProvider(); this.entityIdProvider = new EntityIdProvider.DefaultEntityIdProvider();
this.entityUuidProvider = new EntityUuidProvider.DefaultEntityUuidProvider(); this.entityUuidProvider = new EntityUuidProvider.DefaultEntityUuidProvider();

View file

@ -1,11 +1,8 @@
package me.tofaa.entitylib.spigot; package me.tofaa.entitylib.spigot;
import com.github.retrooper.packetevents.PacketEventsAPI; import me.tofaa.entitylib.APIConfig;
import me.tofaa.entitylib.APISettings;
import me.tofaa.entitylib.EntityLibAPI;
import me.tofaa.entitylib.WorldWrapper; import me.tofaa.entitylib.WorldWrapper;
import me.tofaa.entitylib.common.AbstractEntityLibAPI; import me.tofaa.entitylib.common.AbstractEntityLibAPI;
import me.tofaa.entitylib.event.EventBus;
import me.tofaa.entitylib.tick.TickContainer; import me.tofaa.entitylib.tick.TickContainer;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
@ -13,16 +10,12 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
public class SpigotEntityLibAPI extends AbstractEntityLibAPI<JavaPlugin, World, BukkitTask> { public class SpigotEntityLibAPI extends AbstractEntityLibAPI<JavaPlugin, World, BukkitTask> {
SpigotEntityLibAPI(SpigotEntityLibPlatform platform, APISettings settings) { SpigotEntityLibAPI(SpigotEntityLibPlatform platform, APIConfig settings) {
super(platform, settings); super(platform, settings);
} }

View file

@ -1,11 +1,8 @@
package me.tofaa.entitylib.spigot; package me.tofaa.entitylib.spigot;
import me.tofaa.entitylib.APISettings; import me.tofaa.entitylib.APIConfig;
import me.tofaa.entitylib.EntityIdProvider;
import me.tofaa.entitylib.EntityLibAPI; import me.tofaa.entitylib.EntityLibAPI;
import me.tofaa.entitylib.Platform;
import me.tofaa.entitylib.common.AbstractPlatform; import me.tofaa.entitylib.common.AbstractPlatform;
import me.tofaa.entitylib.event.EventBus;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -18,7 +15,7 @@ public class SpigotEntityLibPlatform extends AbstractPlatform<JavaPlugin> {
} }
@Override @Override
public void setupApi(@NotNull APISettings settings) { public void setupApi(@NotNull APIConfig settings) {
super.setupApi(settings); super.setupApi(settings);
this.logger = settings.shouldUsePlatformLogger() ? handle.getLogger() : Logger.getLogger("EntityLib"); this.logger = settings.shouldUsePlatformLogger() ? handle.getLogger() : Logger.getLogger("EntityLib");
this.api = new SpigotEntityLibAPI(this, settings); this.api = new SpigotEntityLibAPI(this, settings);

View file

@ -1,8 +1,7 @@
package me.tofaa.testentitylib; package me.tofaa.testentitylib;
import com.github.retrooper.packetevents.PacketEvents; import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.PacketEventsAPI; import me.tofaa.entitylib.APIConfig;
import me.tofaa.entitylib.APISettings;
import me.tofaa.entitylib.EntityLib; import me.tofaa.entitylib.EntityLib;
import me.tofaa.entitylib.spigot.SpigotEntityLibPlatform; import me.tofaa.entitylib.spigot.SpigotEntityLibPlatform;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -14,7 +13,7 @@ public class TestEntityLibPlugin extends JavaPlugin {
public void onEnable() { public void onEnable() {
SpigotEntityLibPlatform platform = new SpigotEntityLibPlatform(this); SpigotEntityLibPlatform platform = new SpigotEntityLibPlatform(this);
APISettings settings = new APISettings(PacketEvents.getAPI()) APIConfig settings = new APIConfig(PacketEvents.getAPI())
.debugMode() .debugMode()
.tickTickables() .tickTickables()
.usePlatformLogger(); .usePlatformLogger();