From 4189b4ab1f462f8dcaaecd0b6a0068c28d282162 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Mon, 10 Oct 2022 18:55:39 -0400 Subject: [PATCH 1/4] Add `LiquidType.Shimmer` --- TShockAPI/GetDataHandlers.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index bf594724..5e1369e0 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1296,6 +1296,7 @@ namespace TShockAPI Water = 0, Lava = 1, Honey = 2, + Shimmer = 3, Removal = 255 //@Olink: lets hope they never invent 255 fluids or decide to also use this :( } From bf53c3313c3e0f7d6083e2e4ae385e469e25c79d Mon Sep 17 00:00:00 2001 From: James Puleo Date: Mon, 10 Oct 2022 18:59:54 -0400 Subject: [PATCH 2/4] Make Bouncer allow Bottomless Honey Buckets --- TShockAPI/Bouncer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 8b46d17d..8a77de2d 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1544,6 +1544,10 @@ namespace TShockAPI { bucket = 6; } + else if (selectedItemType == ItemID.BottomlessHoneyBucket) + { + bucket = 7; + } if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6)) { @@ -1585,7 +1589,7 @@ namespace TShockAPI return; } - if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0)) + if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0 || bucket == 7)) { TShock.Log.ConsoleDebug("Bouncer / OnLiquidSet rejected bucket check 4 from {0}", args.Player.Name); args.Player.SendErrorMessage("You do not have permission to perform this action."); From 1df123d2bec3a5031f7021c3ad05c54d00e844a6 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Mon, 10 Oct 2022 19:00:43 -0400 Subject: [PATCH 3/4] Make Bouncer reject Shimmer placement without bucket or whilst banned --- TShockAPI/Bouncer.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 8a77de2d..a4c01f02 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1548,6 +1548,10 @@ namespace TShockAPI { bucket = 7; } + else if (selectedItemType == ItemID.BottomlessShimmerBucket) + { + bucket = 8; + } if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6)) { @@ -1608,6 +1612,27 @@ namespace TShockAPI args.Handled = true; return; } + + if (!wasThereABombNearby && type == LiquidType.Shimmer && bucket != 8) + { + TShock.Log.ConsoleDebug("Bouncer / OnLiquidSet rejected bucket check 6 from {0}", args.Player.Name); + args.Player.SendErrorMessage("You do not have permission to perform this action."); + args.Player.Disable("Spreading shimmer without holding a honey bucket", DisableFlags.WriteToLogAndConsole); + args.Player.SendTileSquareCentered(tileX, tileY, 1); + args.Handled = true; + return; + } + + if (!wasThereABombNearby && type == LiquidType.Shimmer && + TShock.ItemBans.DataModel.ItemIsBanned("Bottomless Shimmer Bucket", args.Player)) + { + TShock.Log.ConsoleDebug("Bouncer / OnLiquidSet rejected bucket check 7 from {0}", args.Player.Name); + args.Player.SendErrorMessage("You do not have permission to perform this action."); + args.Player.Disable("Using banned bottomless shimmer bucket without permissions", DisableFlags.WriteToLogAndConsole); + args.Player.SendTileSquareCentered(tileX, tileY, 1); + args.Handled = true; + return; + } } if (!args.Player.HasBuildPermission(tileX, tileY)) From 837c4deeaae9e251bd8465e6386b0f528aab64a7 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Mon, 10 Oct 2022 19:02:31 -0400 Subject: [PATCH 4/4] Update `CHANGELOG.md` --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c49d81f..2a7c8104 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Updated to OTAPI 3.1.10-alpha, which allows FreeBSD .NET 6 to use Re-Logic's Linux platform. (@SignatureBeef) * Update Github CI to not tarball files for Windows only (@PotatoCider) * Allow Blood Butcherer and Shimmer buffs to be applied to NPCs by players (@drunderscore) +* Add `LiquidType.Shimmer` (@drunderscore) +* Make Bouncer allow Bottomless Honey Bucket usage (@drunderscore) +* Make Bouncer reject Shimmer placement without bucket or whilst banned (@drunderscore) ## TShock 4.5.18 * Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider)