Exemplo n.º 1
0
 public BlockChangeEventArgs(int x, byte y, int z, byte type, byte metadata)
     : base()
 {
     Position = new Point3D(x, y, z);
     Block = (MCBlockType)type;
     MetaData = metadata;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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));
 }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
 public MCEntity(int id, Point3D pos)
 {
     ID = id;
     Position = pos;
 }
Exemplo n.º 11
0
 public MapChunkEventArgs(int x, short y, int z, MCBlock[,,] data)
     : base()
 {
     Position = new Point3D(x, y, z);
     ChunkData = data;
 }
Exemplo n.º 12
0
 public PreChunkEventArgs(int x, int z, bool mode)
     : base()
 {
     Reference = new Point3D(x * 16, 0, z * 16);
     Load = mode;
 }
Exemplo n.º 13
0
 public MCVehicle(int id, Point3D position, MCVehicleType type)
 {
     ID = id;
     Position = position;
     Type = type;
 }
Exemplo n.º 14
0
 public MCVehicle(int id, Point3D position)
     : this(id, position, MCVehicleType.Boat)
 {
 }
Exemplo n.º 15
0
        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));
        }
Exemplo n.º 16
0
 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));
 }
Exemplo n.º 17
0
 public SpawnPositionEventArgs(int x, int y, int z)
     : base()
 {
     Position = new Point3D(x, y, z);
 }