Skip to content

NwPluginAPI 12.0.0

Compare
Choose a tag to compare
@zabszk zabszk released this 15 Jan 21:23
· 13 commits to master since this release
8922563
  • buildinfo command now provides NwPluginAPI version.
  • Fixed overwatch (#140).
  • Fixed ClearInventory (#141).
  • Fixed incorrect issuer type in PlayerKicked event (#132).
  • Fixed Facility.Rooms (#136).
  • Added DropItem and RemoveItem, modified AddItem (#138).
  • Added Scp096AddingTarget event (#135).
  • Added Scp096Enraging event (#135).
  • Added Scp096ChangeState event (#135).
  • Added Scp096PryingGate event (#135).
  • Added Scp096TryNotCry event (#135).
  • Added Scp096StartCrying event (#135).
  • Added PlayerUsingRadio event (#147).
  • Added CassieAnnouncesScpTermination event (#137, #147).
  • Added PlayerGetGroup event (#147).
  • Added PlayerUsingIntercom event (#147, #149).
  • Renamed event PlayerDeathto PlayerDying (#108, #147).
  • Added PlayerDeath event (#108, #147).
  • Fixed cancellation of some events (#143).
  • Fixed a bug that caused SendBroadcast to occasionally throw NRE errors (#145, #151).
  • Fixed a bug where FacilityRooms.Light was always null (#145, #152).
  • Fixed Server.Instance.ReferenceHub being null after a round restart (#153, #158).
  • Added Player.Team (#159).
  • Improved ConfigSharing - replaced a bunch of private const ints with a public enum (#155).

Changes made to Server.cs by #145.

  • Added int PlayerCount => Player.Count;
  • Added PermissionsHandler PermissionsHandler => ServerStatic.GetPermissionsHandler();
  • Added double TPS => Math.Round(1f / Time.smoothDeltaTime);
  • Added get or set float SpawnProtectDuration
  • Added get or set bool IsHeavilyModded
  • Added Broadcast Broadcast => Broadcast.Singleton

Changes made to Player.cs by #145.

  • Added PlayerRoleBase RoleBase => ReferenceHub.roleManager.CurrentRole;
  • Added Dictionary<ItemType, ushort> AmmoBag => ReferenceHub.inventory.UserInventory.ReserveAmmo;
  • Added get or set string RoleColor (serverRoles)
  • Added get or set string RoleName
  • Added string UnitName => ReferenceHub.roleManager.CurrentRole is HumanRole humanRole ? humanRole.UnitName : null;
  • Added bool HasReservedSlot => ReservedSlot.HasReservedSlot(UserId, out _);
  • Added Vector3 Velocity => ReferenceHub.GetVelocity();
  • Added VoiceModuleBase VoiceModule => ReferenceHub.roleManager.CurrentRole is IVoiceRole voiceRole ? voiceRole.VoiceModule : null;
  • Added VoiceChatChannel VoiceChannel => VoiceModule?.CurrentChannel ?? VoiceChatChannel.None;
  • Changed bool IsScp => Role.GetTeam() is Team.SCPs;
  • Added bool IsNTF => Role.GetTeam() is Team.FoundationForces;
  • Added bool IsCHI => Role.GetTeam() is Team.ChaosInsurgency;
  • Added bool IsTutorial => Role is RoleTypeId.Tutorial;
  • Added SetGroup(UserGroup group) ReferenceHub.serverRoles.SetGroup(group, false);

Thanks to @SrLicht, @Takail, @MrAfitol, @SebasCapo, @Xname7, @moddedmcplayer.