Merge branch 'general-devel' into addtileentityinteraction
This commit is contained in:
commit
972483340a
4 changed files with 43 additions and 19 deletions
|
|
@ -3,6 +3,11 @@
|
|||
This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large.
|
||||
|
||||
## Upcoming changes
|
||||
* Fixed various bugs related to Snake Charmer's Flute. (@rustly)
|
||||
* The entirety of the snake now places.
|
||||
* The old snake now removes when placing a new snake.
|
||||
* Players are no longer disabled for breaking TilePlace/TileKill thresholds when modifying snakes.
|
||||
* Prevented players from seeing the npc spawnrate change permission error on join. (@rustly)
|
||||
* Installed new sprinklers!
|
||||
* Organized parameters by category and relevance in the `config.json` file. (@kubedzero)
|
||||
* Fix multiple holes in Bouncer OnTileData. (@Patrikkk, @hakusaro)
|
||||
|
|
|
|||
|
|
@ -299,7 +299,8 @@ namespace TShockAPI
|
|||
}
|
||||
// If the tile is a pickaxe tile and they aren't selecting a pickaxe, they're hacking.
|
||||
// Item frames can be modified without pickaxe tile.
|
||||
else if (tile.type != TileID.ItemFrame
|
||||
//also add an exception for snake coils, they can be removed when the player places a new one or after x amount of time
|
||||
else if (tile.type != TileID.ItemFrame && tile.type != TileID.MysticSnakeRope
|
||||
&& !Main.tileAxe[tile.type] && !Main.tileHammer[tile.type] && tile.wall == 0 && args.Player.TPlayer.mount.Type != 8 && selectedItem.pick == 0 && !ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0)
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (pick) {0} {1} {2}", args.Player.Name, action, editData);
|
||||
|
|
@ -461,9 +462,10 @@ namespace TShockAPI
|
|||
return;
|
||||
}
|
||||
|
||||
if (!args.Player.IsInRange(tileX, tileY))
|
||||
//make sure it isnt a snake coil related edit so it doesnt spam debug logs with range check failures
|
||||
if ((action == EditAction.PlaceTile && editData != TileID.MysticSnakeRope) || (action == EditAction.KillTile && tile.type != TileID.MysticSnakeRope) && !args.Player.IsInRange(tileX, tileY))
|
||||
{
|
||||
if (action == EditAction.PlaceTile && (editData == TileID.Rope || editData == TileID.SilkRope || editData == TileID.VineRope || editData == TileID.WebRope))
|
||||
if (action == EditAction.PlaceTile && (editData == TileID.Rope || editData == TileID.SilkRope || editData == TileID.VineRope || editData == TileID.WebRope || editData == TileID.MysticSnakeRope))
|
||||
{
|
||||
args.Handled = false;
|
||||
return;
|
||||
|
|
@ -532,6 +534,9 @@ namespace TShockAPI
|
|||
return;
|
||||
}
|
||||
|
||||
//snake coil can allow massive amounts of tile edits so it gets an exception
|
||||
if (!((action == EditAction.PlaceTile && editData == TileID.MysticSnakeRope) || (action == EditAction.KillTile && tile.type == TileID.MysticSnakeRope)))
|
||||
{
|
||||
if ((action == EditAction.PlaceTile || action == EditAction.ReplaceTile || action == EditAction.PlaceWall || action == EditAction.ReplaceWall) && !args.Player.HasPermission(Permissions.ignoreplacetiledetection))
|
||||
{
|
||||
args.Player.TilePlaceThreshold++;
|
||||
|
|
@ -550,6 +555,7 @@ namespace TShockAPI
|
|||
if (!args.Player.TilesDestroyed.ContainsKey(coords))
|
||||
args.Player.TilesDestroyed.Add(coords, Main.tile[tileX, tileY]);
|
||||
}
|
||||
}
|
||||
args.Handled = false;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1640,7 +1646,8 @@ namespace TShockAPI
|
|||
if ((type != TileID.Rope
|
||||
|| type != TileID.SilkRope
|
||||
|| type != TileID.VineRope
|
||||
|| type != TileID.WebRope)
|
||||
|| type != TileID.WebRope
|
||||
|| type != TileID.MysticSnakeRope)
|
||||
&& !args.Player.IsInRange(x, y))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / OnPlaceObject rejected range checks from {0}", args.Player.Name);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@ namespace TShockAPI.Handlers.NetModules
|
|||
|
||||
string permission = PowerToPermissionMap[powerType];
|
||||
|
||||
//prevent being told about the spawnrate permission on join until relogic fixes
|
||||
if (!player.HasReceivedNPCPermissionError && powerType == CreativePowerTypes.SetSpawnRate)
|
||||
{
|
||||
player.HasReceivedNPCPermissionError = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.HasPermission(permission))
|
||||
{
|
||||
player.SendErrorMessage("You do not have permission to {0}.", PermissionToDescriptionMap[permission]);
|
||||
|
|
|
|||
|
|
@ -111,6 +111,11 @@ namespace TShockAPI
|
|||
return found;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used in preventing players from seeing the npc spawnrate permission error on join.
|
||||
/// </summary>
|
||||
internal bool HasReceivedNPCPermissionError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of tiles that the player has killed in the last second.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue