mirror of
https://github.com/funkemunky/KauriV3.git
synced 2026-07-01 10:18:26 +00:00
Fixing stuffs
This commit is contained in:
@@ -17,8 +17,7 @@ public class CheckManager {
|
||||
private final Map<Class<? extends Check>, CheckSettings> checkSettings = new HashMap<>();
|
||||
public CheckManager() {
|
||||
synchronized (checkClasses) {
|
||||
for (WrappedClass aClass : ClassScanner.getClasses(CheckData.class,
|
||||
"dev.brighten.ac.check.impl")) {
|
||||
for (WrappedClass aClass : ClassScanner.getClasses(CheckData.class)) {
|
||||
addCheck(aClass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import dev.brighten.ac.utils.Tuple;
|
||||
import dev.brighten.ac.utils.msg.ChatBuilder;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import lombok.val;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.minecraft.server.v1_8_R3.PacketDataSerializer;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutCustomPayload;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutTitle;
|
||||
@@ -199,7 +200,7 @@ public class AnticheatCommand extends BaseCommand {
|
||||
Anticheat.INSTANCE.getScheduler().execute(() -> {
|
||||
|
||||
if(player == null) {
|
||||
sender.spigot().sendMessage(Messages.NULL_APLAYER);
|
||||
sender.sendMessage(TextComponent.toLegacyText(Messages.NULL_APLAYER));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ import lombok.Setter;
|
||||
import lombok.val;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutTransaction;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.*;
|
||||
@@ -109,11 +108,6 @@ public class APlayer {
|
||||
this.uuid = player.getUniqueId();
|
||||
this.playerConnection = MinecraftReflection.getPlayerConnection(player);
|
||||
|
||||
Object pluginManagerObj = gpmanager.invoke(null);
|
||||
|
||||
if(method.invoke(pluginManagerObj, "EnterpriseLoader")) {
|
||||
Plugin plugin = method2.invoke(pluginManagerObj, "EnterpriseLoader");
|
||||
}
|
||||
load();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,29 @@ public class ClassScanner {
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static Set<WrappedClass> getClasses(Class<? extends Annotation> annotationClass) {
|
||||
Map<String, byte[]> map = Anticheat.INSTANCE.getStuffs();
|
||||
Map<String, byte[]> loadedClasses = Anticheat.INSTANCE.getLoadedClasses();
|
||||
Set<WrappedClass> toReturn = new HashSet<>();
|
||||
|
||||
for (Map.Entry<String, byte[]> entry : map.entrySet()) {
|
||||
boolean hasAnnotation = findClass(new ByteArrayInputStream(entry.getValue()), annotationClass) != null;
|
||||
|
||||
if(hasAnnotation) {
|
||||
toReturn.add(Reflections.getClass(entry.getKey()));
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, byte[]> entry : loadedClasses.entrySet()) {
|
||||
boolean hasAnnotation = findClass(new ByteArrayInputStream(entry.getValue()), annotationClass) != null;
|
||||
|
||||
if(hasAnnotation) {
|
||||
toReturn.add(Reflections.getClass(entry.getKey()));
|
||||
}
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static Set<String> getNames() {
|
||||
Map<String, byte[]> map = Anticheat.INSTANCE.getStuffs();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user