mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 06:28:52 +00:00
Started working on KillAura check
This commit is contained in:
1 parent
804b5ea944
commit
e37a6b8764
9 files changed
+146
-6
No files matched your search
@@ -0,0 +1,13 @@
|
||||
package net.gravitydevelopment.anticheat.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CheckerNPCS {
|
||||
|
||||
private List<NPC_1_9_R1> ONE_DOT_NINE_NPCS = new ArrayList<NPC_1_9_R1>();
|
||||
private List<NPC_1_8_R3> ONE_DOT_EIGHT_NPCS = new ArrayList<NPC_1_8_R3>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.gravitydevelopment.anticheat.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
|
||||
import net.minecraft.server.v1_8_R3.PlayerInteractManager;
|
||||
|
||||
public class NPC_1_8_R3 {
|
||||
|
||||
private final EntityPlayer npc;
|
||||
|
||||
public NPC_1_8_R3(String name, World w, Player owner) {
|
||||
this.npc = new EntityPlayer(((CraftServer) Bukkit.getServer()).getServer(), ((CraftWorld) w).getHandle(), new GameProfile(UUID.randomUUID(), name), new PlayerInteractManager(((CraftWorld) w).getHandle()));
|
||||
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{this.npc}));
|
||||
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutNamedEntitySpawn(this.npc));
|
||||
}
|
||||
|
||||
public void teleport(Location loc) {
|
||||
this.npc.teleportTo(loc, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.gravitydevelopment.anticheat.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.server.v1_9_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_9_R1.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_9_R1.PacketPlayOutPlayerInfo;
|
||||
import net.minecraft.server.v1_9_R1.PlayerInteractManager;
|
||||
|
||||
public class NPC_1_9_R1 {
|
||||
|
||||
private final EntityPlayer npc;
|
||||
|
||||
public NPC_1_9_R1(String name, World w, Player owner) {
|
||||
this.npc = new EntityPlayer(((CraftServer) Bukkit.getServer()).getServer(), ((CraftWorld) w).getHandle(), new GameProfile(UUID.randomUUID(), name), new PlayerInteractManager(((CraftWorld) w).getHandle()));
|
||||
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{this.npc}));
|
||||
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutNamedEntitySpawn(this.npc));
|
||||
}
|
||||
|
||||
public void teleport(Location loc) {
|
||||
this.npc.teleportTo(loc, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,6 +120,7 @@ public class PastebinReport {
|
||||
append("Server Version: " + Bukkit.getVersion());
|
||||
append("Server Implementation: " + Bukkit.getName());
|
||||
append("Server ID: " + Bukkit.getServerId());
|
||||
append("NMS Version: " + VersionUtil.getVersion());
|
||||
append("Java Version: " + System.getProperty("java.vendor") + " " + System.getProperty("java.version"));
|
||||
append("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
|
||||
append("Free Memory: " + runtime.freeMemory() / 1024 / 1024 + "MB");
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.gravitydevelopment.anticheat.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class VersionUtil {
|
||||
|
||||
public static String getVersion() {
|
||||
String version = "";
|
||||
try {
|
||||
version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
||||
} catch (ArrayIndexOutOfBoundsException whatVersionAreYouUsingException) {}
|
||||
return version;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user