mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
Merge branch 'Xiao-MoMi:dev' into dev
This commit is contained in:
@@ -88,7 +88,7 @@ public class HideTooltipModifier<I> implements ItemDataModifier<I> {
|
||||
}
|
||||
|
||||
public List<Key> components() {
|
||||
return components;
|
||||
return this.components;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -667,6 +667,10 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
this.plugin.logger().info("Validated resource pack in " + (time3 - time2) + "ms");
|
||||
Path finalPath = resourcePackPath();
|
||||
Files.createDirectories(finalPath.getParent());
|
||||
if (!VersionHelper.PREMIUM) {
|
||||
Config.instance().setObf(false);
|
||||
this.plugin.logger().warn("Resource pack obfuscation requires Premium Edition.");
|
||||
}
|
||||
try {
|
||||
this.zipGenerator.accept(generatedPackPath, finalPath);
|
||||
} catch (Exception e) {
|
||||
@@ -1551,15 +1555,24 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
|
||||
private void generateClientLang(Path generatedPackPath) {
|
||||
for (Map.Entry<String, I18NData> entry : this.plugin.translationManager().clientLangData().entrySet()) {
|
||||
JsonObject json = new JsonObject();
|
||||
for (Map.Entry<String, String> pair : entry.getValue().translations.entrySet()) {
|
||||
json.addProperty(pair.getKey(), pair.getValue());
|
||||
}
|
||||
Path langPath = generatedPackPath
|
||||
.resolve("assets")
|
||||
.resolve("minecraft")
|
||||
.resolve("lang")
|
||||
.resolve(entry.getKey() + ".json");
|
||||
JsonObject json;
|
||||
if (Files.exists(langPath)) {
|
||||
try {
|
||||
json = GsonHelper.readJsonFile(langPath).getAsJsonObject();
|
||||
} catch (Exception e) {
|
||||
json = new JsonObject();
|
||||
}
|
||||
} else {
|
||||
json = new JsonObject();
|
||||
}
|
||||
for (Map.Entry<String, String> pair : entry.getValue().translations.entrySet()) {
|
||||
json.addProperty(pair.getKey(), pair.getValue());
|
||||
}
|
||||
try {
|
||||
Files.createDirectories(langPath.getParent());
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -20,10 +20,7 @@ import net.momirealms.craftengine.core.plugin.PluginProperties;
|
||||
import net.momirealms.craftengine.core.plugin.locale.LocalizedResourceConfigException;
|
||||
import net.momirealms.craftengine.core.plugin.locale.TranslationManager;
|
||||
import net.momirealms.craftengine.core.plugin.logger.filter.DisconnectLogFilter;
|
||||
import net.momirealms.craftengine.core.util.AdventureHelper;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.MinecraftVersion;
|
||||
import net.momirealms.craftengine.core.util.MiscUtils;
|
||||
import net.momirealms.craftengine.core.util.*;
|
||||
import net.momirealms.craftengine.core.world.InjectionTarget;
|
||||
import net.momirealms.craftengine.core.world.chunk.storage.CompressionMethod;
|
||||
|
||||
@@ -832,6 +829,10 @@ public class Config {
|
||||
return instance.recipe$ingredient_sources;
|
||||
}
|
||||
|
||||
public void setObf(boolean enable) {
|
||||
this.resource_pack$protection$obfuscation$enable = enable;
|
||||
}
|
||||
|
||||
public YamlDocument loadOrCreateYamlData(String fileName) {
|
||||
Path path = this.plugin.dataFolderPath().resolve(fileName);
|
||||
if (!Files.exists(path)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class VersionHelper {
|
||||
public static final boolean PREMIUM = true;
|
||||
public static final MinecraftVersion MINECRAFT_VERSION;
|
||||
private static final int version;
|
||||
private static final int majorVersion;
|
||||
|
||||
@@ -40,7 +40,7 @@ commons_io_version=2.18.0
|
||||
commons_imaging_version=1.0.0-alpha6
|
||||
commons_lang3_version=3.17.0
|
||||
sparrow_nbt_version=0.9.4
|
||||
sparrow_util_version=0.50.6
|
||||
sparrow_util_version=0.50.7
|
||||
fastutil_version=8.5.15
|
||||
netty_version=4.1.121.Final
|
||||
joml_version=1.10.8
|
||||
|
||||
Reference in New Issue
Block a user