mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-12 13:44:28 +01:00
Fix merge, remove unnecessary methods (for now)
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
683a6d35fa
commit
c1b278f4b9
@ -1,54 +1,14 @@
|
||||
package net.minestom.server;
|
||||
|
||||
import net.minestom.server.utils.time.UpdateOption;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents an element which is ticked at a regular interval.
|
||||
* <p>
|
||||
* Each tickable element can also be a container for multiple elements using {@link #getTickableElements()}.
|
||||
*/
|
||||
public interface Tickable {
|
||||
|
||||
/**
|
||||
* Ticks this element if {@link #getTickRate()} allows it.
|
||||
* <p>
|
||||
* Will execute this same method for every elements inside {@link #getTickableElements()}.
|
||||
* Ticks this element.
|
||||
*
|
||||
* @param time the time of the tick in milliseconds
|
||||
*/
|
||||
void tick(long time);
|
||||
|
||||
/**
|
||||
* Gets all the tickable elements linked to this.
|
||||
*
|
||||
* @return a modifiable {@link List} containing the linked tickable elements
|
||||
*/
|
||||
@NotNull
|
||||
List<Tickable> getTickableElements();
|
||||
|
||||
/**
|
||||
* Gets the current tick rate of this element
|
||||
*
|
||||
* @return the current tick rate
|
||||
*/
|
||||
@NotNull
|
||||
UpdateOption getTickRate();
|
||||
|
||||
/**
|
||||
* Changes the tick rate of this element.
|
||||
*
|
||||
* @param updateOption the new tick rate
|
||||
*/
|
||||
void setTickRate(@NotNull UpdateOption updateOption);
|
||||
|
||||
/**
|
||||
* Gets the last time this element has been ticked.
|
||||
*
|
||||
* @return the last tick time in milliseconds
|
||||
*/
|
||||
long getLastTickTime();
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ import java.util.function.UnaryOperator;
|
||||
* <p>
|
||||
* To create your own entity you probably want to extends {@link LivingEntity} or {@link EntityCreature} instead.
|
||||
*/
|
||||
public class Entity implements Viewable, Tickable, EventHandler, DataContainer, PermissionHandler, HoverEventSource<ShowEntity {
|
||||
public class Entity implements Viewable, Tickable, EventHandler, DataContainer, PermissionHandler, HoverEventSource<ShowEntity> {
|
||||
|
||||
private static final Map<Integer, Entity> ENTITY_BY_ID = new ConcurrentHashMap<>();
|
||||
private static final Map<UUID, Entity> ENTITY_BY_UUID = new ConcurrentHashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user