The PlayerSpawn hook now magically has actual spawn stuff as opposed to liquid stuff because we were testing Campfire and Gitlive
This commit is contained in:
parent
6b8c4ab2a1
commit
11ec932d35
1 changed files with 13 additions and 12 deletions
|
|
@ -380,26 +380,24 @@ namespace TShockAPI
|
|||
|
||||
public class SpawnEventArgs : HandledEventArgs
|
||||
{
|
||||
public int TileX { get; set; }
|
||||
public int TileY { get; set; }
|
||||
public byte Liquid { get; set; }
|
||||
public bool Lava { get; set; }
|
||||
public byte Player { get; set; }
|
||||
public int SpawnX { get; set; }
|
||||
public int SpawnY { get; set; }
|
||||
}
|
||||
public static HandlerList<SpawnEventArgs> PlayerSpawn;
|
||||
|
||||
private static bool OnPlayerSpawn(int tilex, int tiley, byte liquid, bool lava)
|
||||
private static bool OnPlayerSpawn(byte player, int spawnX, int spawnY)
|
||||
{
|
||||
if (LiquidSet == null)
|
||||
if (PlayerSpawn == null)
|
||||
return false;
|
||||
|
||||
var args = new LiquidSetEventArgs
|
||||
var args = new SpawnEventArgs
|
||||
{
|
||||
TileX = tilex,
|
||||
TileY = tiley,
|
||||
Liquid = liquid,
|
||||
Lava = lava,
|
||||
Player = player,
|
||||
SpawnX = spawnX,
|
||||
SpawnY = spawnY,
|
||||
};
|
||||
LiquidSet.Invoke(null, args);
|
||||
PlayerSpawn.Invoke(null, args);
|
||||
return args.Handled;
|
||||
}
|
||||
|
||||
|
|
@ -1515,6 +1513,9 @@ namespace TShockAPI
|
|||
var spawnx = args.Data.ReadInt32();
|
||||
var spawny = args.Data.ReadInt32();
|
||||
|
||||
if (OnPlayerSpawn(player, spawnx, spawny))
|
||||
return true;
|
||||
|
||||
if (args.Player.InitSpawn && args.TPlayer.inventory[args.TPlayer.selectedItem].type != 50)
|
||||
{
|
||||
if (args.TPlayer.difficulty == 1 && (TShock.Config.KickOnMediumcoreDeath || TShock.Config.BanOnMediumcoreDeath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue