From 11463930f38e0da2b59a0762375023fb6d57a20c Mon Sep 17 00:00:00 2001
From: stacey <57187883+moisterrific@users.noreply.github.com>
Date: Sat, 24 Jul 2021 19:53:13 -0400
Subject: [PATCH 1/4] Add DisablePrimeBombs to OnProjectileSetDefaults
---
TShockAPI/TShock.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 2114b469..92c8c8af 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1627,6 +1627,9 @@ namespace TShockAPI
if (e.Info == 109)
if (Config.Settings.DisableSnowBalls)
e.Object.SetDefaults(0);
+ if (e.Info == ProjectileID.BombSkeletronPrime)
+ if (Config.Settings.DisablePrimeBombs)
+ e.Object.SetDefaults(0);
}
/// NetHooks_SendData - Fired when the server sends data.
From 347a23a8bc65e6e5b53257f8610a9ce884b715d1 Mon Sep 17 00:00:00 2001
From: stacey <57187883+moisterrific@users.noreply.github.com>
Date: Sat, 24 Jul 2021 19:55:38 -0400
Subject: [PATCH 2/4] Add DisablePrimeBombs to World Settings
---
TShockAPI/Configuration/TShockConfig.cs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/TShockAPI/Configuration/TShockConfig.cs b/TShockAPI/Configuration/TShockConfig.cs
index 801a4c5f..7fe74884 100644
--- a/TShockAPI/Configuration/TShockConfig.cs
+++ b/TShockAPI/Configuration/TShockConfig.cs
@@ -156,6 +156,12 @@ namespace TShockAPI.Configuration
/// Disables tombstone dropping during death for all players.
[Description("Disables tombstone dropping during death for all players.")]
public bool DisableTombstones = true;
+
+ ///
+ /// Disables Skeletron Prime Bombs from spawning, useful for preventing unwanted world destruction on for the worthy seed world.
+ ///
+ [Description("Disables Skeletron Prime Bombs from spawning, useful for preventing unwanted world destruction on for the worthy seed world.")]
+ public bool DisablePrimeBombs;
/// Forces the world time to be normal, day, or night.
[Description("Forces the world time to be normal, day, or night.")]
From adeb7225e6df358153b285f67752b95362d05a96 Mon Sep 17 00:00:00 2001
From: stacey <57187883+moisterrific@users.noreply.github.com>
Date: Sat, 24 Jul 2021 20:01:21 -0400
Subject: [PATCH 3/4] Add DisablePrimeBombs to Upcoming changes
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4cba20d9..05f94143 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
## Upcoming changes
* Fixed SendTileRectHandler not sending tile rect updates like Pylons/Mannequins to other clients. (@Stealownz)
+* Added a new `DisablePrimeBombs` config option (`false` by default). Highly recommended to set this to `true` in order to prevent griefing on servers doing a `for the worthy` play-through, since the prime bombs on this seed can destroy most tiles and bypass region protection. (@moisterrific)
## TShock 4.5.5
* Changed the world autosave message so that it no longer warns of a "potential lag spike." (@hakusaro)
From b5c1640058988d2da036da291c248b5365e1c351 Mon Sep 17 00:00:00 2001
From: stacey <57187883+moisterrific@users.noreply.github.com>
Date: Sat, 24 Jul 2021 20:08:51 -0400
Subject: [PATCH 4/4] Refactor: use more human-readable ProjectileID
---
TShockAPI/TShock.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 92c8c8af..78c13a8d 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1618,13 +1618,13 @@ namespace TShockAPI
private void OnProjectileSetDefaults(SetDefaultsEventArgs e)
{
//tombstone fix.
- if (e.Info == 43 || (e.Info >= 201 && e.Info <= 205) || (e.Info >= 527 && e.Info <= 531))
+ if (e.Info == ProjectileID.Tombstone || (e.Info >= ProjectileID.GraveMarker && e.Info <= ProjectileID.Obelisk) || (e.Info >= ProjectileID.RichGravestone1 && e.Info <= ProjectileID.RichGravestone5))
if (Config.Settings.DisableTombstones)
e.Object.SetDefaults(0);
- if (e.Info == 75)
+ if (e.Info == ProjectileID.HappyBomb)
if (Config.Settings.DisableClownBombs)
e.Object.SetDefaults(0);
- if (e.Info == 109)
+ if (e.Info == ProjectileID.SnowBallHostile)
if (Config.Settings.DisableSnowBalls)
e.Object.SetDefaults(0);
if (e.Info == ProjectileID.BombSkeletronPrime)