Stuff
This commit is contained in:
parent
b0f5a49ec2
commit
442a5b4202
15 changed files with 74 additions and 255 deletions
|
|
@ -28,13 +28,13 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Community.CsharpSqlite.SQLiteClient;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Terraria;
|
||||
using TerrariaAPI;
|
||||
|
|
@ -44,7 +44,7 @@ using TShockAPI.Net;
|
|||
|
||||
namespace TShockAPI
|
||||
{
|
||||
[APIVersion(1, 7)]
|
||||
[APIVersion(1, 8)]
|
||||
public class TShock : TerrariaPlugin
|
||||
{
|
||||
public static readonly Version VersionNum = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
|
@ -356,7 +356,7 @@ namespace TShockAPI
|
|||
|
||||
private DateTime LastCheck = DateTime.UtcNow;
|
||||
|
||||
private void OnUpdate(GameTime time)
|
||||
private void OnUpdate()
|
||||
{
|
||||
UpdateManager.UpdateProcedureCheck();
|
||||
|
||||
|
|
@ -812,9 +812,16 @@ namespace TShockAPI
|
|||
|
||||
public static bool CheckSpawn(int x, int y)
|
||||
{
|
||||
Vector2 tile = new Vector2(x, y);
|
||||
Vector2 spawn = new Vector2(Main.spawnTileX, Main.spawnTileY);
|
||||
return Vector2.Distance(spawn, tile) <= Config.SpawnProtectionRadius;
|
||||
PointF tile = new PointF(x, y);
|
||||
PointF spawn = new PointF(Main.spawnTileX, Main.spawnTileY);
|
||||
return Distance(spawn, tile) <= Config.SpawnProtectionRadius;
|
||||
}
|
||||
public static float Distance(PointF value1, PointF value2)
|
||||
{
|
||||
float num2 = value1.X - value2.X;
|
||||
float num = value1.Y - value2.Y;
|
||||
float num3 = (num2 * num2) + (num * num);
|
||||
return (float)Math.Sqrt((double)num3);
|
||||
}
|
||||
|
||||
public static bool HackedHealth(TSPlayer player)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue