-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathEntityLibAPI.java
More file actions
56 lines (41 loc) · 1.57 KB
/
Copy pathEntityLibAPI.java
File metadata and controls
56 lines (41 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package me.tofaa.entitylib;
import com.github.retrooper.packetevents.PacketEventsAPI;
import me.tofaa.entitylib.container.EntityContainer;
import me.tofaa.entitylib.tick.TickContainer;
import me.tofaa.entitylib.wrapper.WrapperEntity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.UUID;
/**
* Represents the API for EntityLib.
* Handles the loading, enabling, and disabling of the API. And handles platform specific creation of EntityLib content.
* @param <T> The {@link TickContainer}'s param type for the platform specific TickContainer.
*/
public interface EntityLibAPI<T> {
/**
* @return The {@link PacketEventsAPI} that EntityLib uses.
*/
PacketEventsAPI<?> getPacketEvents();
void onLoad();
void onEnable();
@NotNull <P extends WrapperEntity> P cloneEntity(@NotNull Object platformEntity);
@Nullable WrapperEntity getEntity(int id);
@Nullable WrapperEntity getEntity(@NotNull UUID uuid);
@NotNull Collection<WrapperEntity> getAllEntities();
/**
* @return The {@link APIConfig} for the API.
*/
@NotNull APIConfig getSettings();
/**
* @return An unmodifiable collection of TickContainers.
*/
@NotNull Collection<TickContainer<?, T>> getTickContainers();
/**
* Adds a TickContainer to the API. Automatically starts ticking it.
* @param tickContainer the TickContainer to add.
*/
void addTickContainer(@NotNull TickContainer<?, T> tickContainer);
@NotNull
EntityContainer getDefaultContainer();
}