Skip to content

Commit

Permalink
2019-6-9 17:35 Update v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WinfXK committed Jun 9, 2019
1 parent c5b3865 commit 5657487
Show file tree
Hide file tree
Showing 25 changed files with 572 additions and 341 deletions.
Binary file modified Javadoc.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion MiniatureS/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: MiniatureS
main: cn.xiaokai.mis.MiniatureS
api:
- 1.0.0
version: 2.2.0
version: 2.3.0
load: POSTWORLD
website: http://EpicFX.cn
description: 支持多功能商店,如经验,物品的出售回收,物品的交换以及命令的购买使用等!并且支持多功能菜单,如传送、命令、提示等功能,并且支持多功能个人商店!并且支持自定义商品搜索等!后期还会加入更多功能哦!
Expand Down
5 changes: 3 additions & 2 deletions MiniatureS/resources/Config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Mis配置文件
#帅帅的凯凯~
#请不要修改这个数据!
文件版本: 2019-6-5
文件版本: 2019-6-9
#配置开始==================
#每个玩家进服的时候都会给一个,当拿着这个玩意右键的时候打开菜单主页,特殊值可以不限定,当特殊值为x时默认匹配所有,特殊值默认为0,当这个值为空(null{在Yml文件内用~表示})时不适用快捷工具!
快捷工具: '347:0'
Expand All @@ -12,4 +12,5 @@
个人商店: true
#上架每个物品到个人商店的价格
上架耗资: 0
个人商店介绍修改费用: 1000
个人商店介绍修改费用: 1000
检测更新: true
2 changes: 1 addition & 1 deletion MiniatureS/resources/Message.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#请不要修改这个数据!
文件版本: 2019-6-5
文件版本: 2019-6-9
#各种可以自定义的内容
#注:若是可以使用变量,变量一律用{}包围,如{Server_Name}
#注:变量对大小写敏感!
Expand Down
Binary file not shown.
10 changes: 3 additions & 7 deletions MiniatureS/src/cn/xiaokai/mis/EfficacyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.File;

import cn.nukkit.utils.Config;
import cn.nukkit.utils.TextFormat;

/**
* @author Winfxk
Expand All @@ -26,13 +25,10 @@ public static void startPY() {
File file = new File(dirFile, fileName);
try {
new Config(file, Config.YAML);
MiniatureS.mis.getLogger().info(MiniatureS.Title + TextFormat.YELLOW + "文件" + TextFormat.GREEN
+ dirFile.getName() + "/" + fileName + TextFormat.YELLOW + "效验成功!");
MiniatureS.mis.getLogger().info("§e文件§6" + dirFile.getName() + "/" + fileName + "§e效验成功!");
} catch (Exception e) {
MiniatureS.mis.getLogger()
.info(MiniatureS.Title + TextFormat.RED + "文件" + TextFormat.GREEN + dirFile.getName()
+ "/" + fileName + TextFormat.RED + "效验不通过!请检查!" + TextFormat.WHITE
+ e.getMessage());
MiniatureS.mis.getLogger().info(
"§4文件§6" + dirFile.getName() + "§4/§6" + fileName + "§4效验不通过!请检查!§f" + e.getMessage());
}
}
}
Expand Down
18 changes: 14 additions & 4 deletions MiniatureS/src/cn/xiaokai/mis/MiniatureS.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import cn.xiaokai.mis.cmd.ShopCommand;
import cn.xiaokai.mis.event.FormCallback;
import cn.xiaokai.mis.event.PlayerEvent;
import cn.xiaokai.mis.event.yousb.SBPlayerData;
import cn.xiaokai.mis.form.MakeForm;
import cn.xiaokai.mis.form.custom.CustomData;
import cn.xiaokai.mis.form.openbt.HandsomeXiaoKai;
Expand All @@ -59,6 +60,7 @@
import cn.xiaokai.mis.shop.ShopData;
import cn.xiaokai.mis.shop.ShopMakeForm;
import cn.xiaokai.mis.tool.Tool;
import cn.xiaokai.mis.tool.up.Update;

/**
* @author Winfxk
Expand Down Expand Up @@ -187,7 +189,7 @@ public class MiniatureS extends PluginBase {
* 存储自定义界面的数据
*/
public LinkedHashMap<String, CustomData> Custom;
public LinkedHashMap<String, Boolean> MakeFormTime = new LinkedHashMap<>();
public LinkedHashMap<String, SBPlayerData> MakeFormTime = new LinkedHashMap<>();

