public BlockChangeEventArgs(int x, byte y, int z, byte type, byte metadata) : base() { Position = new Point3D(x, y, z); Block = (MCBlockType)type; MetaData = metadata; }
public EntityTeleportEventArgs(int id, int x, int y, int z, byte yaw, byte pitch) : base() { ID = id; Position = new Point3D(x, y, z); Yaw = yaw; Pitch = pitch; }
public PlayerMoveLookEventArgs(double x, double y, double stance, double z, float yaw, float pitch, bool ground) : base() { Position = new Point3D(x, y, z); Stance = stance; Yaw = yaw; Pitch = pitch; Ground = ground; }
public MobSpawnEventArgs(int id, byte type, int x, int y, int z, byte yaw, byte pitch) : base() { ID = id; Type = type; Position = new Point3D(x, y, z); Yaw = yaw; Pitch = pitch; }
public NamedEntitySpawnEventArgs(int id, string name, int x, int y, int z, byte yaw, byte pitch, short item) : base() { ID = id; Name = name; Position = new Point3D(x / 32f, y / 32f, z / 32f); Yaw = yaw; Pitch = pitch; Item = (MCBlockType)item; }
public ItemSpawnEventArgs(int id, short item, byte count, int x, int y, int z, byte yaw, byte pitch, byte roll) : base() { ID = id; Item = item; Count = count; Position = new Point3D(x / 32f, y / 32f, z / 32f); Yaw = yaw; Pitch = pitch; Roll = roll; }
public MCClient(string server, int port, string username, string password, string serverpassword, bool useauth) { m_Client = new MCRawClient(server, port); m_Username = username; m_Password = password; m_ServerPassword = serverpassword; m_UseAuth = useauth; if (m_UseAuth) { m_AccountInfo = MCLogin.GetInfo(m_Username, m_Password); if (m_AccountInfo == null) throw new Exception("Invalid credentials or bot is outdated."); } m_SelectedItem = MCBlockType.Air; m_Position = new Point3D(); m_ItemInv = null; m_CraftInv = null; m_EquipInv = null; m_Players = new List<MCPlayer>(); Time = 0; SpawnPoint = new Point3D(); m_Yaw = 0f; m_Pitch = 0f; m_Client.OnDisconnect += new DisconnectEventHandler(m_Client_OnDisconnect); m_Client.OnHandshake += new HandshakeEventHandler(m_Client_OnHandshake); m_Client.OnLogin += new LoginEventHandler(m_Client_OnLogin); m_Client.OnUpdateTime += new UpdateTimeEventHandler(m_Client_OnUpdateTime); m_Client.OnPlayerMoveLook += new PlayerMoveLookEventHandler(m_Client_OnPlayerMoveLook); m_Client.OnAddInventory += new AddInventoryEventHandler(m_Client_OnAddInventory); m_Client.OnPlayerInventory += new PlayerInventoryEventHandler(m_Client_OnPlayerInventory); m_Client.OnSpawnPosition += new SpawnPositionEventHandler(m_Client_OnSpawnPosition); m_Client.OnNamedEntitySpawn += new NamedEntitySpawnEventHandler(m_Client_OnNamedEntitySpawn); m_Client.OnChat += new ChatEventHandler(m_Client_OnChat); m_Client.OnAddVehicle += new AddVehicleEventHandler(m_Client_OnAddVehicle); }
public void Dig(MCDigState status, Point3D position, MCBlockFace face) { SendPacket(MCPackets.CreatePlayerDiggingPacket((byte)status, (int)position.X, (byte)position.Y, (int)position.Z, (byte)face)); }
void m_Client_OnPlayerMoveLook(object sender, PlayerMoveLookEventArgs e) { m_Position = e.Position; m_Yaw = e.Yaw; m_Pitch = e.Pitch; // Server wants us to echo this position, so we do just that m_Client.MoveLook(e.Position, e.Stance, e.Yaw, e.Pitch, e.Ground); if (PlayerPositionUpdate != null) PlayerPositionUpdate(this, e); }
public MCEntity(int id, Point3D pos) { ID = id; Position = pos; }
public MapChunkEventArgs(int x, short y, int z, MCBlock[,,] data) : base() { Position = new Point3D(x, y, z); ChunkData = data; }
public PreChunkEventArgs(int x, int z, bool mode) : base() { Reference = new Point3D(x * 16, 0, z * 16); Load = mode; }
public MCVehicle(int id, Point3D position, MCVehicleType type) { ID = id; Position = position; Type = type; }
public MCVehicle(int id, Point3D position) : this(id, position, MCVehicleType.Boat) { }
public void MoveLook(Point3D newposition, double stance, float yaw, float pitch, bool ground) { if (stance - newposition.Y < 0.1 || stance - newposition.Y > 1.65) // Illegal stance throw new Exception("Attempted to send an illegal stance"); SendPacket(MCPackets.CreatePlayerMoveLookPacket(newposition.X, newposition.Y, stance, newposition.Z, yaw, pitch, ground)); }
public void PlaceBlock(MCBlockType block, Point3D position, MCBlockFace direction) { SendPacket(MCPackets.CreatePlayerBlockPlacePacket((short)block, (int)position.X, (byte)position.Y, (int)position.Z, (byte)direction)); }
public SpawnPositionEventArgs(int x, int y, int z) : base() { Position = new Point3D(x, y, z); }