From a7ca1a37bfb77877bdb1a8691c6d8e4121c173c6 Mon Sep 17 00:00:00 2001 From: iam Date: Sun, 13 Mar 2022 14:48:51 -0400 Subject: [PATCH] Complete test coverage (#761) --- .../EntityBlockPhysicsIntegrationTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/net/minestom/server/collision/EntityBlockPhysicsIntegrationTest.java b/src/test/java/net/minestom/server/collision/EntityBlockPhysicsIntegrationTest.java index d840e4cb4..fef2887bb 100644 --- a/src/test/java/net/minestom/server/collision/EntityBlockPhysicsIntegrationTest.java +++ b/src/test/java/net/minestom/server/collision/EntityBlockPhysicsIntegrationTest.java @@ -621,6 +621,23 @@ public class EntityBlockPhysicsIntegrationTest { assertEqualsPoint(new Pos(1.07, 43, 1.08), res.newPosition()); } + @Test + public void entityPhysicsSmallMoveC2E(Env env) { + var instance = env.createFlatInstance(); + instance.setBlock(1, 43, 1, Block.STONE); + + BoundingBox bb = new BoundingBox(0, 0, 0); + + var entity = new Entity(EntityType.ZOMBIE); + entity.setBoundingBox(bb); + + entity.setInstance(instance, new Pos(0.51, 42.50, 0.51)).join(); + assertEquals(instance, entity.getInstance()); + + PhysicsResult res = CollisionUtils.handlePhysics(entity, new Vec(0.57, 0.57, 0.57)); + assertEqualsPoint(new Pos(1.08, 43, 1.08), res.newPosition()); + } + @Test public void entityPhysicsCheckNoCollision(Env env) { var instance = env.createFlatInstance();