From 8818885a9ec02b9b06c885870bf4788c20bcefa6 Mon Sep 17 00:00:00 2001 From: BashGuy10 <63826227+BashGuy10@users.noreply.github.com> Date: Sat, 22 Oct 2022 20:52:33 -0700 Subject: [PATCH] Fix being kicked for using the new sponge types --- TShockAPI/Bouncer.cs | 17 +++++++++++------ docs/changelog.md | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index 3c1200c8..8d7a92a6 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1737,7 +1737,8 @@ namespace TShockAPI { bucket = 6; } - else if (selectedItemType == ItemID.BottomlessHoneyBucket) + else if (selectedItemType == ItemID.BottomlessHoneyBucket + || selectedItemType == ItemID.HoneyAbsorbantSponge) { bucket = 7; } @@ -1745,8 +1746,12 @@ namespace TShockAPI { bucket = 8; } + else if (selectedItemType == ItemID.UltraAbsorbantSponge) + { + bucket = 9; + } - if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6)) + if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6 || bucket == 9)) { TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 1 from {0}", args.Player.Name)); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); @@ -1766,7 +1771,7 @@ namespace TShockAPI return; } - if (!wasThereABombNearby && type == LiquidType.Water && !(bucket == 1 || bucket == 0 || bucket == 4)) + if (!wasThereABombNearby && type == LiquidType.Water && !(bucket == 1 || bucket == 0 || bucket == 4 || bucket == 9)) { TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 2 from {0}", args.Player.Name)); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); @@ -1786,7 +1791,7 @@ namespace TShockAPI return; } - if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0 || bucket == 7)) + if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0 || bucket == 7 || bucket == 9)) { TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 4 from {0}", args.Player.Name)); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); @@ -1806,11 +1811,11 @@ namespace TShockAPI return; } - if (!wasThereABombNearby && type == LiquidType.Shimmer && bucket != 8) + if (!wasThereABombNearby && type == LiquidType.Shimmer && !(bucket == 8 || bucket == 9)) { TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 6 from {0}", args.Player.Name)); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); - args.Player.Disable(GetString("Spreading shimmer without holding a honey bucket"), DisableFlags.WriteToLogAndConsole); + args.Player.Disable(GetString("Spreading shimmer without holding a shimmer bucket"), DisableFlags.WriteToLogAndConsole); args.Player.SendTileSquareCentered(tileX, tileY, 1); args.Handled = true; return; diff --git a/docs/changelog.md b/docs/changelog.md index 2c8da36b..90100cea 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -68,6 +68,7 @@ Use past tense when adding new entries; sign your name off when you add or chang * Introduced support for loadouts, and saving the current loadout index to SSC. Both `NetItem` and `PlayerData` were modified to support this. (@drunderscore) * Check loadout slots for hacked item stacks. (@drunderscore) * Fix players being kicked after using the Flamethrower to apply the `OnFire3` debuff for `1200` ticks. (@BashGuy10) +* Fix being kicked for using the new sponge types on liquid. (@BashGuy10) ## TShock 4.5.18 * Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider)