Skip to content

Commit

Permalink
Release 6.0.5
Browse files Browse the repository at this point in the history
## UltiTools-API
1. 添加了 UltiToolsModule 注解,整合了一些相关注解,简化了模块开发。
2. WorldLocation 添加了 toLocation 方法
3. 添加了自动下载PAPI变量的功能
4. 添加了临时监听事件的 API
5. 添加了模块的版本判断,再也不会出现不同版本的同一个模块注册多次的问题
6. 添加了 CmdExecutor 和 EventListener 注解的Bean支持
7. 现在继承或实现服务端类或接口的类可被注册为Bean
8. 添加了 AbstractCommendExecutor 对不定参数的支持
9. 自动注册添加了手动注册命令和监听器的开关
10. 添加了Metrics
11. 重构了 CommandManager 以便更好地对模块指令进行管理
12. 简化了插件重载方法
13. 添加了自动下载PAPI模块的功能
14. UltiTools添加了获取Economy的方法
15. 优化了UltiTools版本获取方法
16. 修复了GUI组件无法翻页的问题
17. 修改了 DataStoreManager 中的卸载提示文本
18. 修复了 AbstractCommendExecutor 处理参数时报错的问题
19. 修复了外部插件无法正常注册Bean的问题
20. 修改了部分文本

## Basic-Function
1. 添加了Warp功能
2. 添加了Spawn和setspawn命令
3. 添加了lore命令,可以快捷修改手持物品的lore,可使用&颜色符号
4. 添加了Hide隐身功能
5. 添加了头顶+tab显示功能
6. 修复了隐身的文本提示问题
7. 添加了死亡惩罚功能
8. Warp添加了对BlueMap的支持
9. 升级到UltiTools-API 6.0.5版本

## Economy
1. 修改了插件描述

## MysqlConnector
1. 修改了插件描述

## Sidebar
1. 修改了插件描述
2. 添加了开关侧边栏的命令
3. 修复了玩家被踢会导致papi报错的问题
4. 升级到UltiTools-API 6.0.5版本

## UltiTools-Home
1. 修改了插件描述
2. 修复了GUI中家顺序混乱的问题
3. 修复了GUI超出会报错的问题
4. 升级到UltiTools-API 6.0.5版本
  • Loading branch information
wisdommen authored Jan 16, 2024
2 parents 53cd95e + 64821e1 commit a29a55b
Show file tree
Hide file tree
Showing 88 changed files with 3,021 additions and 741 deletions.
24 changes: 20 additions & 4 deletions BasicFunctions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ultikits.plugins</groupId>
<artifactId>BasicFunctions</artifactId>
<version>1.0.0</version>
<version>1.0.4</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>com.ultikits</groupId>
<artifactId>UltiTools-API</artifactId>
<version>6.0.3</version>
<version>6.0.5</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -45,9 +45,25 @@
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.nametagedit</groupId>
<artifactId>nametagedit</artifactId>
<version>4.4.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.BlueMap-Minecraft</groupId>
<artifactId>BlueMapAPI</artifactId>
<version>v2.6.2</version>
<scope>provided</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>upstream</id>
<url>https://ci.nametagedit.com/plugin/repository/everything/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
Expand Down Expand Up @@ -76,9 +92,9 @@
<configuration>
<name>BasicFunctions</name>
<identifyString>UltiTools-Basic-Functions</identifyString>
<shortDescription>All basic functions of the UltiTools</shortDescription>
<shortDescription>开服必装!所有的杂七杂八的小功能哦!包括不限于TPA,飞行,模式更改,白名单,随机传送。</shortDescription>
<accessKeyFile>access_key.txt</accessKeyFile>
<pluginFolder>F:\SpigotServers\Servers\1.20.4\plugins\UltiTools\plugins</pluginFolder>
<pluginFolder>F:\SpigotServers\Paper\1.20.4\plugins\UltiTools\plugins</pluginFolder>
</configuration>
</plugin>
</plugins>
Expand Down
104 changes: 56 additions & 48 deletions BasicFunctions/src/main/java/com/ultikits/plugins/BasicFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@
import com.ultikits.plugins.commands.*;
import com.ultikits.plugins.config.BasicConfig;
import com.ultikits.plugins.config.JoinWelcomeConfig;
import com.ultikits.plugins.listeners.BackListener;
import com.ultikits.plugins.listeners.BanListener;
import com.ultikits.plugins.listeners.JoinWelcomeListener;
import com.ultikits.plugins.listeners.WhitelistListener;
import com.ultikits.plugins.config.PlayerNameTagConfig;
import com.ultikits.plugins.config.WarpConfig;
import com.ultikits.plugins.listeners.*;
import com.ultikits.plugins.services.WarpService;
import com.ultikits.plugins.tasks.NamePrefixSuffixTask;
import com.ultikits.ultitools.UltiTools;
import com.ultikits.ultitools.abstracts.AbstractConfigEntity;
import com.ultikits.ultitools.abstracts.UltiToolsPlugin;
//import com.ultikits.ultitools.annotations.ContextEntry;
//import com.ultikits.ultitools.annotations.EnableAutoRegister;
import com.ultikits.ultitools.annotations.UltiToolsModule;
import de.bluecolored.bluemap.api.BlueMapAPI;
import lombok.Getter;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

//@EnableAutoRegister(
// scanPackage = "com.ultikits.plugins",
// eventListener = false,
// cmdExecutor = false
//)
@UltiToolsModule
public class BasicFunctions extends UltiToolsPlugin {
@Getter
private static BasicFunctions instance;
Expand All @@ -32,74 +29,85 @@ public BasicFunctions() {
}

@Override
public boolean registerSelf() throws IOException {
public boolean registerSelf() {
BasicConfig configEntity = getConfigManager().getConfigEntity(this, BasicConfig.class);
if (configEntity.isEnableHeal()) {
getCommandManager().register(new HealCommand(), "ultikits.tools.command.heal", i18n("指令治愈功能"), "heal", "h");
getCommandManager().register(this, HideCommands.class);
}
if (configEntity.isEnableGmChange()) {
getCommandManager().register(new GMChangeCommand(), "ultikits.tools.command.gm", i18n("游戏模式切换功能"), "gm");
getCommandManager().register(this, GMChangeCommand.class);
}
if (configEntity.isEnableBack()) {
getCommandManager().register(new BackCommands(), "ultikits.tools.command.back", i18n("快捷返回功能"), "back");
getListenerManager().register(this, new BackListener());
getCommandManager().register(this, BackCommands.class);
getListenerManager().register(this, BackListener.class);
}
if (configEntity.isEnableRandomTeleport()) {
getCommandManager().register(new RandomTpCommands(), "ultikits.tools.command.wild", i18n("随机传送功能"), "wild");
getCommandManager().register(this, RandomTpCommands.class);
}
if (configEntity.isEnableFly()) {
getCommandManager().register(new FlyCommands(), "ultikits.tools.command.fly", i18n("飞行功能"), "fly");
getCommandManager().register(this, FlyCommands.class);
}
if (configEntity.isEnableWhitelist()) {
getCommandManager().register(new WhitelistCommands(), "ultikits.tools.whitelist", i18n("白名单功能"), "wl");
getListenerManager().register(this, new WhitelistListener());
getCommandManager().register(this, WhitelistCommands.class);
getListenerManager().register(this, WhitelistListener.class);
}
if (configEntity.isEnableJoinWelcome()) {
getListenerManager().register(this, new JoinWelcomeListener());
getListenerManager().register(this, JoinWelcomeListener.class);
}
if (configEntity.isEnableTpa()) {
getCommandManager().register(new TpaCommands(), "ultikits.tools.command.tpa", i18n("传送请求功能"), "tpa");
getCommandManager().register(new TpaHereCommands(), "ultikits.tools.command.tphere", i18n("请求传送到此功能"), "tphere");
getCommandManager().register(this, TpaCommands.class);
getCommandManager().register(this, TpaHereCommands.class);
}
if (configEntity.isEnableSpeed()) {
getCommandManager().register(new SpeedCommands(), "ultikits.tools.command.speed", i18n("速度设置功能"), "speed");
getCommandManager().register(this, SpeedCommands.class);
}
if (configEntity.isEnableBan()) {
getCommandManager().register(new BanCommands(), "ultikits.tools.command.uban", i18n("封禁功能"), "uban");
getListenerManager().register(this, new BanListener());
getCommandManager().register(this, BanCommands.class);
getListenerManager().register(this, BanListener.class);
}
if (configEntity.isEnableWarp()) {
getCommandManager().register(this, WarpCommands.class);
WarpConfig warpConfig = getConfigManager().getConfigEntity(this, WarpConfig.class);
if (warpConfig.isEnableBlueMap()) {
BlueMapAPI.onEnable(api -> {
WarpService warpService = getContext().getBean(WarpService.class);
warpService.initBlueMap();
});
}
}
if (configEntity.isEnableSpawn()) {
getCommandManager().register(this, SpawnCommands.class);
getCommandManager().register(this, SetSpawnCommands.class);
}
if (configEntity.isEnableLoreEditor()) {
getCommandManager().register(this, LoreCommands.class);
}
if (configEntity.isEnableHide()) {
getCommandManager().register(this, HideCommands.class);
getListenerManager().register(this, HideListener.class);
}
if (configEntity.isEnableTitle()) {
getListenerManager().register(this, PlayerNameTagListener.class);
int updateInterval = getConfig(PlayerNameTagConfig.class).getUpdateInterval();
new NamePrefixSuffixTask().runTaskTimer(UltiTools.getInstance(), 0, updateInterval);
}
if (configEntity.isEnableDeathPunishment()) {
getListenerManager().register(this, DeathListener.class);
}
return true;
}

@Override
public void unregisterSelf() {
getCommandManager().unregister("heal");
getCommandManager().unregister("gm");
getCommandManager().unregister("back");
getCommandManager().unregister("wild");
getCommandManager().unregister("fly");
getCommandManager().unregister("wl");
getCommandManager().unregister("tpa");
getCommandManager().unregister("tphere");
getCommandManager().unregister("speed");
getListenerManager().unregisterAll(this);
}

@Override
public void reloadSelf() {
getConfigManager().reloadConfigs(this);
}

@Override
public List<String> supported() {
return super.supported();
return Arrays.asList("zh", "en");
}

@Override
public List<AbstractConfigEntity> getAllConfigs() {
return Arrays.asList(
new BasicConfig("config/config.yml"),
new JoinWelcomeConfig("config/join.yml")
new JoinWelcomeConfig("config/join.yml"),
new PlayerNameTagConfig("config/title.yml")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@

import com.ultikits.plugins.BasicFunctions;
import com.ultikits.plugins.listeners.BackListener;
import com.ultikits.ultitools.abstracts.AbstractPlayerCommandExecutor;
import com.ultikits.ultitools.abstracts.AbstractCommendExecutor;
import com.ultikits.ultitools.annotations.command.CmdExecutor;
import com.ultikits.ultitools.annotations.command.CmdMapping;
import com.ultikits.ultitools.annotations.command.CmdSender;
import com.ultikits.ultitools.annotations.command.CmdTarget;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import static com.ultikits.ultitools.utils.MessageUtils.warning;

public class BackCommands extends AbstractPlayerCommandExecutor {
@Override
protected boolean onPlayerCommand(Command command, String[] strings, Player player) {
@CmdTarget(CmdTarget.CmdTargetType.PLAYER)
@CmdExecutor(alias = {"back"}, manualRegister = true, permission = "ultikits.tools.command.back", description = "返回死亡地点")
public class BackCommands extends AbstractCommendExecutor {

@CmdMapping(format = "")
public void back(@CmdSender Player player) {
Location location = BackListener.getPlayerLastDeathLocation(player.getUniqueId());
if (location != null) {
player.teleport(location);
} else {
player.sendMessage(warning(BasicFunctions.getInstance().i18n("无法找到死亡地点!这可能是因为插件重载或者你还没死过哩。")));
}
return true;
}

@Override
protected void sendHelpMessage(CommandSender sender) {
protected void handleHelp(CommandSender sender) {
sender.sendMessage(BasicFunctions.getInstance().i18n("/back 返回死亡地点"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@


@CmdTarget(CmdTarget.CmdTargetType.BOTH)
@CmdExecutor(permission = "ultikits.ban.command.all", description = "Ban功能", alias = {"uban"})
@CmdExecutor(permission = "ultikits.ban.command.all", description = "封禁功能", alias = {"uban"}, manualRegister = true)
public class BanCommands extends AbstractCommendExecutor {
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Autowired
private BanPlayerService banPlayerService = new BanPlayerService();
private BanPlayerService banPlayerService;

@CmdMapping(format = "ban <player> <reason>")
public void banPlayer(@CmdSender CommandSender sender, @CmdParam("player") String player, @CmdParam("reason") String reason) {
Expand All @@ -36,6 +35,7 @@ public void unBanPlayer(@CmdSender CommandSender sender, @CmdParam("player") Str

@Override
protected void handleHelp(CommandSender sender) {

sender.sendMessage(BasicFunctions.getInstance().i18n("§c/uban ban <player> <reason> §7封禁玩家"));
sender.sendMessage(BasicFunctions.getInstance().i18n("§c/uban unban <player> §7解封玩家"));
}
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
package com.ultikits.plugins.commands;

import com.ultikits.plugins.BasicFunctions;
import com.ultikits.ultitools.abstracts.AbstractPlayerCommandExecutor;
import org.bukkit.command.Command;
import com.ultikits.ultitools.abstracts.AbstractCommendExecutor;
import com.ultikits.ultitools.annotations.command.CmdExecutor;
import com.ultikits.ultitools.annotations.command.CmdMapping;
import com.ultikits.ultitools.annotations.command.CmdSender;
import com.ultikits.ultitools.annotations.command.CmdTarget;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import static com.ultikits.ultitools.utils.MessageUtils.info;
import static com.ultikits.ultitools.utils.MessageUtils.warning;

public class FlyCommands extends AbstractPlayerCommandExecutor {
@CmdTarget(CmdTarget.CmdTargetType.PLAYER)
@CmdExecutor(alias = {"fly"}, manualRegister = true, permission = "ultikits.tools.command.fly", description = "飞行功能")
public class FlyCommands extends AbstractCommendExecutor {

@Override
protected boolean onPlayerCommand(Command command, String[] strings, Player player) {
if (!player.hasPermission("ultikits.tools.command.fly")) {
player.sendMessage(warning(BasicFunctions.getInstance().i18n("你没有权限使用此指令!")));
return true;
}
@CmdMapping(format = "")
public void fly(@CmdSender Player player) {
player.setAllowFlight(!player.getAllowFlight());
player.sendMessage(info(player.getAllowFlight() ?
BasicFunctions.getInstance().i18n("已打开飞行") :
BasicFunctions.getInstance().i18n("已关闭飞行")));
return true;
}

@Override
protected void sendHelpMessage(CommandSender sender) {
protected void handleHelp(CommandSender sender) {
sender.sendMessage(info(BasicFunctions.getInstance().i18n("用法:/fly")));
}
}
Loading

0 comments on commit a29a55b

Please sign in to comment.