mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 05:58:00 +01:00
Unchecked cast for acquirable getter
This commit is contained in:
parent
8ba99bb931
commit
c3f1b9159c
@ -125,7 +125,7 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
|
||||
private long ticks;
|
||||
private final EntityTickEvent tickEvent = new EntityTickEvent(this);
|
||||
|
||||
private final Acquirable<? extends Entity> acquirable = Acquirable.of(this);
|
||||
private final Acquirable<Entity> acquirable = Acquirable.of(this);
|
||||
|
||||
/**
|
||||
* Lock used to support #switchEntityType
|
||||
@ -1573,8 +1573,12 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
|
||||
return Objects.requireNonNullElse(this.customSynchronizationCooldown, SYNCHRONIZATION_COOLDOWN);
|
||||
}
|
||||
|
||||
public @NotNull Acquirable<? extends Entity> getAcquirable() {
|
||||
return acquirable;
|
||||
public <T extends Entity> @NotNull Acquirable<T> getAcquirable() {
|
||||
return (Acquirable<T>) acquirable;
|
||||
}
|
||||
|
||||
public <T extends Entity> @NotNull Acquirable<T> getAcquirable(@NotNull Class<T> clazz) {
|
||||
return (Acquirable<T>) acquirable;
|
||||
}
|
||||
|
||||
public enum Pose {
|
||||
|
@ -15,7 +15,6 @@ import net.kyori.adventure.text.event.HoverEventSource;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.acquirable.Acquirable;
|
||||
import net.minestom.server.advancements.AdvancementTab;
|
||||
import net.minestom.server.adventure.AdventurePacketConvertor;
|
||||
import net.minestom.server.adventure.Localizable;
|
||||
@ -2448,11 +2447,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
return lastKeepAlive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Acquirable<? extends Player> getAcquirable() {
|
||||
return (Acquirable<? extends Player>) super.getAcquirable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HoverEvent<ShowEntity> asHoverEvent(@NotNull UnaryOperator<ShowEntity> op) {
|
||||
return HoverEvent.showEntity(ShowEntity.of(EntityType.PLAYER, this.uuid, this.displayName));
|
||||
|
Loading…
Reference in New Issue
Block a user