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.
This commit is contained in:
Lucas Nicodemus 2020-05-22 23:33:09 -07:00
parent a457e8c9ee
commit 7452d3c91d
No known key found for this signature in database
GPG key ID: A07BD9023D1664DB
2 changed files with 7 additions and 1 deletions

View file

@ -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).

View file

@ -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.");