Exemple #1
0
 public Player()
 {
     _chunksUsed = new Dictionary<Tuple<int, int>, ChunkColumn>();
     HealthManager = new PCHealthManager(this);
     if (PlayerEntity == null) PlayerEntity = new MiNET.Player(null, null, PluginGlobals.Level[0], null, -1);
     PlayerInventory = new PlayerInventory(this);
 }
Exemple #2
0
        public Player(MiNetServer server, IPEndPoint endPoint, Level level, int mtuSize)
            : base(-1, level)
        {
            Rtt = 300;
            Width = 0.6;
            Length = 0.6;
            Height = 1.80;

            Popups = new List<Popup>();

            Server = server;
            EndPoint = endPoint;
            _mtuSize = mtuSize;
            Level = level;

            Permissions = new PermissionManager(UserGroup.User);
            Permissions.AddPermission("*"); //All users can use all commands. (For debugging purposes)

            Inventory = new PlayerInventory(this);

            _chunksUsed = new Dictionary<Tuple<int, int>, McpeBatch>();

            IsSpawned = false;
            IsConnected = true;

            SpawnPosition = Level.SpawnPoint;
            KnownPosition = new PlayerLocation
            {
                X = SpawnPosition.X,
                Y = SpawnPosition.Y,
                Z = SpawnPosition.Z,
                Yaw = 91,
                Pitch = 28,
                HeadYaw = 91
            };

            GameMode = level.GameMode;

            _sendTicker = new Timer(SendQueue, null, 10, 10); // RakNet send tick-time
        }
Exemple #3
0
		public Player(MiNetServer server, IPEndPoint endPoint, int mtuSize) : base(-1, null)
		{
			Rtt = 300;
			Width = 0.6;
			Length = 0.6;
			Height = 1.80;

			Popups = new List<Popup>();
			Effects = new ConcurrentDictionary<EffectType, Effect>();

			Server = server;
			EndPoint = endPoint;
			_mtuSize = mtuSize;

			Inventory = new PlayerInventory(this);

			_chunksUsed = new Dictionary<Tuple<int, int>, McpeBatch>();

			IsSpawned = false;
			IsConnected = endPoint != null; // Can't connect if there is no endpoint

			if (IsConnected) _sendTicker = new Timer(SendQueue, null, 10, 10); // RakNet send tick-time
		}
Exemple #4
0
 private void EnchantArmor(PlayerInventory inventory, short enchId, short level)
 {
     inventory.Helmet.ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", enchId), new NbtShort("lvl", level)}}};
     inventory.Chest.ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", enchId), new NbtShort("lvl", level)}}};
     inventory.Leggings.ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", enchId), new NbtShort("lvl", level)}}};
     inventory.Boots.ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", enchId), new NbtShort("lvl", level)}}};
 }