/**
* 明人不说暗话!这就是插件启动事件
Expand Down Expand Up @@ -247,12 +249,12 @@ public void onLoad() {
try {
file = new File(this.getDataFolder(), ConfigNameList[i]);
if (!file.exists()) {
this.getServer().getLogger().info(TextFormat.RED + "初始化资源:" + TextFormat.GREEN + ConfigNameList[i]);
this.getServer().getLogger().info("§6初始化资源:§c" + ConfigNameList[i]);
Utils.writeFile(file, this.getClass().getResourceAsStream("/resources/" + ConfigNameList[i]));
}
} catch (IOException e) {
this.getServer().getLogger().info(TextFormat.RED + "资源:" + TextFormat.GREEN + ConfigNameList[i]
+ TextFormat.RED + "加载错误\n" + TextFormat.WHITE + "错误详情:" + e.getMessage());
this.getServer().getLogger()
.info("§4资源:§6" + ConfigNameList[i] + "§4加载错误\n" + "§f错误详情:" + e.getMessage());
this.getServer().getPluginManager().disablePlugin(this);
}
ReloadConfig.start();
Expand Down Expand Up @@ -281,6 +283,14 @@ public void onLoad() {
AdminCommand = new AdminCommand(this);
Custom = new LinkedHashMap<>();
EfficacyConfig.startPY();
if (config.getBoolean("检测更新"))
(new Update(this)).start();
file = new File(getDataFolder(), "MiniatureS自定义控件介绍.docx");
try {
Utils.writeFile(file, mis.getClass().getResourceAsStream("/resources/MiniatureS自定义控件介绍.docx"));
getLogger().info("§6帮助文件已导出至§4" + file.getName());
} catch (IOException e) {
}
super.onLoad();
}

Expand Down
71 changes: 21 additions & 50 deletions MiniatureS/src/cn/xiaokai/mis/cmd/MainCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@

import cn.nukkit.Player;
import cn.nukkit.command.CommandSender;
import cn.nukkit.inventory.Inventory;
import cn.nukkit.item.Item;
import cn.nukkit.item.enchantment.Enchantment;
import cn.nukkit.utils.Config;
import cn.nukkit.utils.TextFormat;
import cn.xiaokai.mis.MiniatureS;
import cn.xiaokai.mis.event.yousb.FFFSB;
import cn.xiaokai.mis.form.openbt.MakeWindow;
import cn.xiaokai.mis.form.openbt.OpenButton;
import cn.xiaokai.mis.tool.Tool;

/**
* @author Winfxk
Expand All @@ -36,34 +33,12 @@ public MainCommand(MiniatureS mis) {
* @return
*/
public boolean onCommand(CommandSender player, String label, String[] a) {
if (a.length < 1 || a[0].toLowerCase().equals("get") || a[0].toLowerCase().equals("获取")) {
if (a.length < 1 || a[0].toLowerCase().equals("get")) {
if (player.isPlayer()) {
String makeTool = mis.config.getString("快捷工具", null);
if (makeTool != null && !makeTool.equals("")) {
Inventory inventory = ((Player) player).getInventory();
Map<Integer, Item> map = inventory.getContents();
Item item;
boolean Mate = false;
for (int site : map.keySet()) {
item = map.get(site);
if (Mate = Tool.isMateID(item.getId() + ":" + item.getDamage(), makeTool))
break;
}
if (!Mate) {
int[] ID = Tool.IDtoFullID(makeTool);
item = new Item(ID[0], ID[1]);
item.addEnchantment(Enchantment.get(Enchantment.ID_SILK_TOUCH));
item.setCustomName(
mis.getMessage().getMessage("快捷工具名称", new String[] { "{Player}", "{Server_Name}" },
new String[] { player.getName(), mis.getServer().getMotd() }));
item.setLore(
mis.getMessage().getMessage("快捷工具名称2", new String[] { "{Player}", "{Server_Name}" },
new String[] { player.getName(), mis.getServer().getMotd() }));
inventory.addItem(item);
player.sendMessage(
mis.getMessage().getMessage("进服给快捷工具", new String[] { "{Player}", "{Server_Name}" },
new String[] { player.getName(), mis.getServer().getMotd() }));
}
if (makeTool != null && !makeTool.isEmpty()) {
FFFSB sb = new FFFSB((Player) player);
sb.getMis();
}
mis.makeForm.makeMain((Player) player);
} else
Expand All @@ -89,26 +64,22 @@ public boolean onCommand(CommandSender player, String label, String[] a) {
(new MakeWindow((Player) player, fxFile)).MakeForm();
else
player.sendMessage(mis.getMessage().getSon("Main", "SBPlayerFileNot"));
} else {
if (fxFile.exists()) {
try {
Config config = new Config(fxFile, Config.YAML);
if (config.get("Buttons") instanceof Map) {
HashMap<String, Object> map = (HashMap<String, Object>) config.get("Buttons");
if (map.containsKey(a[2])) {
(new OpenButton((Player) player, (HashMap<String, Object>) map.get(a[2]))).Switch();
} else {
player.sendMessage(mis.getMessage().getSon("Main", "NotIsButtons"));
}
} else {
player.sendMessage(mis.getMessage().getSon("Main", "NotButtons"));
}
} catch (Exception e) {
player.sendMessage(mis.getMessage().getSon("Main", "SBOPFileError"));
}
} else
player.sendMessage(mis.getMessage().getSon("Main", "SBPlayerFileNot"));
}
} else if (fxFile.exists()) {
try {
Config config = new Config(fxFile, Config.YAML);
if (config.get("Buttons") instanceof Map) {
HashMap<String, Object> map = (HashMap<String, Object>) config.get("Buttons");
if (map.containsKey(a[2])) {
(new OpenButton((Player) player, (HashMap<String, Object>) map.get(a[2]))).Switch();
} else
player.sendMessage(mis.getMessage().getSon("Main", "NotIsButtons"));
} else
player.sendMessage(mis.getMessage().getSon("Main", "NotButtons"));
} catch (Exception e) {
player.sendMessage(mis.getMessage().getSon("Main", "SBOPFileError"));
}
} else
player.sendMessage(mis.getMessage().getSon("Main", "SBPlayerFileNot"));
return true;
case "help":
default:
Expand Down
Loading

0 comments on commit 5657487

Please sign in to comment.