mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
@@ -62,6 +62,8 @@ resource-pack:
|
|||||||
max: LATEST
|
max: LATEST
|
||||||
# Remove 1.21.5+ tinted_leaves particles
|
# Remove 1.21.5+ tinted_leaves particles
|
||||||
remove-tinted-leaves-particle: true
|
remove-tinted-leaves-particle: true
|
||||||
|
# Remove all shaders
|
||||||
|
remove-all-shaders: false
|
||||||
merge-external-folders:
|
merge-external-folders:
|
||||||
- ModelEngine/resource pack
|
- ModelEngine/resource pack
|
||||||
- BetterModel/build
|
- BetterModel/build
|
||||||
|
|||||||
@@ -615,6 +615,9 @@ public abstract class AbstractPackManager implements PackManager {
|
|||||||
this.generateClientLang(generatedPackPath);
|
this.generateClientLang(generatedPackPath);
|
||||||
this.generateEquipments(generatedPackPath);
|
this.generateEquipments(generatedPackPath);
|
||||||
this.generateParticle(generatedPackPath);
|
this.generateParticle(generatedPackPath);
|
||||||
|
if (Config.removeAllShaders()) {
|
||||||
|
this.removeAllShaders(generatedPackPath);
|
||||||
|
}
|
||||||
if (Config.validateResourcePack()) {
|
if (Config.validateResourcePack()) {
|
||||||
this.validateResourcePack(generatedPackPath);
|
this.validateResourcePack(generatedPackPath);
|
||||||
}
|
}
|
||||||
@@ -631,6 +634,24 @@ public abstract class AbstractPackManager implements PackManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeAllShaders(Path path) {
|
||||||
|
List<Path> rootPaths;
|
||||||
|
try {
|
||||||
|
rootPaths = FileUtils.collectOverlays(path);
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.logger().warn("Failed to collect overlays for " + path.toAbsolutePath(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (Path rootPath : rootPaths) {
|
||||||
|
Path shadersPath = rootPath.resolve("assets/minecraft/shaders");
|
||||||
|
try {
|
||||||
|
FileUtils.deleteDirectory(shadersPath);
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.logger().warn("Failed to delete shaders directory for " + shadersPath.toAbsolutePath(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("DuplicatedCode")
|
@SuppressWarnings("DuplicatedCode")
|
||||||
private void validateResourcePack(Path path) {
|
private void validateResourcePack(Path path) {
|
||||||
List<Path> rootPaths;
|
List<Path> rootPaths;
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public class Config {
|
|||||||
protected boolean resource_pack$protection$crash_tools$method_3;
|
protected boolean resource_pack$protection$crash_tools$method_3;
|
||||||
|
|
||||||
protected boolean resource_pack$validate$enable;
|
protected boolean resource_pack$validate$enable;
|
||||||
|
protected boolean resource_pack$remove_all_shaders;
|
||||||
|
|
||||||
protected boolean resource_pack$protection$obfuscation$enable;
|
protected boolean resource_pack$protection$obfuscation$enable;
|
||||||
protected long resource_pack$protection$obfuscation$seed;
|
protected long resource_pack$protection$obfuscation$seed;
|
||||||
@@ -262,6 +263,7 @@ public class Config {
|
|||||||
resource_pack$protection$obfuscation$resource_location$bypass_sounds = config.getStringList("resource-pack.protection.obfuscation.resource-location.bypass-sounds");
|
resource_pack$protection$obfuscation$resource_location$bypass_sounds = config.getStringList("resource-pack.protection.obfuscation.resource-location.bypass-sounds");
|
||||||
resource_pack$protection$obfuscation$resource_location$bypass_equipments = config.getStringList("resource-pack.protection.obfuscation.resource-location.bypass-equipments");
|
resource_pack$protection$obfuscation$resource_location$bypass_equipments = config.getStringList("resource-pack.protection.obfuscation.resource-location.bypass-equipments");
|
||||||
resource_pack$validate$enable = config.getBoolean("resource-pack.validate.enable", true);
|
resource_pack$validate$enable = config.getBoolean("resource-pack.validate.enable", true);
|
||||||
|
resource_pack$remove_all_shaders = config.getBoolean("resource-pack.remove-all-shaders", false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resource_pack$duplicated_files_handler = config.getMapList("resource-pack.duplicated-files-handler").stream().map(it -> {
|
resource_pack$duplicated_files_handler = config.getMapList("resource-pack.duplicated-files-handler").stream().map(it -> {
|
||||||
@@ -736,6 +738,10 @@ public class Config {
|
|||||||
return instance.resource_pack$validate$enable;
|
return instance.resource_pack$validate$enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean removeAllShaders() {
|
||||||
|
return instance.resource_pack$remove_all_shaders;
|
||||||
|
}
|
||||||
|
|
||||||
public YamlDocument loadOrCreateYamlData(String fileName) {
|
public YamlDocument loadOrCreateYamlData(String fileName) {
|
||||||
Path path = this.plugin.dataFolderPath().resolve(fileName);
|
Path path = this.plugin.dataFolderPath().resolve(fileName);
|
||||||
if (!Files.exists(path)) {
|
if (!Files.exists(path)) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# Project settings
|
# Project settings
|
||||||
# Rule: [major update].[feature update].[bug fix]
|
# Rule: [major update].[feature update].[bug fix]
|
||||||
project_version=0.0.57.6
|
project_version=0.0.57.6
|
||||||
config_version=37
|
config_version=38
|
||||||
lang_version=19
|
lang_version=19
|
||||||
project_group=net.momirealms
|
project_group=net.momirealms
|
||||||
latest_supported_version=1.21.6
|
latest_supported_version=1.21.6
|
||||||
|
|||||||
Reference in New Issue
Block a user