Refactor LandGolfBallInCupHandler to use IPacketHandler<TArgs>
This commit is contained in:
parent
f1e8fbd8ee
commit
7b316f3cd5
2 changed files with 4 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ namespace TShockAPI
|
|||
GetDataHandlers.Emoji += EmojiHandler.OnReceive;
|
||||
|
||||
LandGolfBallInCupHandler = new Handlers.LandGolfBallInCupHandler();
|
||||
GetDataHandlers.LandGolfBallInCup += LandGolfBallInCupHandler.OnLandGolfBallInCup;
|
||||
GetDataHandlers.LandGolfBallInCup += LandGolfBallInCupHandler.OnReceive;
|
||||
|
||||
// Setup hooks
|
||||
GetDataHandlers.GetSection += OnGetSection;
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using static TShockAPI.GetDataHandlers;
|
||||
|
||||
namespace TShockAPI.Handlers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles client side exploits of LandGolfBallInCup packet.
|
||||
/// </summary>
|
||||
public class LandGolfBallInCupHandler
|
||||
public class LandGolfBallInCupHandler : IPacketHandler<LandGolfBallInCupEventArgs>
|
||||
{
|
||||
/// <summary>
|
||||
/// List of golf ball projectile IDs.
|
||||
|
|
@ -64,7 +65,7 @@ namespace TShockAPI.Handlers
|
|||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
public void OnLandGolfBallInCup(object sender, GetDataHandlers.LandGolfBallInCupEventArgs args)
|
||||
public void OnReceive(object sender, LandGolfBallInCupEventArgs args)
|
||||
{
|
||||
if (args.PlayerIndex != args.Player.Index)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue