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

添加overlay选项

This commit is contained in:
XiaoMoMi
2025-12-19 03:44:52 +08:00
parent b001b93e72
commit 6e2241f01e
2 changed files with 11 additions and 2 deletions

View File

@@ -146,11 +146,14 @@ resource-pack:
obfuscation: obfuscation:
enable: false enable: false
seed: 0 # 0 = random seed seed: 0 # 0 = random seed
# Determines the number and length of obfuscated namespaces. # Determines the length of obfuscated overlay directories
overlay:
length: 4 # 0 = disable
# Determines the number and length of obfuscated namespaces
namespace: namespace:
amount: 32 # 0 = disable amount: 32 # 0 = disable
length: 2 length: 2
# Determines the depth of the obfuscated path. # Determines the depth and length of the obfuscated path
path: path:
depth: 4 depth: 4
length: 2 length: 2

View File

@@ -90,6 +90,7 @@ public class Config {
protected boolean resource_pack$protection$obfuscation$path$anti_unzip; protected boolean resource_pack$protection$obfuscation$path$anti_unzip;
protected boolean resource_pack$protection$incorrect_crc; protected boolean resource_pack$protection$incorrect_crc;
protected boolean resource_pack$protection$fake_file_size; protected boolean resource_pack$protection$fake_file_size;
protected NumberProvider resource_pack$protection$obfuscation$overlay$length;
protected NumberProvider resource_pack$protection$obfuscation$namespace$length; protected NumberProvider resource_pack$protection$obfuscation$namespace$length;
protected int resource_pack$protection$obfuscation$namespace$amount; protected int resource_pack$protection$obfuscation$namespace$amount;
protected String resource_pack$protection$obfuscation$path$block_source; protected String resource_pack$protection$obfuscation$path$block_source;
@@ -368,6 +369,7 @@ public class Config {
resource_pack$protection$fake_file_size = config.getBoolean("resource-pack.protection.fake-file-size", false); resource_pack$protection$fake_file_size = config.getBoolean("resource-pack.protection.fake-file-size", false);
resource_pack$protection$obfuscation$namespace$amount = config.getInt("resource-pack.protection.obfuscation.namespace.amount", 32); resource_pack$protection$obfuscation$namespace$amount = config.getInt("resource-pack.protection.obfuscation.namespace.amount", 32);
resource_pack$protection$obfuscation$namespace$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.namespace.length", 2)); resource_pack$protection$obfuscation$namespace$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.namespace.length", 2));
resource_pack$protection$obfuscation$overlay$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.overlay.length", 4));
resource_pack$protection$obfuscation$path$depth = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.depth", 4)); resource_pack$protection$obfuscation$path$depth = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.depth", 4));
resource_pack$protection$obfuscation$path$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.length", 2)); resource_pack$protection$obfuscation$path$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.length", 2));
resource_pack$protection$obfuscation$path$block_source = config.getString("resource-pack.protection.obfuscation.path.block-source", "obf_block"); resource_pack$protection$obfuscation$path$block_source = config.getString("resource-pack.protection.obfuscation.path.block-source", "obf_block");
@@ -890,6 +892,10 @@ public class Config {
return instance.resource_pack$protection$obfuscation$path$length; return instance.resource_pack$protection$obfuscation$path$length;
} }
public static NumberProvider overlayLength() {
return instance.resource_pack$protection$obfuscation$overlay$length;
}
public static boolean antiUnzip() { public static boolean antiUnzip() {
return instance.resource_pack$protection$obfuscation$path$anti_unzip; return instance.resource_pack$protection$obfuscation$path$anti_unzip;
} }