[L] 添加游戏内翻译
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<classpath>
 | 
			
		||||
	<classpathentry kind="output" path="bin/default"/>
 | 
			
		||||
	<classpathentry output="bin/main" kind="src" path="src/main/java">
 | 
			
		||||
		<attributes>
 | 
			
		||||
			<attribute name="gradle_scope" value="main"/>
 | 
			
		||||
@@ -24,8 +25,6 @@
 | 
			
		||||
			<attribute name="gradle_used_by_scope" value="test"/>
 | 
			
		||||
		</attributes>
 | 
			
		||||
	</classpathentry>
 | 
			
		||||
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
 | 
			
		||||
	<classpathentry kind="output" path="bin/default"/>
 | 
			
		||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
 | 
			
		||||
	<classpathentry sourcepath="C:/Users/Taskeren/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot-api/1.14.2-R0.1-SNAPSHOT/cccf9ead0e83de2bc2cc6c8a1ece9a76570ced0c/spigot-api-1.14.2-R0.1-SNAPSHOT-sources.jar" kind="lib" path="C:/Users/Taskeren/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot-api/1.14.2-R0.1-SNAPSHOT/c3e1b7c24c243bd4c1564c68a174e9a6d201a8e3/spigot-api-1.14.2-R0.1-SNAPSHOT.jar">
 | 
			
		||||
		<attributes>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								.project
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								.project
									
									
									
									
									
								
							@@ -5,17 +5,12 @@
 | 
			
		||||
	<projects/>
 | 
			
		||||
	<natures>
 | 
			
		||||
		<nature>org.eclipse.jdt.core.javanature</nature>
 | 
			
		||||
		<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
 | 
			
		||||
	</natures>
 | 
			
		||||
	<buildSpec>
 | 
			
		||||
		<buildCommand>
 | 
			
		||||
			<name>org.eclipse.jdt.core.javabuilder</name>
 | 
			
		||||
			<arguments/>
 | 
			
		||||
		</buildCommand>
 | 
			
		||||
		<buildCommand>
 | 
			
		||||
			<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
 | 
			
		||||
			<arguments/>
 | 
			
		||||
		</buildCommand>
 | 
			
		||||
	</buildSpec>
 | 
			
		||||
	<linkedResources/>
 | 
			
		||||
	<filteredResources/>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
#
 | 
			
		||||
#Wed Jul 10 14:47:02 CST 2019
 | 
			
		||||
#Wed Jul 10 15:19:10 CST 2019
 | 
			
		||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
 | 
			
		||||
org.eclipse.jdt.core.compiler.compliance=1.8
 | 
			
		||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
 | 
			
		||||
import cc.moecraft.icq.event.events.message.EventMessage;
 | 
			
		||||
import cc.moecraft.icq.user.User;
 | 
			
		||||
import cc.moecraft.icq.utils.CQUtils;
 | 
			
		||||
import cn.glycol.t18n.I18n;
 | 
			
		||||
import ren.taske.nativebot.MinecraftPlugin;
 | 
			
		||||
import ren.taske.nativebot.commons.Config;
 | 
			
		||||
import ren.taske.nativebot.core.NativeBot;
 | 
			
		||||
@@ -51,7 +52,7 @@ public class Chatting {
 | 
			
		||||
			message = CQUtils.removeCqCode(message);
 | 
			
		||||
			
 | 
			
		||||
			StringBuffer sb = new StringBuffer();
 | 
			
		||||
			sb.append("<").append(username).append("> ").append("\u00a7r");
 | 
			
		||||
			sb.append("<").append(username).append("> ").append("\u00a7r"); // \u007a = §
 | 
			
		||||
			sb.append(message);
 | 
			
		||||
			
 | 
			
		||||
			plugin.getServer().broadcastMessage(sb.toString());
 | 
			
		||||
@@ -75,14 +76,14 @@ public class Chatting {
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if(um.getTencentId() == -1L) {
 | 
			
		||||
			evt.getPlayer().sendMessage("Please set your Tencent userid first!");
 | 
			
		||||
			evt.getPlayer().sendMessage(I18n.format("message.using.set-qq-first"));
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		UserTencent ut = UserTencent.of(um.getTencentId());
 | 
			
		||||
		
 | 
			
		||||
		if(!ut.hasPermission(NODE_CHATTING_MINECRAFT)) {
 | 
			
		||||
			evt.getPlayer().sendMessage("You're Unauthorized!");
 | 
			
		||||
			evt.getPlayer().sendMessage(I18n.format("message.unauthorized"));
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -26,47 +26,47 @@ public class UserMinecraft extends User {
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public SimpleDataStorage getData() {
 | 
			
		||||
		return data;
 | 
			
		||||
		return getTencentUser().getData();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onUnload() {
 | 
			
		||||
		data.save();
 | 
			
		||||
		getTencentUser().onUnload();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void reload() {
 | 
			
		||||
		data.save();
 | 
			
		||||
		getTencentUser().reload();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/** 获取玩家对应QQ的权限 */
 | 
			
		||||
	public boolean hasPermission(String node) {
 | 
			
		||||
		return hasPermission(node, false);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public boolean hasPermission(String node, boolean defaultVal) {
 | 
			
		||||
		if(node != null) {
 | 
			
		||||
			data.setDefault(node, defaultVal);
 | 
			
		||||
			data.save();
 | 
			
		||||
		}
 | 
			
		||||
		return data.getBoolean(node, false);
 | 
			
		||||
		return getTencentUser().hasPermission(node);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/** 设置玩家对应QQ的权限 */
 | 
			
		||||
	public void setPermission(String node, boolean val) {
 | 
			
		||||
		data.setBoolean(node, val);
 | 
			
		||||
		data.save();
 | 
			
		||||
		getTencentUser().setPermission(node, val);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public static final String _TENCENT_UID = "tencent.uid";
 | 
			
		||||
	
 | 
			
		||||
	/** 设置该用户的QQ号 */
 | 
			
		||||
	public void setTencentId(long uid) {
 | 
			
		||||
		data.setLong(_TENCENT_UID, uid);
 | 
			
		||||
		data.save();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/** 获取该用户的QQ号 */
 | 
			
		||||
	public long getTencentId() {
 | 
			
		||||
		data.setDefault(_TENCENT_UID, -1L);
 | 
			
		||||
		data.save();
 | 
			
		||||
		return data.getLong(_TENCENT_UID, -1L);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/** 获取该用户的TencentUser */
 | 
			
		||||
	public UserTencent getTencentUser() {
 | 
			
		||||
		return UserTencent.of(getTencentId());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -69,5 +69,4 @@ public class UserTencent extends User {
 | 
			
		||||
			data.save();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,9 @@
 | 
			
		||||
message.common.welcome=欢迎使用!
 | 
			
		||||
 | 
			
		||||
message.using.set-qq-first=请先绑定QQ!
 | 
			
		||||
 | 
			
		||||
message.unauthorized=您没有权限!
 | 
			
		||||
 | 
			
		||||
command.common.done=完成!
 | 
			
		||||
command.common.fail=失败!
 | 
			
		||||
command.common.argument=参数错误!
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user