From 7452d3c91d56e85e622b1e3d8ce2afdcbc913911 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 22 May 2020 23:33:09 -0700 Subject: [PATCH] Support using bottomless lava bucket This is in response to discussion #1859. Due to the nature of this already terrible handler, I refuse to add any other types of checks for whether or not this item is banned and lava. If you want to ban lava, ban a lava bucket. Don't ban an infinite lava bucket, because finite lava is still infinite lava in this topsy turvy game where the client rules the world. --- CHANGELOG.md | 2 ++ TShockAPI/Bouncer.cs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f956c63b..62a96234 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fix bed spawn issues when trying to remove spawn point in SSC (@Olink) * Fix Snake Flute (@Olink) * Fix lava absorbant sponge not capturing lava. `LiquidSetEventArgs` now returns a `LiquidType` instead of a byte type. (@hakusaro) +* Fix bottomless lava bucket from not being able to create lava. (@hakusaro) + * Ban a lava bucket to ban lava on the server entirely, until we figure out a better way to handle liquids. ## TShock 4.4.0 (Pre-release 6) * Updates to OTAPI 2.0.0.35 (@DeathCradle). diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index d0541809..5803f67f 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1307,8 +1307,12 @@ namespace TShockAPI { bucket = 5; } + else if (selectedItemType == ItemID.BottomlessLavaBucket) + { + bucket = 6; + } - if (type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5)) + if (type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6)) { TShock.Log.ConsoleDebug("Bouncer / OnLiquidSet rejected bucket check 1 from {0}", args.Player.Name); args.Player.SendErrorMessage("You do not have permission to perform this action.");