mirror of https://github.com/Minestom/Minestom.git
chore: minor entity class warning cleanup (#2049)
This commit is contained in:
parent
115f9c1355
commit
ceeab08a2a
|
@ -75,7 +75,7 @@ import java.util.function.UnaryOperator;
|
||||||
/**
|
/**
|
||||||
* Could be a player, a monster, or an object.
|
* Could be a player, a monster, or an object.
|
||||||
* <p>
|
* <p>
|
||||||
* To create your own entity you probably want to extends {@link LivingEntity} or {@link EntityCreature} instead.
|
* To create your own entity you probably want to extend {@link LivingEntity} or {@link EntityCreature} instead.
|
||||||
*/
|
*/
|
||||||
public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, EventHandler<EntityEvent>, Taggable,
|
public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, EventHandler<EntityEvent>, Taggable,
|
||||||
PermissionHandler, HoverEventSource<ShowEntity>, Sound.Emitter, Shape {
|
PermissionHandler, HoverEventSource<ShowEntity>, Sound.Emitter, Shape {
|
||||||
|
@ -1377,6 +1377,7 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||||
final boolean positionChange = (distanceX + distanceY + distanceZ) > 0;
|
final boolean positionChange = (distanceX + distanceY + distanceZ) > 0;
|
||||||
|
|
||||||
final Chunk chunk = getChunk();
|
final Chunk chunk = getChunk();
|
||||||
|
assert chunk != null;
|
||||||
if (distanceX > 8 || distanceY > 8 || distanceZ > 8) {
|
if (distanceX > 8 || distanceY > 8 || distanceZ > 8) {
|
||||||
PacketUtils.prepareViewablePacket(chunk, new EntityTeleportPacket(getEntityId(), position, isOnGround()), this);
|
PacketUtils.prepareViewablePacket(chunk, new EntityTeleportPacket(getEntityId(), position, isOnGround()), this);
|
||||||
nextSynchronizationTick = synchronizationTicks + 1;
|
nextSynchronizationTick = synchronizationTicks + 1;
|
||||||
|
|
|
@ -33,12 +33,12 @@ public class EntityTrackerIntegrationTest {
|
||||||
final AtomicInteger viewersCount = new AtomicInteger();
|
final AtomicInteger viewersCount = new AtomicInteger();
|
||||||
final Entity entity = new Entity(EntityType.ZOMBIE) {
|
final Entity entity = new Entity(EntityType.ZOMBIE) {
|
||||||
@Override
|
@Override
|
||||||
public void updateNewViewer(Player player) {
|
public void updateNewViewer(@NotNull Player player) {
|
||||||
viewersCount.incrementAndGet();
|
viewersCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateOldViewer(Player player) {
|
public void updateOldViewer(@NotNull Player player) {
|
||||||
viewersCount.decrementAndGet();
|
viewersCount.decrementAndGet();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -65,12 +65,12 @@ public class EntityTrackerIntegrationTest {
|
||||||
final AtomicInteger viewersCount = new AtomicInteger();
|
final AtomicInteger viewersCount = new AtomicInteger();
|
||||||
final Entity entity = new Entity(EntityType.ZOMBIE) {
|
final Entity entity = new Entity(EntityType.ZOMBIE) {
|
||||||
@Override
|
@Override
|
||||||
public void updateNewViewer(Player player) {
|
public void updateNewViewer(@NotNull Player player) {
|
||||||
viewersCount.incrementAndGet();
|
viewersCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateOldViewer(Player player) {
|
public void updateOldViewer(@NotNull Player player) {
|
||||||
viewersCount.decrementAndGet();
|
viewersCount.decrementAndGet();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue