From 90f36198d20d1c330f3d1942cb365f1a88ba7c37 Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Mon, 2 May 2016 22:04:10 -0400 Subject: [PATCH] Add plugin caller to setPacket warning Fixes #201 --- .../main/java/com/comphenix/protocol/events/PacketEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/API/src/main/java/com/comphenix/protocol/events/PacketEvent.java b/modules/API/src/main/java/com/comphenix/protocol/events/PacketEvent.java index cae6fdd7..7bf4b9fe 100644 --- a/modules/API/src/main/java/com/comphenix/protocol/events/PacketEvent.java +++ b/modules/API/src/main/java/com/comphenix/protocol/events/PacketEvent.java @@ -30,6 +30,7 @@ import org.bukkit.event.Cancellable; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.async.AsyncMarker; +import com.comphenix.protocol.error.PluginContext; import com.comphenix.protocol.error.Report; import com.comphenix.protocol.error.ReportType; import com.google.common.base.Objects; @@ -231,7 +232,7 @@ public class PacketEvent extends EventObject implements Cancellable { if (CHANGE_WARNINGS.put(oldType, newType)) { ProtocolLibrary.getErrorReporter().reportWarning(this, Report.newBuilder(REPORT_CHANGING_PACKET_TYPE_IS_CONFUSING). - messageParam(oldType, newType). + messageParam(PluginContext.getPluginCaller(new Exception()), oldType, newType). build()); } }