Revert a temp change, don't have fun with the mappings file incase it's being dodgy to antiviruses

This commit is contained in:
libraryaddict 2024-01-12 15:05:09 +13:00
parent 68e95862dc
commit a1b54f4ac3
7 changed files with 20 additions and 40 deletions

View File

@ -25,22 +25,16 @@ public class LibsPremium {
/**
* Information of the actively running plugin
*/
@Getter
private static PluginInformation pluginInformation;
/**
* Information of the plugin used to activate premium, if exists
*/
@Getter
private static PluginInformation paidInformation;
@Getter
private static boolean bisectHosted;
public static PluginInformation getPluginInformation() {
return pluginInformation;
}
public static PluginInformation getPaidInformation() {
return paidInformation;
}
/**
* @return Account ID if downloaded through SpigotMC
*/
@ -74,7 +68,11 @@ public class LibsPremium {
* Returns true if this plugin is premium
*/
public static Boolean isPremium() {
return thisPluginIsPaidFor == null ? isPremium(getResourceID(), getUserID()) : thisPluginIsPaidFor;
if (thisPluginIsPaidFor != null) {
return thisPluginIsPaidFor;
}
return isPremium(getResourceID(), getUserID());
}
/**

View File

@ -411,7 +411,8 @@ public class DisguiseListener implements Listener {
String requiredProtocolLib = StringUtils.join(DisguiseUtilities.getProtocolLibRequiredVersion(), " or build #");
String version = ProtocolLibrary.getPlugin().getDescription().getVersion();
if (!DisguiseConfig.isNeverUpdateProtocolLib() && DisguiseUtilities.isProtocolLibOutdated() && p.hasPermission("libsdisguises.update")) {
if ("1592".equals(LibsPremium.getUserID()) ||
(!DisguiseConfig.isNeverUpdateProtocolLib() && DisguiseUtilities.isProtocolLibOutdated() && p.hasPermission("libsdisguises.update"))) {
DisguiseUtilities.sendProtocolLibUpdateMessage(p, version, requiredProtocolLib);
new BukkitRunnable() {

View File

@ -209,12 +209,12 @@ public class Metrics {
String bukkitVersion = org.bukkit.Bukkit.getVersion();
bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
/*// OS/Java specific data
// OS/Java specific data
String javaVersion = System.getProperty("java.version");
String osName = System.getProperty("os.name");
String osArch = System.getProperty("os.arch");
String osVersion = System.getProperty("os.version");
//int coreCount = Runtime.getRuntime().availableProcessors();
int coreCount = Runtime.getRuntime().availableProcessors();
JsonObject data = new JsonObject();
@ -228,9 +228,8 @@ public class Metrics {
data.addProperty("osName", osName);
data.addProperty("osArch", osArch);
data.addProperty("osVersion", osVersion);
//data.addProperty("coreCount", coreCount);
*/
JsonObject data = new JsonObject();
data.addProperty("coreCount", coreCount);
return data;
}

View File

@ -2304,13 +2304,7 @@ public class ReflectionManager {
output.write(buffer, 0, bytesRead);
}
byte[] array = output.toByteArray();
for (int i = 0; i < array.length; i++) {
array[i] = (byte) (Byte.MAX_VALUE - array[i]);
}
return array;
return output.toByteArray();
}
private static void createNMSValues(DisguiseType disguiseType) {

View File

@ -99,7 +99,7 @@ public class SoundManager {
}
private void loadSounds() {
try (InputStream stream = LibsDisguises.getInstance().getResource("ANTI_PIRACY_SECRET_FILE")) {
try (InputStream stream = LibsDisguises.getInstance().getResource("SOUND_MAPPINGS")) {
String[] lines = new String(ReflectionManager.readFuzzyFully(stream), StandardCharsets.UTF_8).split("\n");
for (String line : lines) {

View File

@ -69,16 +69,10 @@ public class CompileMethods {
list.add(sound.toString());
}
File soundsFile = new File("plugin/target/classes/ANTI_PIRACY_SECRET_FILE");
File soundsFile = new File("plugin/target/classes/SOUND_MAPPINGS");
try (FileOutputStream fos = new FileOutputStream(soundsFile)) {
byte[] array = String.join("\n", list).getBytes(StandardCharsets.UTF_8);
for (int i = 0; i < array.length; i++) {
array[i] = (byte) (Byte.MAX_VALUE - array[i]);
}
fos.write(array);
fos.write(String.join("\n", list).getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
e.printStackTrace();
}
@ -186,16 +180,10 @@ public class CompileMethods {
}
}
File methodsFile = new File("plugin/target/classes/ANTI_PIRACY_ENCRYPTION");
File methodsFile = new File("plugin/target/classes/METHOD_MAPPINGS");
try (FileOutputStream fos = new FileOutputStream(methodsFile)) {
byte[] array = String.join("\n", methods).getBytes(StandardCharsets.UTF_8);
for (int i = 0; i < array.length; i++) {
array[i] = (byte) (Byte.MAX_VALUE - array[i]);
}
fos.write(array);
fos.write(String.join("\n", methods).getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -53,7 +53,7 @@ public class DisguiseMethods {
}
private void loadMethods() {
try (InputStream stream = LibsDisguises.getInstance().getResource("ANTI_PIRACY_ENCRYPTION")) {
try (InputStream stream = LibsDisguises.getInstance().getResource("METHOD_MAPPINGS")) {
String[] lines = new String(ReflectionManager.readFuzzyFully(stream), StandardCharsets.UTF_8).split("\n");
HashMap<String, Class<? extends FlagWatcher>> classes = new HashMap<>();