11package nl .datdenkikniet .warpalicious .listeners ;
22
33import net .md_5 .bungee .api .ChatColor ;
4+ import nl .datdenkikniet .warpalicious .WarpaliciousPlugin ;
45import nl .datdenkikniet .warpalicious .config .messages .Strings ;
56import nl .datdenkikniet .warpalicious .handling .Flag ;
67import nl .datdenkikniet .warpalicious .handling .TeleportMode ;
78import nl .datdenkikniet .warpalicious .handling .Warp ;
89import nl .datdenkikniet .warpalicious .handling .WarpHandler ;
10+ import org .bukkit .Location ;
911import org .bukkit .Material ;
1012import org .bukkit .block .Block ;
1113import org .bukkit .block .Sign ;
1820
1921public class SignEventListener implements Listener {
2022
23+ private WarpaliciousPlugin plugin ;
2124 private Strings str ;
2225 private WarpHandler handler ;
2326
24- public SignEventListener (Strings instance , WarpHandler hd ) {
25- str = instance ;
26- handler = hd ;
27+ public SignEventListener (WarpaliciousPlugin plugin ) {
28+ this .plugin = plugin ;
29+ str = plugin .getStrings ();
30+ handler = plugin .getWarpHandler ();
2731 }
2832
2933 @ EventHandler
@@ -35,6 +39,10 @@ public void sign(SignChangeEvent evt) {
3539 if (evt .getPlayer ().hasPermission (str .createWarpSignPerm )) {
3640 if (l1 != null && handler .getWarp (l1 ) != null ) {
3741 evt .setLine (0 , str .warpSignHeader );
42+ plugin .getLogger ().info (evt .getPlayer () + " created a signwarp with the warp: " + l1 );
43+ Location loc = evt .getBlock ().getLocation ();
44+ plugin .getLogger ().info ("It is located at X: " + loc .getBlockX () + ", Y: " + loc .getBlockY ()
45+ + " and Z: " + loc .getBlockZ () + " in the world: " + loc .getWorld ());
3846 p .sendMessage (str .createdWarpSign .replace ("%WARP%" , l1 ));
3947 } else {
4048 evt .setLine (0 , "[warp]" );
@@ -58,6 +66,7 @@ public void interact(PlayerInteractEvent e) {
5866 boolean signPrivate = warp .getFlag (Flag .SIGNPRIVATE ) && !str .checkPermission (e .getPlayer (), str .warpToPrivatePerm ) && !warp .getOwner ().equals (e .getPlayer ().getUniqueId ());
5967 if (!signPrivate ) {
6068 if (sign .getLine (0 ).equalsIgnoreCase (str .warpSignHeader )) {
69+ plugin .getLogger ().info (e .getPlayer ().getName () + " used a signwarp with the warp: " + warp .getName ());
6170 warp .warp (e .getPlayer (), TeleportMode .SIGN , str );
6271 }
6372 } else {
0 commit comments