diff --git a/resources/config.yml b/resources/config.yml index 1e2f188..4af427c 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -7,4 +7,5 @@ gateTeleportMessage: "Thank you for traveling with Craft Inc. Gates." showTeleportMessage: true gateTeleportNoPermissionMessage: "You are not allowed to use this gate!" showTeleportNoPermissionMessage: true +gateTeleportVehicleNotAllowedMessage: "You must not use that gate while riding!" gateMaterial: "nether portal" \ No newline at end of file diff --git a/src/de/craftinc/gates/listeners/PlayerMoveListener.java b/src/de/craftinc/gates/listeners/PlayerMoveListener.java index 733bee7..1a88b93 100644 --- a/src/de/craftinc/gates/listeners/PlayerMoveListener.java +++ b/src/de/craftinc/gates/listeners/PlayerMoveListener.java @@ -110,8 +110,9 @@ public class PlayerMoveListener implements Listener if (vehicle != null && (!vehicleIsSuitable) || !gate.getAllowsVehicles()) { - if (!gate.getAllowsVehicles()) { - // TODO: display not allowed message + if (!gate.getAllowsVehicles() && Plugin.getPlugin().getConfig().getBoolean(ConfigurationUtil.confShowTeleportNoPermissionMessageKey)) { + final String notAllowedMessage = Plugin.getPlugin().getConfig().getString(ConfigurationUtil.confGateTeleportVehicleNotAllowedMessageKey); + player.sendMessage(ChatColor.DARK_AQUA + notAllowedMessage); } return; diff --git a/src/de/craftinc/gates/util/ConfigurationUtil.java b/src/de/craftinc/gates/util/ConfigurationUtil.java index be78ed3..ed49eba 100644 --- a/src/de/craftinc/gates/util/ConfigurationUtil.java +++ b/src/de/craftinc/gates/util/ConfigurationUtil.java @@ -29,6 +29,7 @@ public class ConfigurationUtil public static final String confPlayerGateBlockUpdateRadiusKey = "playerGateBlockUpdateRadius"; public static final String confCheckForBrokenGateFramesKey = "checkForBrokenGateFrames"; public static final String confGateTeleportMessageKey = "gateTeleportMessage"; + public static final String confGateTeleportVehicleNotAllowedMessageKey = "gateTeleportVehicleNotAllowedMessage"; public static final String confShowTeleportMessageKey = "showTeleportMessage"; public static final String confGateTeleportNoPermissionMessageKey = "gateTeleportNoPermissionMessage"; public static final String confShowTeleportNoPermissionMessageKey = "showTeleportNoPermissionMessage";