diff --git a/src/main/java/cactusServer/models/CollisionManager.java b/src/main/java/cactusServer/models/CollisionManager.java index 8634441..c56b316 100644 --- a/src/main/java/cactusServer/models/CollisionManager.java +++ b/src/main/java/cactusServer/models/CollisionManager.java @@ -39,14 +39,18 @@ for (String instanceId : instances.keySet()) { Instance instance = Instances.getInstance().getInstance(instanceId); instance.getUniverse().update(interval); - for (Object object : instance.getObjects().values()) { - for (Player player : Instances.getInstance().getPlayers(instanceId).values()) { - collisionMove(object, player); - } - for (Object object2 : instance.getObjects().values()) { - if (!object.equals(object2)) { - collisionMove(object, object2); - } + collisionPlayersObjects(instanceId, instance); + } + } + + public void collisionPlayersObjects(String instanceId, Instance instance) { + for (Object object : instance.getObjects().values()) { + for (Player player : Instances.getInstance().getPlayers(instanceId).values()) { + collisionMove(object, player); + } + for (Object object2 : instance.getObjects().values()) { + if (!object.equals(object2)) { + collisionMove(object, object2); } } }