Fix merge, remove unnecessary methods (for now)

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-04-14 20:09:49 +02:00
parent 683a6d35fa
commit c1b278f4b9
2 changed files with 2 additions and 42 deletions

View File

@ -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();
}

View File

@ -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<>();