public void SetBlockCoordsTest() { givenMinecraftLocation.SetAsBlockCoords(givenVector); Assert.AreEqual(3200, givenMinecraftLocation.Location.X); Assert.AreEqual(3200, givenMinecraftLocation.Location.Y); Assert.AreEqual(3251, givenMinecraftLocation.Location.Z); }
public void SetSpawn(Vector3S location, byte look, byte rot) { var spawnLoc = new MinecraftLocation(location, rot, look); spawnLoc.SetAsBlockCoords(location); MapProvider.SetSpawn(spawnLoc); }
private void Test_CreateEntity() { Entity[] copy = Entity.AllEntities.ToArray(); foreach (Entity e in copy) { if (e.Name == "Num1" || e.Name == "Num2") { e.Despawn(); } } var location1 = new MinecraftLocation(); location1.SetAsBlockCoords(new Vector3S(40, 40, 20)); var entity1 = new Entity { Name = "Num1", PrettyName = "&cNum1", CurrentMap = HcMap.DefaultMap, ClientId = (sbyte)HcMap.DefaultMap.GetEntityId(), Location = location1, }; var entity2 = new Entity { Name = "Num2", PrettyName = "&cNum2", CurrentMap = HcMap.DefaultMap, ClientId = (sbyte)HcMap.DefaultMap.GetEntityId(), Location = HcMap.DefaultMap.GetSpawn(), }; entity1.Spawn(); entity2.Spawn(); entity1.HandleMove(); entity2.HandleMove(); }