mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-22 01:58:54 +00:00
异步发送商店信息 防止getOfflinePlayer卡服
This commit is contained in:
parent
43c6c7a0ef
commit
44ec03bd30
34
pom.xml
34
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.maxgamer</groupId>
|
<groupId>org.maxgamer</groupId>
|
||||||
<artifactId>QuickShop</artifactId>
|
<artifactId>QuickShop</artifactId>
|
||||||
<version>1.8.5</version>
|
<version>1.8.6</version>
|
||||||
<description>快捷商店重置版本...</description>
|
<description>快捷商店重置版本...</description>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.name}</finalName>
|
<finalName>${project.name}</finalName>
|
||||||
@ -52,18 +52,30 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
<ciManagement>
|
||||||
|
<system>Jenkins</system>
|
||||||
|
<url>http://ci.yumc.pw/job/${project.artifactId}/</url>
|
||||||
|
</ciManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<jenkins.url>http://hs.yumc.pw:8080</jenkins.url>
|
|
||||||
<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
|
<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
|
||||||
<update.description>&a全新版本 &c虚拟悬浮物(橙子提供 对 就是那个汉化COI的逗比)&e7老板修复逗比BUG...</update.description>
|
<update.description>&a全新版本 &c虚拟悬浮物(橙子提供 对 就是那个汉化COI的逗比)&e7老板修复逗比BUG...</update.description>
|
||||||
<update.changes>
|
<update.changes>
|
||||||
&b1.8.5 - &e我是打酱油的 我上个兄弟抽风 不能下载更新...;
|
&b1.8.6 - &c修复getOfflinePlayer导致的服务器卡顿(连不上MOJANG...);
|
||||||
&b1.8.4 - &c清理多余的监听事件,修复部分版本不兼容问题 支持1.9...;
|
&b1.8.4 - &7清理多余的监听事件,修复部分版本不兼容问题 支持1.9...;
|
||||||
&b1.8.3 - &c修复漏斗传输NPE错误...;
|
&b1.8.3 - &7修复漏斗传输NPE错误...;
|
||||||
&b1.8.2 - &c修复箱子的标题为Null是产生的报错...;
|
|
||||||
</update.changes>
|
</update.changes>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>spigot-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>yumc-repo</id>
|
||||||
|
<url>http://repo.yumc.pw/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jtb</id>
|
<id>jtb</id>
|
||||||
@ -71,16 +83,6 @@
|
|||||||
<url>http://repo.yumc.pw/content/repositories/yumcenter/</url>
|
<url>http://repo.yumc.pw/content/repositories/yumcenter/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>yumc-repo</id>
|
|
||||||
<url>${jenkins.url}/plugin/repository/everything/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>spigot-repo</id>
|
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
|
@ -172,37 +172,42 @@ public class MsgUtil {
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public static void sendShopInfo(final Player p, final Shop shop, final int stock) {
|
public static void sendShopInfo(final Player p, final Shop shop, final int stock) {
|
||||||
// Potentially faster with an array?
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
final ItemStack item = shop.getItem();
|
@Override
|
||||||
p.sendMessage("");
|
public void run() {
|
||||||
p.sendMessage("");
|
// Potentially faster with an array?
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+");
|
final ItemStack item = shop.getItem();
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.shop-information"));
|
p.sendMessage("");
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| "
|
p.sendMessage("");
|
||||||
+ MsgUtil.p("menu.owner", Bukkit.getOfflinePlayer(shop.getOwner()).getName() == null ? (shop.isUnlimited() ? "系统商店" : "未知") : Bukkit.getOfflinePlayer(shop.getOwner()).getName()));
|
p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+");
|
||||||
final String msg = ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.item", shop.getDataName());
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.shop-information"));
|
||||||
sendItemMessage(p, shop.getItem(), msg);
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.owner",
|
||||||
if (Util.isTool(item.getType())) {
|
Bukkit.getOfflinePlayer(shop.getOwner()).getName() == null ? (shop.isUnlimited() ? "系统商店" : "未知") : Bukkit.getOfflinePlayer(shop.getOwner()).getName()));
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.damage-percent-remaining", Util.getToolPercentage(item)));
|
final String msg = ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.item", shop.getDataName());
|
||||||
}
|
sendItemMessage(p, shop.getItem(), msg);
|
||||||
if (shop.isSelling()) {
|
if (Util.isTool(item.getType())) {
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.stock", "" + (stock == 10000 ? "无限" : stock)));
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.damage-percent-remaining", Util.getToolPercentage(item)));
|
||||||
} else {
|
}
|
||||||
final int space = shop.getRemainingSpace();
|
if (shop.isSelling()) {
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.space", "" + (space == 10000 ? "无限" : space)));
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.stock", "" + (stock == 10000 ? "无限" : stock)));
|
||||||
}
|
} else {
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.price-per", shop.getDataName(), Util.format(shop.getPrice())));
|
final int space = shop.getRemainingSpace();
|
||||||
if (shop.isBuying()) {
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.space", "" + (space == 10000 ? "无限" : space)));
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-buying"));
|
}
|
||||||
} else {
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.price-per", shop.getDataName(), Util.format(shop.getPrice())));
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-selling"));
|
if (shop.isBuying()) {
|
||||||
}
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-buying"));
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+");
|
} else {
|
||||||
if (shop.isSelling()) {
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-selling"));
|
||||||
p.sendMessage(MsgUtil.p("how-many-buy"));
|
}
|
||||||
} else {
|
p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+");
|
||||||
final int items = Util.countItems(p.getInventory(), shop.getItem());
|
if (shop.isSelling()) {
|
||||||
p.sendMessage(MsgUtil.p("how-many-sell", items));
|
p.sendMessage(MsgUtil.p("how-many-buy"));
|
||||||
}
|
} else {
|
||||||
|
final int items = Util.countItems(p.getInventory(), shop.getItem());
|
||||||
|
p.sendMessage(MsgUtil.p("how-many-sell", items));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ authors:
|
|||||||
softdepend:
|
softdepend:
|
||||||
- Vault
|
- Vault
|
||||||
- WowSuchCleaner
|
- WowSuchCleaner
|
||||||
website: ${jenkins.url}/job/${project.artifactId}/
|
website: ${ciManagement.url}
|
||||||
commands:
|
commands:
|
||||||
qs:
|
qs:
|
||||||
description: QuickShop 命令
|
description: QuickShop 命令
|
||||||
|
Loading…
Reference in New Issue
Block a user