From 52472fbf8084129f111a47d94b52e8794cff444c Mon Sep 17 00:00:00 2001 From: j502647092 Date: Wed, 20 May 2015 17:26:58 +0800 Subject: [PATCH] update config file ... Signed-off-by: j502647092 --- src/cn/citycraft/TeleportRandom/TeleportRandom.java | 11 +++++------ src/config.yml | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cn/citycraft/TeleportRandom/TeleportRandom.java b/src/cn/citycraft/TeleportRandom/TeleportRandom.java index be23ce4..6d79568 100644 --- a/src/cn/citycraft/TeleportRandom/TeleportRandom.java +++ b/src/cn/citycraft/TeleportRandom/TeleportRandom.java @@ -83,8 +83,8 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor { } int y = world.getHighestBlockYAt(x, z); final Location trl = new Location(world, x, y - 1, z); - String blockname = trl.getBlock().getType().name(); final Material rbm = trl.getBlock().getType(); + String blockname = rbm.name(); for (String protectblock : Config.getInstance().getStringList( "ProtectBlock")) { if (protectblock.equalsIgnoreCase(blockname)) { @@ -99,14 +99,13 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor { }, 200); } } - Location nrl = new Location(world, x, y + 2, z); + Location nrl = new Location(world, x, y + 3, z); p.teleport(nrl); p.sendMessage(servername + pluginname - + getmessage("Message.Tip").replace( - "%world%", - world.getName().replace("%x%", x + "") - .replace("%z%", z + ""))); + + getmessage("Message.Tip") + .replaceAll("%world%", world.getName()) + .replaceAll("%x%", x + "").replaceAll("%z%", z + "")); } public String getmessage(String path) { diff --git a/src/config.yml b/src/config.yml index 8236ac5..a44ecd2 100644 --- a/src/config.yml +++ b/src/config.yml @@ -15,7 +15,7 @@ Message: default1: '&5未指定随机范围 使用默认值1000!' default2: '&c正确使用方法/tpr [随机传送范围]!' #提示 - Tip: '&a您被传送至 &a世界%world% &dX:%x% Z:%z%!' + Tip: '&a您被传送至 &6世界: %world% &dX: %x% Z: %z%!' #警告 Wran: '&c超过最大允许传送范围 已限制为%limit%!' #传送保护提示