8
8
import com .sekwah .advancedportals .bukkit .api .portaldata .PortalArg ;
9
9
import com .sekwah .advancedportals .bukkit .destinations .Destination ;
10
10
import com .sekwah .advancedportals .bukkit .effects .WarpEffects ;
11
- import com .sekwah .advancedportals .bukkit .listeners .Listeners ;
12
11
import org .bukkit .*;
13
12
import org .bukkit .configuration .ConfigurationSection ;
14
13
import org .bukkit .entity .Player ;
@@ -486,7 +485,6 @@ public static boolean activate(Player player, AdvancedPortal portal) {
486
485
ByteArrayDataOutput outForList = ByteStreams .newDataOutput ();
487
486
outForList .writeUTF ("PortalEnter" );
488
487
outForList .writeUTF (bungeeServer );
489
- outForList .writeUTF (player .getUniqueId ().toString ());
490
488
outForList .writeUTF (portal .getDestiation ());
491
489
492
490
player .sendPluginMessage (plugin , plugin .channelName , outForList .toByteArray ());
@@ -530,15 +528,15 @@ public static boolean activate(Player player, AdvancedPortal portal) {
530
528
// (?i) makes the search case insensitive
531
529
command = command .replaceAll ("@player" , player .getName ());
532
530
plugin .getLogger ().log (Level .INFO , "Portal command: " + command );
533
- if (command .startsWith ("#" ) && plugin .getSettings ().hasCommandLevel ("c" )) {
531
+ if (command .startsWith ("#" ) && plugin .getSettings ().enabledCommandLevel ("c" )) {
534
532
command = command .substring (1 );
535
533
plugin .getLogger ().log (Level .INFO , "Portal command: " + command );
536
534
try {
537
535
plugin .getServer ().dispatchCommand (Bukkit .getConsoleSender (), command );
538
536
} catch (Exception e ) {
539
537
plugin .getLogger ().warning ("Error while executing: " + command );
540
538
}
541
- } else if (command .startsWith ("!" ) && plugin .getSettings ().hasCommandLevel ("o" )) {
539
+ } else if (command .startsWith ("!" ) && plugin .getSettings ().enabledCommandLevel ("o" )) {
542
540
command = command .substring (1 );
543
541
boolean wasOp = player .isOp ();
544
542
try {
@@ -548,7 +546,7 @@ public static boolean activate(Player player, AdvancedPortal portal) {
548
546
} finally {
549
547
player .setOp (wasOp );
550
548
}
551
- } else if (command .startsWith ("^" )) {
549
+ } else if (command .startsWith ("^" ) && plugin . getSettings (). enabledCommandLevel ( "p" ) ) {
552
550
command = command .substring (1 );
553
551
PermissionAttachment permissionAttachment = null ;
554
552
try {
@@ -558,9 +556,16 @@ public static boolean activate(Player player, AdvancedPortal portal) {
558
556
} finally {
559
557
player .removeAttachment (permissionAttachment );
560
558
}
559
+ } else if (command .startsWith ("%" ) && plugin .getSettings ().enabledCommandLevel ("b" )) {
560
+ command = command .substring (1 );
561
+ ByteArrayDataOutput outForList = ByteStreams .newDataOutput ();
562
+ outForList .writeUTF ("BungeeCommand" );
563
+ outForList .writeUTF (player .getUniqueId ().toString ());
564
+ outForList .writeUTF (command );
565
+ player .sendPluginMessage (plugin , plugin .channelName , outForList .toByteArray ());
561
566
} else {
562
- player .chat ("/" + command );
563
- // player.performCommand(command);
567
+ player .chat ("/" + command );
568
+ // player.performCommand(command);
564
569
}
565
570
command = portal .getArg ("command." + ++commandLine );
566
571
} while (command != null );
0 commit comments