mirror of
https://e.coding.net/circlecloud/SimpleEssential.git
synced 2025-01-06 12:18:56 +00:00
add TpControl Name...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
568ea95ad2
commit
777b1cf71b
@ -77,12 +77,18 @@ public class SimpleEssential extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
tpcontrol = new TeleportControl(this);
|
this.initTeleportControl();
|
||||||
this.registerCommands();
|
this.registerCommands();
|
||||||
this.registerEvents();
|
this.registerEvents();
|
||||||
new VersionChecker(this);
|
new VersionChecker(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initTeleportControl() {
|
||||||
|
int tpdelay = Config.getInstance().getInt("Teleport.delay", 3);
|
||||||
|
String tpcontorlname = Config.getMessage("Teleport.name");
|
||||||
|
tpcontrol = new TeleportControl(this, tpcontorlname, tpdelay);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册事件
|
* 注册事件
|
||||||
*/
|
*/
|
||||||
|
@ -14,7 +14,6 @@ import org.bukkit.potion.PotionEffect;
|
|||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import cn.citycraft.SimpleEssential.SimpleEssential;
|
import cn.citycraft.SimpleEssential.SimpleEssential;
|
||||||
import cn.citycraft.SimpleEssential.config.Config;
|
|
||||||
import cn.citycraft.SimpleEssential.config.Language;
|
import cn.citycraft.SimpleEssential.config.Language;
|
||||||
import cn.citycraft.SimpleEssential.utils.EffectUtil;
|
import cn.citycraft.SimpleEssential.utils.EffectUtil;
|
||||||
|
|
||||||
@ -26,11 +25,13 @@ public class TeleportControl {
|
|||||||
protected HashMap<Player, Location> lastlocList = new HashMap<Player, Location>();
|
protected HashMap<Player, Location> lastlocList = new HashMap<Player, Location>();
|
||||||
private SimpleEssential plugin;
|
private SimpleEssential plugin;
|
||||||
|
|
||||||
private int TpDelay = Config.getInstance().getInt("Teleport.delay", 3);
|
private int TpDelay = 0;
|
||||||
|
private String TpControlName = "";
|
||||||
|
|
||||||
public TeleportControl(SimpleEssential plugin) {
|
public TeleportControl(SimpleEssential plugin, String tpcontrolname, int tpdelay) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
this.TpDelay = tpdelay;
|
||||||
|
this.TpControlName = tpcontrolname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +46,7 @@ public class TeleportControl {
|
|||||||
Player target = ti.getTarget();
|
Player target = ti.getTarget();
|
||||||
Location loc = null;
|
Location loc = null;
|
||||||
if (!target.isOnline()) {
|
if (!target.isOnline()) {
|
||||||
player.sendMessage(Language.getMessage("Teleport.offline"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.offline"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ti.getTptype() == TeleportType.TPA) {
|
if (ti.getTptype() == TeleportType.TPA) {
|
||||||
@ -55,12 +56,12 @@ public class TeleportControl {
|
|||||||
target = player;
|
target = player;
|
||||||
loc = ti.getTarget().getLocation();
|
loc = ti.getTarget().getLocation();
|
||||||
}
|
}
|
||||||
player.sendMessage(Language.getMessage("Teleport.accept"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.accept"));
|
||||||
target.sendMessage(Language.getMessage("Teleport.acceptfrom"));
|
target.sendMessage(TpControlName + Language.getMessage("Teleport.acceptfrom"));
|
||||||
magicTeleport(target, loc, TpDelay);
|
magicTeleport(target, loc, TpDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player.sendMessage(Language.getMessage("Teleport.none"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,7 +89,7 @@ public class TeleportControl {
|
|||||||
if (loc != null) {
|
if (loc != null) {
|
||||||
magicTeleport(player, loc, 3);
|
magicTeleport(player, loc, 3);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(Language.getMessage("Teleport.nobackloc"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.nobackloc"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,12 +104,12 @@ public class TeleportControl {
|
|||||||
if (ti != null) {
|
if (ti != null) {
|
||||||
Player target = ti.getTarget();
|
Player target = ti.getTarget();
|
||||||
if (target.isOnline()) {
|
if (target.isOnline()) {
|
||||||
player.sendMessage(Language.getMessage("Teleport.deny"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.deny"));
|
||||||
target.sendMessage(Language.getMessage("Teleport.denyfrom"));
|
target.sendMessage(TpControlName + Language.getMessage("Teleport.denyfrom"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player.sendMessage(Language.getMessage("Teleport.none"));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,7 +137,7 @@ public class TeleportControl {
|
|||||||
public void magicTeleport(final Player player, final Location loc, final int delay) {
|
public void magicTeleport(final Player player, final Location loc, final int delay) {
|
||||||
int petime = delay * 20 + 10;
|
int petime = delay * 20 + 10;
|
||||||
setLastloc(player, player.getLocation());
|
setLastloc(player, player.getLocation());
|
||||||
player.sendMessage(Language.getMessage("Teleport.tp", delay, loc.getWorld().getName(), loc.getBlockX(), loc.getBlockZ()));
|
player.sendMessage(TpControlName + Language.getMessage("Teleport.tp", delay, loc.getWorld().getName(), loc.getBlockX(), loc.getBlockZ()));
|
||||||
List<PotionEffect> pe = new ArrayList<PotionEffect>();
|
List<PotionEffect> pe = new ArrayList<PotionEffect>();
|
||||||
pe.add(new PotionEffect(PotionEffectType.SLOW, petime, 255));
|
pe.add(new PotionEffect(PotionEffectType.SLOW, petime, 255));
|
||||||
pe.add(new PotionEffect(PotionEffectType.CONFUSION, petime, 255));
|
pe.add(new PotionEffect(PotionEffectType.CONFUSION, petime, 255));
|
||||||
|
@ -18,9 +18,10 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 自动更新类
|
||||||
|
*
|
||||||
* @author 蒋天蓓
|
* @author 蒋天蓓
|
||||||
* 2015年8月14日下午4:01:15
|
* 2015年8月14日下午4:01:15
|
||||||
* 自动更新类
|
|
||||||
*/
|
*/
|
||||||
public class VersionChecker implements Listener {
|
public class VersionChecker implements Listener {
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
@ -26,7 +26,7 @@ Teleport:
|
|||||||
nobackloc: '§c未找到可以Back的地点!'
|
nobackloc: '§c未找到可以Back的地点!'
|
||||||
#自杀
|
#自杀
|
||||||
Suicide:
|
Suicide:
|
||||||
msg: '§6玩家: %s §c活不下去自杀了!'
|
msg: '§6玩家: §a%s §d活不下去 - §c自杀了!'
|
||||||
#帽子
|
#帽子
|
||||||
Hat:
|
Hat:
|
||||||
empty: '§c看上去你手上什么都没有啊!'
|
empty: '§c看上去你手上什么都没有啊!'
|
||||||
|
@ -6,63 +6,69 @@ commands:
|
|||||||
simpleessential:
|
simpleessential:
|
||||||
description: 简单基础插件
|
description: 简单基础插件
|
||||||
aliases: [se,sme]
|
aliases: [se,sme]
|
||||||
usage: §b使用/se help 查看帮助!
|
usage: §6使用§a/se help §6查看帮助!
|
||||||
permission: se.*
|
permission: se.*
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
tpa:
|
tpa:
|
||||||
description: 传送到目标玩家
|
description: 传送到目标玩家
|
||||||
aliases: [setps,smetpa]
|
aliases: [setps,smetpa]
|
||||||
usage: §b使用/tpa <player>传送到目标玩家!
|
usage: §6使用§a/tpa <player> §6传送到目标玩家!
|
||||||
permission: se.tpa
|
permission: se.tpa
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
tphere:
|
tphere:
|
||||||
description: 邀请目标玩家
|
description: 邀请目标玩家
|
||||||
aliases: [tph]
|
aliases: [tph]
|
||||||
usage: §b使用/tphere <player>邀请目标玩家!
|
usage: §6使用§a/tphere <player> §6邀请目标玩家!
|
||||||
permission: se.tphere
|
permission: se.tphere
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
tpaccept:
|
tpaccept:
|
||||||
description: 接受传送或邀请
|
description: 接受传送或邀请
|
||||||
aliases: [tpok]
|
aliases: [tpok]
|
||||||
usage: §b使用/tpaccept 接受传送或邀请!
|
usage: §6使用§a/tpaccept §6接受传送或邀请!
|
||||||
permission: se.tpaccept
|
permission: se.tpaccept
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
tpdeny:
|
tpdeny:
|
||||||
description: 拒绝传送或邀请
|
description: 拒绝传送或邀请
|
||||||
aliases: [tpno]
|
aliases: [tpno]
|
||||||
usage: §b使用/tpdeny 拒绝传送或邀请!
|
usage: §6使用§a/tpdeny §6拒绝传送或邀请!
|
||||||
permission: se.tpdeny
|
permission: se.tpdeny
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
back:
|
back:
|
||||||
description: 回到上一个TP地点
|
description: 回到上一个TP地点
|
||||||
aliases: [seback]
|
aliases: [seback]
|
||||||
usage: §b使用/back 回到上一个TP地点!
|
usage: §6使用§a/back §6回到上一个TP地点!
|
||||||
permission: se.back
|
permission: se.back
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
top:
|
top:
|
||||||
description: 传送到最高方块
|
description: 传送到最高方块
|
||||||
aliases: [setop]
|
aliases: [setop]
|
||||||
usage: §b使用/top 传送到当前位置最高方块!
|
usage: §6使用§a/top §6传送到当前位置最高方块!
|
||||||
permission: se.top
|
permission: se.top
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
home:
|
home:
|
||||||
description: 传送到家里
|
description: 传送到家里
|
||||||
aliases: [sehome]
|
aliases: [sehome]
|
||||||
usage: §b使用/home 传送到家里!
|
usage: §6使用§a/home §6传送到家里!
|
||||||
permission: se.home
|
permission: se.home
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
sethome:
|
sethome:
|
||||||
description: 设置当前位置为家
|
description: 设置当前位置为家
|
||||||
aliases: [sesethome]
|
aliases: [sesethome]
|
||||||
usage: §b使用/sethome 设置当前位置为家!
|
usage: §6使用§a/sethome §6设置当前位置为家!
|
||||||
permission: se.sethome
|
permission: se.sethome
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
suicide:
|
suicide:
|
||||||
description: 自杀
|
description: 自杀
|
||||||
aliases: [sesuicide,sd]
|
aliases: [sesuicide,sd]
|
||||||
usage: §b使用/suicide结束自己的生命!
|
usage: §6使用§a/suicide §6结束自己的生命!
|
||||||
permission: se.suicide
|
permission: se.suicide
|
||||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
|
hat:
|
||||||
|
description: 帽子
|
||||||
|
aliases: [sehat]
|
||||||
|
usage: §6使用§a/hat §6把手上的物品带在头上!
|
||||||
|
permission: se.hat
|
||||||
|
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||||
permissions:
|
permissions:
|
||||||
se.*:
|
se.*:
|
||||||
description: 简单基础插件所有权限!
|
description: 简单基础插件所有权限!
|
||||||
@ -81,4 +87,5 @@ permissions:
|
|||||||
se.sethome: true
|
se.sethome: true
|
||||||
se.home: true
|
se.home: true
|
||||||
se.suicide: true
|
se.suicide: true
|
||||||
|
se.hat: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user