Endless water bucket is now considered to be a water bucket
This commit is contained in:
parent
458a5cebf9
commit
2d66265afd
1 changed files with 34 additions and 30 deletions
|
|
@ -62,10 +62,10 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TileEditEventArgs : HandledEventArgs
|
public class TileEditEventArgs : HandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The TSPlayer who made the tile edit
|
/// The TSPlayer who made the tile edit
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TSPlayer Player { get; set; }
|
public TSPlayer Player { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tile coordinate on the X plane
|
/// The tile coordinate on the X plane
|
||||||
|
|
@ -76,7 +76,7 @@ namespace TShockAPI
|
||||||
/// The tile coordinate on the Y plane
|
/// The tile coordinate on the Y plane
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Y { get; set; }
|
public int Y { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Tile ID being edited.
|
/// The Tile ID being edited.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -87,16 +87,16 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EditAction Action { get; set; }
|
public EditAction Action { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Did the tile get destroyed successfully.
|
/// Did the tile get destroyed successfully.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EditType editDetail { get; set; }
|
public EditType editDetail { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used when a tile is placed to denote a subtype of tile. (e.g. for tile id 21: Chest = 0, Gold Chest = 1)
|
/// Used when a tile is placed to denote a subtype of tile. (e.g. for tile id 21: Chest = 0, Gold Chest = 1)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte Style { get; set; }
|
public byte Style { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TileEdit - called when a tile is placed or destroyed
|
/// TileEdit - called when a tile is placed or destroyed
|
||||||
|
|
@ -109,12 +109,12 @@ namespace TShockAPI
|
||||||
|
|
||||||
var args = new TileEditEventArgs
|
var args = new TileEditEventArgs
|
||||||
{
|
{
|
||||||
Player = ply,
|
Player = ply,
|
||||||
X = x,
|
X = x,
|
||||||
Y = y,
|
Y = y,
|
||||||
Action = action,
|
Action = action,
|
||||||
EditData = editData,
|
EditData = editData,
|
||||||
editDetail = editDetail,
|
editDetail = editDetail,
|
||||||
Style = style
|
Style = style
|
||||||
};
|
};
|
||||||
TileEdit.Invoke(null, args);
|
TileEdit.Invoke(null, args);
|
||||||
|
|
@ -157,14 +157,14 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerTeamEventArgs : HandledEventArgs
|
public class PlayerTeamEventArgs : HandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria player ID of the player
|
/// The Terraria player ID of the player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte PlayerId { get; set; }
|
public byte PlayerId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enable/disable pvp?
|
/// Enable/disable pvp?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte Team { get; set; }
|
public byte Team { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TogglePvp - called when a player toggles pvp
|
/// TogglePvp - called when a player toggles pvp
|
||||||
|
|
@ -172,16 +172,16 @@ namespace TShockAPI
|
||||||
public static HandlerList<PlayerTeamEventArgs> PlayerTeam;
|
public static HandlerList<PlayerTeamEventArgs> PlayerTeam;
|
||||||
private static bool OnPlayerTeam(byte _id, byte _team)
|
private static bool OnPlayerTeam(byte _id, byte _team)
|
||||||
{
|
{
|
||||||
if (PlayerTeam == null)
|
if (PlayerTeam == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new PlayerTeamEventArgs
|
var args = new PlayerTeamEventArgs
|
||||||
{
|
{
|
||||||
PlayerId = _id,
|
PlayerId = _id,
|
||||||
Team = _team,
|
Team = _team,
|
||||||
};
|
};
|
||||||
PlayerTeam.Invoke(null, args);
|
PlayerTeam.Invoke(null, args);
|
||||||
return args.Handled;
|
return args.Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -2681,6 +2681,10 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
bucket = 3;
|
bucket = 3;
|
||||||
}
|
}
|
||||||
|
else if (args.TPlayer.inventory[args.TPlayer.selectedItem].type == 3031)
|
||||||
|
{
|
||||||
|
bucket = 4;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == 1 && !(bucket == 2 || bucket == 0))
|
if (type == 1 && !(bucket == 2 || bucket == 0))
|
||||||
{
|
{
|
||||||
|
|
@ -2698,7 +2702,7 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 0 && !(bucket == 1 || bucket == 0))
|
if (type == 0 && !(bucket == 1 || bucket == 0 || bucket == 4))
|
||||||
{
|
{
|
||||||
args.Player.SendErrorMessage("You do not have permission to perform this action.");
|
args.Player.SendErrorMessage("You do not have permission to perform this action.");
|
||||||
args.Player.Disable("Spreading water without holding a water bucket");
|
args.Player.Disable("Spreading water without holding a water bucket");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue