diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 56d46df2..d55e9962 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -120,7 +120,7 @@ namespace TShockAPI ChatCommands.Add(new Command("home", "tp", Home)); ChatCommands.Add(new Command("spawn", "tp", Spawn)); ChatCommands.Add(new Command("tp", "tp", TP)); - ChatCommands.Add(new Command("tphere", "tp", TPHere)); + ChatCommands.Add(new Command("tphere", "tphere", TPHere)); ChatCommands.Add(new Command("warp", "warp", UseWarp)); ChatCommands.Add(new Command("setwarp", "managewarp", SetWarp)); ChatCommands.Add(new Command("delwarp", "managewarp", DeleteWarp)); diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index ba7feda1..48f70535 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -360,7 +360,10 @@ namespace TShockAPI private static bool HandlePlayerDamage(GetDataHandlerArgs args) { byte playerid = args.Data.ReadInt8(); - return !TShock.Players[playerid].TPlayer.hostile; + if (playerid >= 0 && playerid <= Main.maxPlayers && TShock.Players[playerid] != null) + return !TShock.Players[playerid].TPlayer.hostile; + + return ConfigurationManager.PermaPvp; } private static bool HandleLiquidSet(GetDataHandlerArgs args) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 1d614b23..0910422c 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -143,8 +143,9 @@ namespace TShockAPI Main.spawnTileX = tileX; Main.spawnTileY = tileY; SendData(PacketTypes.WorldInfo); - SendTileSquare(tileX, tileY, 30); - if (TPlayer.SpawnX >= 0 && TPlayer.SpawnY >= 0) + SendTileSquare(tileX, tileY, 50); + + if (TPlayer.SpawnX > 0 && TPlayer.SpawnY > 0) { Main.tile[TPlayer.SpawnX, TPlayer.SpawnY].active = false; NetMessage.SendTileSquare(Index, TPlayer.SpawnX, TPlayer.SpawnY, 1); @@ -157,6 +158,7 @@ namespace TShockAPI { Spawn(); } + Main.spawnTileX = spawnTileX; Main.spawnTileY = spawnTileY; SendData(PacketTypes.WorldInfo); diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index b26967ee..0c8cbf17 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -200,23 +200,26 @@ namespace TShockAPI { if (player != null && player.Active) { - if (player.TileThreshold >= ConfigurationManager.TileThreshold) + if (player.TilesDestroyed != null) { - if (Tools.HandleTntUser(player, "Kill tile abuse detected.")) + if (player.TileThreshold >= ConfigurationManager.TileThreshold) { - TSPlayer.Server.RevertKillTile(player.TilesDestroyed); + if (Tools.HandleTntUser(player, "Kill tile abuse detected.")) + { + TSPlayer.Server.RevertKillTile(player.TilesDestroyed); + } + else if (player.TileThreshold > 0) + { + player.TileThreshold = 0; + player.TilesDestroyed.Clear(); + } + } else if (player.TileThreshold > 0) { player.TileThreshold = 0; player.TilesDestroyed.Clear(); } - - } - else if (player.TileThreshold > 0) - { - player.TileThreshold = 0; - player.TilesDestroyed.Clear(); } if (!player.Group.HasPermission("usebanneditem")) diff --git a/TShockAPI/config/groups.txt b/TShockAPI/config/groups.txt index 251ce199..f0b1b53f 100644 --- a/TShockAPI/config/groups.txt +++ b/TShockAPI/config/groups.txt @@ -21,6 +21,7 @@ #spawnboss - allow player to spawn bosses #spawnmob - allow player to spawn any npcs #tp - allow player to teleport +#tphere - allow a player to teleport players to their position #managewarp - allow player to add/delete warp locations #editspawn - allow player to enable/disable build protection #cfg - allow player to view/change tshock configuration @@ -39,5 +40,5 @@ default null canwater canlava warp vip default reservedslot newadmin default kick editspawn reservedslot -admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick +admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick tphere trustedadmin admin maintenance cfg butcher cheat immunetoban ignorecheatdetection ignoregriefdetection usebanneditem \ No newline at end of file