mirror of
https://github.com/Cubicake/RaycastedAntiESP.git
synced 2026-11-17 14:29:40 -05:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33fddbdbf | ||
|
|
f4f4e64670 | ||
|
|
aaee14e4f2 | ||
|
|
791ab79f54 | ||
|
|
af3b5f166d | ||
|
|
bb4d7eebca | ||
|
|
886e2e28a4 | ||
|
|
9d0f1163e7 | ||
|
|
eda3fd12f2 | ||
|
|
fb3e1d24f3 | ||
|
|
f4878c5afa |
No files matched your search
+2
-2
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'games.cubi'
|
||||
version = '1.6.3-backport'
|
||||
version = '1.6.5'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -31,7 +31,7 @@ tasks {
|
||||
// Configure the Minecraft version for our task.
|
||||
// This is the only required configuration besides applying the plugin.
|
||||
// Your plugin's jar (or shadowJar if present) will be used automatically.
|
||||
minecraftVersion("1.21.10")
|
||||
minecraftVersion("1.21.11")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ public class CommandsManager {
|
||||
this.cfg = cfg;
|
||||
}
|
||||
|
||||
public LiteralCommandNode<CommandSourceStack> registerCommand() {
|
||||
public LiteralCommandNode<CommandSourceStack> registerCommand(String commandName) {
|
||||
//run help command if no context provided
|
||||
LiteralCommandNode<CommandSourceStack> buildCommand = Commands.literal("raycastedentityocclusions")
|
||||
LiteralCommandNode<CommandSourceStack> buildCommand = Commands.literal(commandName)
|
||||
.requires(sender -> sender.getSender().hasPermission("raycastedentityocclusions.command"))
|
||||
.executes(context -> {
|
||||
helpCommand(context);
|
||||
|
||||
@@ -76,10 +76,10 @@ public class Engine {
|
||||
// ----- PHASE 1: SYNC GATHER -----
|
||||
|
||||
if (!syncRecheck.isEmpty()) {
|
||||
Logger.warning(syncRecheck.size() + " chunks failed to snapshot asynchronously, rechecking them now.");
|
||||
Logger.warning(syncRecheck.size() + " chunks failed to snapshot asynchronously, rechecking them now. This message may also have been triggered if a player teleported into unloaded chunks, in which case it's safe to ignore.");
|
||||
for (Chunk c : syncRecheck) {
|
||||
if (c.isLoaded()) {
|
||||
plugin.getChunkSnapshotManager().snapshotChunk(c);
|
||||
plugin.getChunkSnapshotManager().snapshotChunkSync(c);
|
||||
syncRecheck.remove(c);
|
||||
Logger.info("Successfully rechecked chunk " + c.getX() + ", " + c.getZ() + " in world " + c.getWorld().getName());
|
||||
}
|
||||
@@ -87,7 +87,8 @@ public class Engine {
|
||||
}
|
||||
|
||||
List<RayJob> jobs = new ArrayList<>();
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
Set<Player> players = new HashSet<>(Bukkit.getOnlinePlayers());
|
||||
for (Player p : players) {
|
||||
if (p.hasPermission("raycastedentityocclusions.bypass")) continue;
|
||||
Location eye = p.getEyeLocation().clone();
|
||||
Location predEye = null;
|
||||
@@ -96,7 +97,11 @@ public class Engine {
|
||||
predEye = tracker.getPredictedLocation(p);
|
||||
}
|
||||
|
||||
for (Entity e : p.getNearbyEntities(cfg.searchRadius, cfg.searchRadius, cfg.searchRadius)) {
|
||||
Set<Entity> toProcess = new HashSet<>();
|
||||
toProcess.addAll(p.getNearbyEntities(cfg.searchRadius, cfg.searchRadius, cfg.searchRadius));
|
||||
toProcess.addAll(players);
|
||||
|
||||
for (Entity e : toProcess) {
|
||||
if (e == p) continue;
|
||||
// Cull-players logic
|
||||
if (e instanceof Player pl && (!cfg.cullPlayers || (cfg.onlyCullSneakingPlayers && !pl.isSneaking()))) {
|
||||
@@ -248,7 +253,7 @@ public class Engine {
|
||||
BlockState data = block.getState();
|
||||
if (data instanceof TileState tileData) {
|
||||
p.sendBlockChange(location, block.getBlockData());
|
||||
p.sendBlockUpdate(location, tileData);
|
||||
//p.sendBlockUpdate(location, tileData);
|
||||
}
|
||||
else {
|
||||
//Logger.warning("Tried to show tile entity at " + location + " to "+p.getName()+" but it was not a TileState! Block type: " + block.getType()+". Removing from the list of tile entities.");
|
||||
|
||||
@@ -24,6 +24,7 @@ public class RaycastedEntityOcclusion extends JavaPlugin implements CommandExecu
|
||||
private CommandsManager commands;
|
||||
private boolean packetEventsPresent = false;
|
||||
private PacketProcessor packetProcessor = null;
|
||||
private static RaycastedEntityOcclusion instance;
|
||||
|
||||
public int tick = 0;
|
||||
|
||||
@@ -42,6 +43,7 @@ public class RaycastedEntityOcclusion extends JavaPlugin implements CommandExecu
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
cfg = new ConfigManager(this);
|
||||
snapMgr = new ChunkSnapshotManager(this);
|
||||
tracker = new MovementTracker(this, cfg);
|
||||
@@ -49,18 +51,11 @@ public class RaycastedEntityOcclusion extends JavaPlugin implements CommandExecu
|
||||
new UpdateChecker(this);
|
||||
getServer().getPluginManager().registerEvents(new EventListener(this, snapMgr, cfg), this);
|
||||
//Brigadier API
|
||||
LiteralCommandNode<CommandSourceStack> buildCommand = commands.registerCommand();
|
||||
|
||||
this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, commands -> {
|
||||
commands.registrar().register(buildCommand);
|
||||
this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, commandRegistrar -> {
|
||||
commandRegistrar.registrar().register(commands.registerCommand("raycastedentityocclusions"));
|
||||
//alias "reo"
|
||||
commands.registrar().register(Commands.literal("reo")
|
||||
.requires(sender -> sender.getSender().hasPermission("raycastedentityocclusions.command"))
|
||||
.executes(context -> {
|
||||
new CommandsManager(this, cfg).helpCommand(context);
|
||||
return Command.SINGLE_SUCCESS;
|
||||
})
|
||||
.redirect(buildCommand).build());
|
||||
commandRegistrar.registrar().register(commands.registerCommand("reo"));
|
||||
});
|
||||
|
||||
//bStats
|
||||
@@ -105,4 +100,7 @@ public class RaycastedEntityOcclusion extends JavaPlugin implements CommandExecu
|
||||
public PacketProcessor getPacketProcessor() {
|
||||
return packetProcessor;
|
||||
}
|
||||
public static RaycastedEntityOcclusion getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
+13
-4
@@ -77,11 +77,20 @@ public class ChunkSnapshotManager {
|
||||
removeChunkSnapshot(c);
|
||||
}
|
||||
|
||||
public void snapshotChunkSync(Chunk c) {
|
||||
if ((dataMap.get(key(c)).lastRefresh + 100) < System.currentTimeMillis() - cfg.snapshotRefreshInterval * 1000L) {
|
||||
return;
|
||||
}
|
||||
dataMap.put(key(c), takeSnapshot(c, System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
public void snapshotChunk(Chunk c) {
|
||||
//if (cfg.debugMode) {
|
||||
//Logger.info("ChunkSnapshotManager: Taking snapshot of chunk " + c.getWorld().getName() + ":" + c.getX() + ":" + c.getZ());
|
||||
//}
|
||||
dataMap.put(key(c), takeSnapshot(c, System.currentTimeMillis()));
|
||||
Bukkit.getScheduler().runTaskAsynchronously(RaycastedEntityOcclusion.getInstance(), () -> {
|
||||
dataMap.put(key(c), takeSnapshot(c, System.currentTimeMillis()));
|
||||
});
|
||||
}
|
||||
public void snapshotChunk(String key) {
|
||||
snapshotChunk(getKeyChunk(key));
|
||||
@@ -171,10 +180,10 @@ public class ChunkSnapshotManager {
|
||||
Chunk chunk = loc.getChunk();
|
||||
ChunkData d = dataMap.get(key(chunk));
|
||||
if (d == null) {
|
||||
Chunk c = loc.getChunk();
|
||||
Logger.error("ChunkSnapshotManager: No snapshot for " + c+ " If this error persists, please report this on our discord (discord.cubi.games)");
|
||||
//Chunk c = loc.getChunk();
|
||||
//Logger.error("ChunkSnapshotManager: No snapshot for " + c+ " If this error persists, please report this on our discord (discord.cubi.games)");
|
||||
Engine.syncRecheck.add(chunk);
|
||||
return loc.getBlock().getType();
|
||||
return Material.AIR;
|
||||
}
|
||||
double yLevel = loc.getY();
|
||||
if (yLevel < d.minHeight || yLevel > d.maxHeight) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class UpdateChecker {
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
|
||||
final String url = "https://api.modrinth.com/v2/project/bCjNZu0C/version";
|
||||
final String url = "https://api.modrinth.com/v2/project/bCjNZu0C/version?version_type=release";
|
||||
try (final InputStreamReader reader = new InputStreamReader(new URL(url).openConnection().getInputStream())) {
|
||||
final JsonArray array = new JsonArray();
|
||||
array.add(new BufferedReader(reader).readLine());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: RaycastedEntityOcclusions
|
||||
version: ${version}
|
||||
main: games.cubi.raycastedEntityOcclusion.RaycastedEntityOcclusion
|
||||
api-version: '1.21'
|
||||
api-version: '1.20.6'
|
||||
prefix: REO
|
||||
authors: [ _Cubicake ]
|
||||
load: STARTUP
|
||||
|
||||
Reference in new issue
Block a user