Skip to content

Commit

Permalink
Removing player message for blocked region
Browse files Browse the repository at this point in the history
Now, if the player is teleporting into a config-defined blocked-region, we no longer notify the player directly, simply log into console that entity checks were not carried out since it was a blocked region.
  • Loading branch information
CoolLord22 committed Nov 23, 2022
1 parent 4b440e2 commit c0c2c4e
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ public void onTeleport(PlayerTeleportEvent event) {
if(plugin.config.blockedRegions.containsKey(toWorld)) {
for(ProtectedRegion region : plugin.config.blockedRegions.get(toWorld)) {
if(region.contains(BlockVector3.at(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()))) {
if(plugin.config.failedTeleportMessage != null) {
if(!plugin.config.failedTeleportMessage.isEmpty()) {
plugin.common.sendMessage(plugin.config.usePrefix, event.getPlayer(), plugin.config.failedTeleportMessage
.replaceAll("%x", df.format(event.getFrom().getBlockX()))
.replaceAll("%y", df.format(event.getFrom().getBlockY()))
.replaceAll("%z", df.format(event.getFrom().getBlockZ())));
}
}
plugin.log.logInfo("Player teleporting into a blocked region; ignoring entity checks.", Verbosity.HIGHEST);
return;
}
}
Expand Down

0 comments on commit c0c2c4e

Please sign in to comment.