Merge branch 'general-devel' into feature/properly-seed-group-names-in-database

This commit is contained in:
Lucas Nicodemus 2025-03-10 00:56:13 +09:00 committed by GitHub
commit 18ffe08293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 59 additions and 7 deletions

View file

@ -3492,15 +3492,23 @@ namespace TShockAPI
if (OnNPCSpecial(args.Player, args.Data, id, type)) if (OnNPCSpecial(args.Player, args.Data, id, type))
return true; return true;
if (type == 1 && TShock.Config.Settings.DisableDungeonGuardian) if (type == 1)
{ {
TShock.Log.ConsoleDebug(GetString("GetDataHandlers / HandleSpecial rejected type 1 for {0}", args.Player.Name)); if (!args.Player.HasPermission(Permissions.summonboss))
args.Player.SendMessage(GetString("The Dungeon Guardian returned you to your spawn point."), Color.Purple); {
args.Player.Spawn(PlayerSpawnContext.RecallFromItem); args.Player.SendErrorMessage(GetString("You do not have permission to summon the Skeletron."));
TShock.Log.ConsoleDebug(GetString($"GetDataHandlers / HandleNpcStrike rejected Skeletron summon from {args.Player.Name}"));
return true; return true;
} }
if (type == 3) return false;
}
else if (type == 2)
{
// Plays SoundID.Item1
return false;
}
else if (type == 3)
{ {
if (!args.Player.HasPermission(Permissions.usesundial)) if (!args.Player.HasPermission(Permissions.usesundial))
{ {
@ -3520,6 +3528,42 @@ namespace TShockAPI
return true; return true;
} }
} }
else if (type == 4)
{
// Big Mimic Spawn Smoke
return false;
}
else if (type == 5)
{
// Register Kill for Torch God in Bestiary
return false;
}
else if (type == 6)
{
if (!args.Player.HasPermission(Permissions.usemoondial))
{
TShock.Log.ConsoleDebug(GetString($"GetDataHandlers / HandleSpecial rejected enchanted moondial permission {args.Player.Name}"));
args.Player.SendErrorMessage(GetString("You do not have permission to use the Enchanted Moondial."));
return true;
}
else if (TShock.Config.Settings.ForceTime != "normal")
{
TShock.Log.ConsoleDebug(GetString($"GetDataHandlers / HandleSpecial rejected enchanted moondial permission (ForceTime) {args.Player.Name}"));
if (!args.Player.HasPermission(Permissions.cfgreload))
{
args.Player.SendErrorMessage(GetString("You cannot use the Enchanted Moondial because time is stopped."));
}
else
args.Player.SendErrorMessage(GetString("You must set ForceTime to normal via config to use the Enchanted Moondial."));
return true;
}
}
else if (!args.Player.HasPermission($"tshock.specialeffects.{type}"))
{
args.Player.SendErrorMessage(GetString("You do not have permission to use this effect."));
TShock.Log.ConsoleError(GetString("Unrecognized special effect (Packet 51). Please report this to the TShock developers."));
return true;
}
return false; return false;
} }

View file

@ -331,6 +331,9 @@ namespace TShockAPI
[Description("Player can use the Enchanted Sundial item.")] [Description("Player can use the Enchanted Sundial item.")]
public static readonly string usesundial = "tshock.world.time.usesundial"; public static readonly string usesundial = "tshock.world.time.usesundial";
[Description("Player can use the Enchanted Moondial item.")]
public static readonly string usemoondial = "tshock.world.time.usemoondial";
[Description("User can grow plants.")] [Description("User can grow plants.")]
public static readonly string grow = "tshock.world.grow"; public static readonly string grow = "tshock.world.grow";

View file

@ -117,6 +117,11 @@ Use past tense when adding new entries; sign your name off when you add or chang
* Added a property `TSPlayer.Hostile`, which gets pvp player mode. (@AgaSpace) * Added a property `TSPlayer.Hostile`, which gets pvp player mode. (@AgaSpace)
* Fixed bug where when the `UseSqlLogs` config property is true, an empty log file would still get created. (@ZakFahey) * Fixed bug where when the `UseSqlLogs` config property is true, an empty log file would still get created. (@ZakFahey)
* Fixed typo in `/gbuff`. (@sgkoishi, #2955) * Fixed typo in `/gbuff`. (@sgkoishi, #2955)
Rewrote the Added a new permission, `tshock.world.time.usemoondial`, for regulating use of Enchanted Moondial. (@Arthri)
* Added a set of new permissions, `tshock.specialeffects.{type}`, for regulating use of new special effects(Packet 51) which are not yet recognized by TShock. (@Arthri)
* Added check for `tshock.npc.summonboss` permission for Skeletron summoning. (@Arthri)
* Fixed `DisableDungeonGuardian` disabling Skeletron summon instead. The config option is useless as of writing. (@Arthri)
* Added a constructor for `TShockAPI.PlayerData` that accepts the `includingStarterInventory` parameter, which is responsible for loading the TShock inventory. * Added a constructor for `TShockAPI.PlayerData` that accepts the `includingStarterInventory` parameter, which is responsible for loading the TShock inventory.
* Declared the constructor `TShockAPI.PlayerData` accepting the argument `TShockAPI.TSPlayer` obsolete. * Declared the constructor `TShockAPI.PlayerData` accepting the argument `TShockAPI.TSPlayer` obsolete.
* Updated the `PlayerData.StoreSlot` method: Added an overload that takes `TShockAPI.NetItem`. * Updated the `PlayerData.StoreSlot` method: Added an overload that takes `TShockAPI.NetItem`.