chore: minor entity class warning cleanup (#2049)

This commit is contained in:
DeidaraMC 2024-03-25 23:33:24 -04:00 committed by GitHub
parent 115f9c1355
commit ceeab08a2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -75,7 +75,7 @@ import java.util.function.UnaryOperator;
/**
* Could be a player, a monster, or an object.
* <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,
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 Chunk chunk = getChunk();
assert chunk != null;
if (distanceX > 8 || distanceY > 8 || distanceZ > 8) {
PacketUtils.prepareViewablePacket(chunk, new EntityTeleportPacket(getEntityId(), position, isOnGround()), this);
nextSynchronizationTick = synchronizationTicks + 1;

View File

@ -33,12 +33,12 @@ public class EntityTrackerIntegrationTest {
final AtomicInteger viewersCount = new AtomicInteger();
final Entity entity = new Entity(EntityType.ZOMBIE) {
@Override
public void updateNewViewer(Player player) {
public void updateNewViewer(@NotNull Player player) {
viewersCount.incrementAndGet();
}
@Override
public void updateOldViewer(Player player) {
public void updateOldViewer(@NotNull Player player) {
viewersCount.decrementAndGet();
}
};
@ -65,12 +65,12 @@ public class EntityTrackerIntegrationTest {
final AtomicInteger viewersCount = new AtomicInteger();
final Entity entity = new Entity(EntityType.ZOMBIE) {
@Override
public void updateNewViewer(Player player) {
public void updateNewViewer(@NotNull Player player) {
viewersCount.incrementAndGet();
}
@Override
public void updateOldViewer(Player player) {
public void updateOldViewer(@NotNull Player player) {
viewersCount.decrementAndGet();
}
};