@@ -40,6 +40,12 @@ public void handleMPOptions(MinimapPlayer player, byte[] message, String replyCh
4040 public void handleTeleport (MinimapPlayer player , byte [] message , String replyChannel , int replyByte ) {
4141 if (!player .hasPermission ("minimap.jm.teleport" )) {
4242 player .sendMessage (MiniMessage .miniMessage ().deserialize ("<red>You don't have permission to teleport." ));
43+ return ;
44+ }
45+ String teleport = getEffectiveConfig (player ).teleportEnabled ;
46+ if (teleport .equalsIgnoreCase ("none" ) || (teleport .equalsIgnoreCase ("ops" ) && !player .hasPermission ("minimap.jm.admin" ))) {
47+ player .sendMessage (MiniMessage .miniMessage ().deserialize ("<red>Teleport packet was sent, but teleporting isn't enabled." ));
48+ return ;
4349 }
4450
4551 ByteArrayDataInput in = ByteStreams .newDataInput (message );
@@ -148,13 +154,18 @@ public void handleVersion(MinimapPlayer player, byte[] message, String replyChan
148154 player .sendPluginMessage (out .toByteArray (), replyChannel );
149155 }
150156
151- public void handlePerm (MinimapPlayer player , byte [] message , String replyChannel , int replyByte ) {
152- modernList .putIfAbsent (player .getUniqueId (), message .length > 0 && message [0 ] == 42 );
157+ public JMConfig getEffectiveConfig (MinimapPlayer player ) {
153158 JMWorldConfig worldConfig = plugin .getConfig ().getWorldConfig (player .getLocation ().getWorld ().getName ()).journeymapConfig ;
154159 JMConfig config = plugin .getConfig ().globalJourneymapConfig ;
155160 if (worldConfig != null ) {
156- config = worldConfig .applyToConfig (config );
161+ return worldConfig .applyToConfig (config );
157162 }
163+ return config ;
164+ }
165+
166+ public void handlePerm (MinimapPlayer player , byte [] message , String replyChannel , int replyByte ) {
167+ modernList .putIfAbsent (player .getUniqueId (), message .length > 0 && message [0 ] == 42 );
168+ JMConfig config = getEffectiveConfig (player );
158169
159170 Gson gson = new Gson ();
160171 String payload = gson .toJson (config );
0 commit comments