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;
|
GetDataHandlers.Emoji += EmojiHandler.OnReceive;
|
||||||
|
|
||||||
LandGolfBallInCupHandler = new Handlers.LandGolfBallInCupHandler();
|
LandGolfBallInCupHandler = new Handlers.LandGolfBallInCupHandler();
|
||||||
GetDataHandlers.LandGolfBallInCup += LandGolfBallInCupHandler.OnLandGolfBallInCup;
|
GetDataHandlers.LandGolfBallInCup += LandGolfBallInCupHandler.OnReceive;
|
||||||
|
|
||||||
// Setup hooks
|
// Setup hooks
|
||||||
GetDataHandlers.GetSection += OnGetSection;
|
GetDataHandlers.GetSection += OnGetSection;
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Terraria;
|
using Terraria;
|
||||||
using Terraria.ID;
|
using Terraria.ID;
|
||||||
|
using static TShockAPI.GetDataHandlers;
|
||||||
|
|
||||||
namespace TShockAPI.Handlers
|
namespace TShockAPI.Handlers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles client side exploits of LandGolfBallInCup packet.
|
/// Handles client side exploits of LandGolfBallInCup packet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LandGolfBallInCupHandler
|
public class LandGolfBallInCupHandler : IPacketHandler<LandGolfBallInCupEventArgs>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of golf ball projectile IDs.
|
/// List of golf ball projectile IDs.
|
||||||
|
|
@ -64,7 +65,7 @@ namespace TShockAPI.Handlers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="args"></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)
|
if (args.PlayerIndex != args.Player.Index)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue