9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-28 03:19:14 +00:00

refactor(core): 修改资源包的一些东西

This commit is contained in:
jhqwqmc
2025-05-06 15:42:59 +08:00
parent 066f42f1f4
commit 6fe8f31f7c
4 changed files with 0 additions and 14 deletions

View File

@@ -64,7 +64,6 @@ command.upload.failure.not_supported: "<red>Current hosting method '<arg:0>' doe
command.upload.on_progress: "<white>Started uploading progress. Check the console for more information.</white>"
command.send_resource_pack.success.single: "<white>Sent resource pack to <arg:0>.</white>"
command.send_resource_pack.success.multiple: "<white>Send resource packs to <arg:0> players.</white>"
command.resource_pack.generation_in_progress: "<yellow>Resource pack generation is already in progress. Please wait until it finishes.</yellow>"
warning.config.pack.duplicated_files: "</red>Duplicated files Found. Please resolve them through config.yml 'resource-pack.duplicated-files-handler' section.</red>"
warning.config.type.int: "<yellow>Issue found in file <arg:0> - Failed to load '<arg:1>': Cannot cast '<arg:2>' to integer type for option '<arg:3>'.</yellow>"
warning.config.type.float: "<yellow>Issue found in file <arg:0> - Failed to load '<arg:1>': Cannot cast '<arg:2>' to float type for option '<arg:3>'.</yellow>"

View File

@@ -64,7 +64,6 @@ command.upload.failure.not_supported: "<red>当前托管模式 '<arg:0>' 不支
command.upload.on_progress: "<white>已开始上传进程. 检查控制台以获取详细信息.</white>"
command.send_resource_pack.success.single: "<white>发送资源包给 <arg:0></white>"
command.send_resource_pack.success.multiple: "<white>发送资源包给 <arg:0> 个玩家</white>"
command.resource_pack.generation_in_progress: "<yellow>资源包正在生成中, 请等待完成再试</yellow>"
warning.config.pack.duplicated_files: "</red>发现重复文件 请通过 config.yml 的 'resource-pack.duplicated-files-handler' 部分解决</red>"
warning.config.type.int: "<yellow>在文件 <arg:0> 发现问题 - 无法加载 '<arg:1>': 无法将 '<arg:2>' 转换为整数类型 (选项 '<arg:3>')</yellow>"
warning.config.type.float: "<yellow>在文件 <arg:0> 发现问题 - 无法加载 '<arg:1>': 无法将 '<arg:2>' 转换为浮点数类型 (选项 '<arg:3>')</yellow>"

View File

@@ -69,9 +69,6 @@ public class ReloadCommand extends BukkitCommandFeature<CommandSender> {
long time2 = System.currentTimeMillis();
long packTime = time2 - time1;
handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_SUCCESS, Component.text(packTime));
} catch (LocalizedException e) {
handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_FAILURE);
plugin().logger().warn(e.getMessage());
} catch (Exception e) {
handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_FAILURE);
plugin().logger().warn("Failed to generate resource pack", e);
@@ -92,9 +89,6 @@ public class ReloadCommand extends BukkitCommandFeature<CommandSender> {
Component.text(reloadResult.syncTime()),
Component.text(packTime)
);
} catch (LocalizedException e) {
handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_FAILURE);
plugin().logger().warn(e.getMessage());
} finally {
RELOAD_PACK_FLAG = false;
}

View File

@@ -74,7 +74,6 @@ public abstract class AbstractPackManager implements PackManager {
private final TreeMap<ConfigSectionParser, List<CachedConfig>> cachedConfigs = new TreeMap<>();
protected BiConsumer<Path, Path> zipGenerator;
protected ResourcePackHost resourcePackHost;
private boolean generateResourcePack = false;
public AbstractPackManager(CraftEngine plugin, BiConsumer<Path, Path> eventDispatcher) {
this.plugin = plugin;
@@ -519,10 +518,6 @@ public abstract class AbstractPackManager implements PackManager {
@Override
public void generateResourcePack() {
if (this.generateResourcePack) {
throw new LocalizedException("command.resource_pack.generation_in_progress");
}
this.generateResourcePack = true;
this.plugin.logger().info("Generating resource pack...");
long start = System.currentTimeMillis();
// get the target location
@@ -584,7 +579,6 @@ public abstract class AbstractPackManager implements PackManager {
long end = System.currentTimeMillis();
this.plugin.logger().info("Finished generating resource pack in " + (end - start) + "ms");
this.eventDispatcher.accept(generatedPackPath, zipFile);
this.generateResourcePack = false;
}
private void generateParticle(Path generatedPackPath) {