Compare commits

..
Author SHA1 Message Date
Cubicake 8cb78056ed Move UpdateChecker to core 2026-08-30 17:59:41 +09:30
Cubicake dec5ba5de2 Begin spigot support 2026-08-30 17:08:04 +09:30
165 changed files with 1622 additions and 809 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
plugins {
id("io.papermc.paperweight.userdev") version "2.0.0-beta.21" apply false
id("xyz.jpenilla.run-paper") version "3.0.2" apply false
}
+5 -3
View File
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
import java.time.Instant
@@ -36,6 +36,8 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("it.unimi.dsi:fastutil:8.5.18")
compileOnly("com.google.code.gson:gson:2.11.0")
}
val coreVersion = "0.7.2-SNAPSHOT"
@@ -0,0 +1,13 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core;
public interface AsyncRunner {
void runNow(Runnable task);
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core;
@@ -1,27 +1,14 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.paper;
package games.cubi.raycastedantiesp.core;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import games.cubi.logs.Logger;
import games.cubi.raycastedantiesp.core.config.ConfigManager;
import games.cubi.raycastedantiesp.core.config.UpdateConfig;
import games.cubi.raycastedantiesp.core.utils.BuildProperties;
import games.cubi.raycastedantiesp.core.utils.BuildProperties.Version;
import games.cubi.raycastedantiesp.paper.utils.PaperScheduler;
import java.io.BufferedReader;
import java.io.IOException;
@@ -39,6 +26,8 @@ public class UpdateChecker {
private static final String VERSION_API_ENDPOINT = "https://api.modrinth.com/v2/project/bCjNZu0C/version?include_changelog=false";
private static final String PLATFORM_NAME = "Paper";
private static final String MODRINTH_PAGE_URL = "https://modrinth.com/project/bCjNZu0C/";
private static final String MODRINTH_MM_LINK = "<hover:show_text:'" + MODRINTH_PAGE_URL + "'><aqua><u><click:open_url:'" + MODRINTH_PAGE_URL + "'>" + MODRINTH_PAGE_URL + "</click></u></aqua></hover>";
enum UpdateChannel {
STABLE("release", "release"),
@@ -82,8 +71,8 @@ public class UpdateChecker {
record ApiVersion(String rawVersion, Version coreVersion, Version platformVersion) {}
record UpdateCheckReport(List<UpdateCheckResult> results) {
UpdateCheckReport {
public record UpdateCheckReport(List<UpdateCheckResult> results) {
public UpdateCheckReport {
results = List.copyOf(results);
}
@@ -114,20 +103,20 @@ public class UpdateChecker {
}
}
private static CompletableFuture<List<VersionEntry>> fetchVersions(RaycastedAntiESP plugin) {
private static CompletableFuture<List<VersionEntry>> fetchVersions(AsyncRunner runner) {
CompletableFuture<List<VersionEntry>> future = new CompletableFuture<>();
Bukkit.getAsyncScheduler().runNow(plugin, ignored -> {
runner.runNow(() -> {
try {
URLConnection connection = new URI(VERSION_API_ENDPOINT).toURL().openConnection();
connection.setConnectTimeout(5_000); //ms
connection.setReadTimeout(5_000); //ms
try (
final InputStreamReader reader = new InputStreamReader(connection.getInputStream());
final BufferedReader bufferedReader = new BufferedReader(reader)
) {
future.complete(parseVersionEntries(bufferedReader));
}
URLConnection connection = new URI(VERSION_API_ENDPOINT).toURL().openConnection();
connection.setConnectTimeout(5_000); //ms
connection.setReadTimeout(5_000); //ms
try (
final InputStreamReader reader = new InputStreamReader(connection.getInputStream());
final BufferedReader bufferedReader = new BufferedReader(reader)
) {
future.complete(parseVersionEntries(bufferedReader));
}
} catch (IOException | URISyntaxException e) {
future.completeExceptionally(new IllegalStateException("Unable to fetch latest version", e));
}
@@ -158,13 +147,13 @@ public class UpdateChecker {
return List.copyOf(versionEntries);
}
private static CompletableFuture<UpdateCheckReport> fetchUpdateCheck(RaycastedAntiESP plugin) {
public static CompletableFuture<UpdateCheckReport> fetchUpdateCheck(AsyncRunner runner) {
UpdateConfig updateConfig = ConfigManager.get().getUpdateConfig();
if (!updateConfig.anyChannelEnabled()) {
return CompletableFuture.completedFuture(new UpdateCheckReport(List.of()));
}
return fetchVersions(plugin).thenApply(versionEntries -> checkVersions(
return fetchVersions(runner).thenApply(versionEntries -> checkVersions(
BuildProperties.CORE.version(),
BuildProperties.PLATFORM.version(),
versionEntries,
@@ -275,14 +264,14 @@ public class UpdateChecker {
static String formatUpdateMessage(UpdateCheckResult result) {
return switch (result.status()) {
case BEHIND -> "<red>You are behind the latest " + result.channel().messageName() + " of RaycastedAntiESP. Please upgrade to <green>v" + result.apiVersion().rawVersion() + "<red> at " + modrinthLink() + "<red>.";
case BEHIND -> "<red>You are behind the latest " + result.channel().messageName() + " of RaycastedAntiESP. Please upgrade to <green>v" + result.apiVersion().rawVersion() + "<red> at " + MODRINTH_MM_LINK + "<red>.";
case UP_TO_DATE -> "<green>You are up to date with the latest " + result.channel().messageName() + " of RaycastedAntiESP.";
case AHEAD, NO_COMPARABLE_VERSION -> "<yellow>You are ahead of the latest " + result.channel().messageName() + " of RaycastedAntiESP.";
case INVALID_CURRENT_VERSION -> "<red>Unable to check for updates to RaycastedAntiESP, invalid current version format.";
};
}
static String formatUpdateMessage(UpdateCheckReport report) {
public static String formatUpdateMessage(UpdateCheckReport report) {
List<String> messages = new ArrayList<>();
for (UpdateCheckResult result : report.results()) {
messages.add(formatUpdateMessage(result));
@@ -290,20 +279,4 @@ public class UpdateChecker {
return String.join("\n", messages);
}
private static String modrinthLink() {
return "<hover:show_text:'" + MODRINTH_PAGE_URL + "'><aqua><u><click:open_url:'" + MODRINTH_PAGE_URL + "'>" + MODRINTH_PAGE_URL + "</click></u></aqua></hover>";
}
public static void checkForUpdates(RaycastedAntiESP plugin, CommandSender audience) {
fetchUpdateCheck(plugin).thenAccept(report -> {
if (report.results().isEmpty()) {
return;
}
PaperScheduler.runForAudience(plugin, audience, () -> audience.sendRichMessage(formatUpdateMessage(report)));
}).exceptionally(ex -> {
Logger.error("An error occurred while checking for plugin updates", ex, 4, UpdateChecker.class);
return null;
});
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,16 +1,16 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
import java.util.Arrays;
import static games.cubi.utils.VarHandler.LONG_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.LONG_ARRAY_HANDLE;
/**
* A 4096-bit bitset, where 1 indicates occluding and 0 indicates not occluding.
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -13,8 +13,8 @@ import games.cubi.raycastedantiesp.core.chunks.BlockInfoResolver;
import games.cubi.raycastedantiesp.core.chunks.ChunkData;
import java.util.Arrays;
import static games.cubi.utils.VarHandler.CHAR_ARRAY_HANDLE;
import static games.cubi.utils.VarHandler.LONG_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.CHAR_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.LONG_ARRAY_HANDLE;
abstract class AbstractPalettedBlockChunkData implements BlockChunkData {
// Each concrete palette store allocates its maximum palette size up front. Adding a block only fills another slot in this array.
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -13,7 +13,7 @@ import games.cubi.raycastedantiesp.core.chunks.BlockInfoResolver;
import games.cubi.raycastedantiesp.core.chunks.ChunkData;
import java.util.function.IntUnaryOperator;
import static games.cubi.utils.VarHandler.BYTE_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.BYTE_ARRAY_HANDLE;
public class ByteArrayBlockChunkData extends AbstractPalettedBlockChunkData {
private final byte[] blockData = new byte[ChunkData.BLOCK_COUNT];
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -13,8 +13,8 @@ import games.cubi.raycastedantiesp.core.chunks.BlockInfoResolver;
import games.cubi.raycastedantiesp.core.chunks.ChunkData;
import java.util.Arrays;
import static games.cubi.utils.VarHandler.CHAR_ARRAY_HANDLE;
import static games.cubi.utils.VarHandler.LONG_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.CHAR_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.LONG_ARRAY_HANDLE;
public class CharArrayBlockChunkData implements BlockChunkData {
private final char[] blockData;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -13,7 +13,7 @@ import games.cubi.raycastedantiesp.core.chunks.BlockInfoResolver;
import games.cubi.raycastedantiesp.core.chunks.ChunkData;
import java.util.function.IntUnaryOperator;
import static games.cubi.utils.VarHandler.BYTE_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.BYTE_ARRAY_HANDLE;
public class FourBlockChunkData extends AbstractPalettedBlockChunkData {
private static final int ENTRIES_PER_BYTE = 4;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -13,7 +13,7 @@ import games.cubi.raycastedantiesp.core.chunks.BlockInfoResolver;
import games.cubi.raycastedantiesp.core.chunks.ChunkData;
import java.util.function.IntUnaryOperator;
import static games.cubi.utils.VarHandler.BYTE_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.BYTE_ARRAY_HANDLE;
public class SixteenBlockChunkData extends AbstractPalettedBlockChunkData {
private static final int ENTRIES_PER_BYTE = 2;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks.blocks;
@@ -15,7 +15,7 @@ import java.util.Arrays;
import static games.cubi.raycastedantiesp.core.chunks.ChunkData.packLocalChecked;
import static games.cubi.raycastedantiesp.core.chunks.ChunkData.packUncheckedGuarded;
import static games.cubi.utils.VarHandler.LONG_ARRAY_HANDLE;
import static games.cubi.raycastedantiesp.core.utils.VarHandler.LONG_ARRAY_HANDLE;
//functionally a bitset
public class TwoBlockChunkData implements BlockChunkData {
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -15,7 +15,7 @@ import games.cubi.raycastedantiesp.core.config.raycast.EntityConfig;
import games.cubi.raycastedantiesp.core.config.raycast.PlayerConfig;
import games.cubi.raycastedantiesp.core.config.raycast.SoundEffectsConfig;
import games.cubi.raycastedantiesp.core.config.raycast.TileEntityConfig;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.yaml.NodeStyle;
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,15 +1,16 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
import games.cubi.locatables.api.Locatable;
import games.cubi.logs.Logger;
import games.cubi.raycastedantiesp.core.AsyncRunner;
import games.cubi.raycastedantiesp.core.config.ConfigManager;
import games.cubi.raycastedantiesp.core.config.DebugConfig;
import games.cubi.raycastedantiesp.core.config.raycast.EntityConfig;
@@ -21,7 +22,7 @@ import games.cubi.raycastedantiesp.core.players.PlayerData;
import games.cubi.raycastedantiesp.core.players.PlayerRegistry;
import games.cubi.raycastedantiesp.core.raycast.ParticleSpawner;
import games.cubi.raycastedantiesp.core.raycast.RaycastUtil;
import games.cubi.utils.lists.PrimitiveIntArrayList;
import games.cubi.raycastedantiesp.core.utils.PrimitiveIntArrayList;
import games.cubi.raycastedantiesp.core.view.BlockView;
import games.cubi.raycastedantiesp.core.view.EntityView;
@@ -426,7 +427,7 @@ public abstract class AsyncEngine implements Engine {
if (!player.nettyData().isSelfEntityID(entity.leashingEntity())
&& !player.nettyData().isSelfEntityID(entity.vehicleID())
&& !EntityBypassRegistry.isBypassed(entity.vehicleID())
&& !PrimitiveIntArrayList.contains(entity.passengerIDsNoAlloc(), selfEntityID)) {
&& !PrimitiveIntArrayList.contains(entity.passengerIDs(), selfEntityID)) {
return false;
}
view.setVisibility(entity, true, currentTick, worldEpoch);
@@ -1,13 +0,0 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
public interface AsyncRunner {
void runNow(Runnable task);
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.entity;
@@ -1,21 +1,17 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
import games.cubi.logs.Logger;
import games.cubi.raycastedantiesp.core.tracked.EntitySpawnTask;
import games.cubi.raycastedantiesp.core.tracked.NettyEntity;
import games.cubi.raycastedantiesp.core.utils.*;
import games.cubi.raycastedantiesp.core.utils.Packet.Packets;
import games.cubi.utils.Clearable;
import games.cubi.utils.VarHandler;
import games.cubi.utils.lists.IntArrayListMarker;
import games.cubi.utils.lists.PrimitiveIntArrayList;
import it.unimi.dsi.fastutil.ints.Int2IntArrayMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
@@ -73,14 +69,6 @@ public class NettyData implements Clearable {
return PrimitiveIntArrayList.getCopyOrNull(unresolvedLeashedEntityIDsByHolderID.get(holderEntityID));
}
/**
* Returns internal Netty-thread reconciliation state without copying it.
* Callers must not mutate the returned array.
*/
public int[] getUnresolvedLeashesNoAlloc(int holderEntityID) {
return unresolvedLeashedEntityIDsByHolderID.get(holderEntityID);
}
public int[] consumeUnresolvedLeashes(int holderEntityID) {
int[] existing = unresolvedLeashedEntityIDsByHolderID.remove(holderEntityID);
if (PrimitiveIntArrayList.isEmpty(existing)) {
@@ -141,14 +129,6 @@ public class NettyData implements Clearable {
return PrimitiveIntArrayList.getCopyOrNull(unresolvedPassengerIDsByVehicleID.get(vehicleEntityID));
}
/**
* Returns internal Netty-thread reconciliation state without copying it.
* Callers must not mutate the returned array.
*/
public int[] getUnresolvedPassengersNoAlloc(int vehicleEntityID) {
return unresolvedPassengerIDsByVehicleID.get(vehicleEntityID);
}
/**
* Replaces any previous unresolved passenger state for this vehicle.
* The passenger packet is authoritative, so the latest packet wins.
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
@@ -12,7 +12,7 @@ import games.cubi.locatables.api.Locatable;
import games.cubi.locatables.implementations.ThreadSafeLocatable;
import games.cubi.logs.Logger;
import games.cubi.raycastedantiesp.core.tracked.NettyEntity;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import games.cubi.raycastedantiesp.core.view.BlockView;
import games.cubi.raycastedantiesp.core.view.EntityView;
import games.cubi.raycastedantiesp.core.view.ViewRegistry;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
@@ -12,7 +12,7 @@ import games.cubi.locatables.api.FloatingLocatableEquality;
import games.cubi.locatables.api.Locatable;
import games.cubi.locatables.api.MutableFloatingLocatable;
import games.cubi.locatables.api.Spatial;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import java.lang.invoke.VarHandle;
import java.util.Objects;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
@@ -1,15 +1,15 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
import games.cubi.raycastedantiesp.core.tracked.NettyEntity;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import java.lang.invoke.VarHandle;
import java.util.Collection;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.raycast;
@@ -54,29 +54,6 @@ public class RaycastUtil {
return rayAdvancer.occluded <= maxOccluding;
}
/**
* A very fast, low-accuracy raycast
*/
public static int fastRaycastDirection(int maxOccluding, final BlockView snap, final Spatial start,
final double dirX, final double dirY, final double dirZ, final int maxSteps) {
double startX = start.x();
double startY = start.y();
double startZ = start.z();
final RayAdvancer rayAdvancer = new RayAdvancer(startX, startY, startZ, RayDirection.ofDirection(dirX, dirY, dirZ), snap);
int remainingSteps = maxSteps;
while (remainingSteps >= 4) {
rayAdvancer.advance();
rayAdvancer.advance();
rayAdvancer.advance();
rayAdvancer.advance();
remainingSteps -= 4;
if (rayAdvancer.occluded > maxOccluding) return (maxSteps - remainingSteps);
}
return maxSteps;
}
private static sealed class RayAdvancer extends RayPosition permits DebugRayAdvancer {
private final RayDirection direction;
private final BlockView blockView;
@@ -182,10 +159,6 @@ public class RaycastUtil {
return new RayDirection(endX - startX, endY - startY, endZ - startZ);
}
private static RayDirection ofDirection(double x, double y, double z) {
return new RayDirection(x, y, z);
}
private double getLengthSquared() {
return x * x + y * y + z * z;
}
@@ -1,19 +1,19 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
import games.cubi.locatables.api.MutableFloatingSpatial;
import games.cubi.raycastedantiesp.core.players.PlayerData;
import games.cubi.utils.Clearable;
import games.cubi.utils.lists.PrimitiveIntArrayList;
import games.cubi.utils.lists.IntArrayListMarker;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.PrimitiveIntArrayList;
import games.cubi.raycastedantiesp.core.utils.IntArrayListMarker;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import org.jetbrains.annotations.Nullable;
import java.lang.invoke.VarHandle;
@@ -276,27 +276,12 @@ public abstract class NettyEntity<PacketReplayData extends Clearable> implements
return this;
}
/**
* @return a clone of the passenger ID array, which may be null
*/
@Override
public int[] passengerIDs() {
int[] current = passengerIDsAcquire();
return current == null ? null : current.clone();
}
/**
* Do not mutate this.
* <p></p>
* This method is not considered public api.
* <p>
* Returned array may be null
* </p>
*/
public int[] passengerIDsNoAlloc() {
return passengerIDsAcquire();
}
@Override
public TrackedEntity<?> setPassengerIDs(int[] passengerIDs) {
PASSENGER_IDS.setRelease(this, passengerIDs == null ? new int[0] : passengerIDs.clone());
@@ -330,17 +315,6 @@ public abstract class NettyEntity<PacketReplayData extends Clearable> implements
return PrimitiveIntArrayList.getCopyOrNull(leashedIDs);
}
/**
* Returns internal Netty-thread leash state without copying it.
* Callers must not mutate the returned array.
* <p>
* This is not considered public API.
* </p>
*/
public int@Nullable[] leashedEntityIDsOrNullNoAlloc() {
return leashedIDs;
}
@Override
public int leashingEntity() {
return (int) LEASHER_ID.getOpaque(this);
@@ -466,9 +440,9 @@ public abstract class NettyEntity<PacketReplayData extends Clearable> implements
", velocityY=" + velocityY() +
", velocityZ=" + velocityZ() +
", onGround=" + onGround() +
", leashedIDs=" + PrimitiveIntArrayList.toString(leashedIDs) +
", leashedIDs=" + nullableArrayToString(leashedIDs) +
", leasherID=" + leashingEntity() +
", passengerIDs=" + PrimitiveIntArrayList.toString(passengerIDsAcquire()) +
", passengerIDs=" + nullableArrayToString(passengerIDsAcquire()) +
", vehicleID=" + vehicleID() +
", entityData=" + entityData() +
'}';
@@ -477,4 +451,9 @@ public abstract class NettyEntity<PacketReplayData extends Clearable> implements
private int[] passengerIDsAcquire() {
return (int[]) PASSENGER_IDS.getAcquire(this);
}
private static String nullableArrayToString(int[] values) {
return values == null ? null : PrimitiveIntArrayList.toString(values);
}
}
@@ -1,17 +1,17 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
import games.cubi.locatables.api.BlockSpatial;
import games.cubi.utils.Clearable;
import games.cubi.utils.lists.InvasivelyLinkedSWMRList;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.InvasivelyLinkedSWMRList;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import java.lang.invoke.VarHandle;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
@@ -1,15 +1,15 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
import games.cubi.locatables.api.ImmutableBlockSpatial;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
public interface TrackedTileEntity<T> extends ImmutableBlockSpatial, Clearable {
int NEVER_CHECKED = Integer.MIN_VALUE;
@@ -1,12 +1,12 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
package games.cubi.raycastedantiesp.core.utils;
import games.cubi.logs.Logger;
import org.jetbrains.annotations.Nullable;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
@@ -0,0 +1,48 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Set;
import java.util.function.Function;
/**
* A Set-like data structure that stores canonical instances of key values.
* Any compatible key type with {@code equals} and {@code hashcode} implemented identically to the value type may be used for lookup,
* but only canonical values of type {@code V} may be stored.
*
* @param <K> key type used for lookup
* @param <V> stored canonical value type
*/
public interface CanonicalSet<K, V extends K> {
int size();
boolean isEmpty();
boolean contains(K keyValue);
@Nullable V get(K keyValue);
@Nullable V add(V keyValue);
void addAll(Set<? extends V> keyValues);
@Nullable V computeIfAbsent(K keyValue, @NotNull Function<? super K, ? extends V> mappingFunction);
@Nullable V remove(K keyValue);
void clear();
@NotNull Set<V> keySet();
@NotNull Collection<V> values();
}
@@ -0,0 +1,16 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
public interface Clearable {
/**
* Dereferences all internal references to other objects, allowing them to be garbage collected. In theory this isn't needed but idk what's causing the memory leak so we're covering all bases.
*/
void clear();
}
@@ -0,0 +1,100 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
public class ConcurrentSelfMap<K, V extends K> implements CanonicalSet<K, V> {
private final ConcurrentHashMap<V, V> backingMap = new ConcurrentHashMap<>();
public ConcurrentSelfMap() {}
@Override
public int size() {
return backingMap.size();
}
@Override
public boolean isEmpty() {
return backingMap.isEmpty();
}
@Override
public boolean contains(K keyValue) {
return backingMap.containsKey(keyValue);
}
@Override
public @Nullable V get(K keyValue) {
return backingMap.get(keyValue);
}
@Override
public @Nullable V add(V keyValue) {
return backingMap.put(keyValue, keyValue);
}
@Override
public void addAll(Set<? extends V> keyValues) {
for (V keyValue : keyValues) {
backingMap.put(keyValue, keyValue);
}
}
@Override
public @Nullable V computeIfAbsent(
K keyValue,
@NotNull Function<? super K, ? extends V> mappingFunction
) {
V existing = backingMap.get(keyValue);
if (existing != null) {
return existing;
}
V canonicalValue = mappingFunction.apply(keyValue);
if (canonicalValue == null) {
return null;
}
if (!canonicalValue.equals(keyValue)) {
throw new IllegalArgumentException(
"Computed canonical value must be equal to the key value."
);
}
V racedValue = backingMap.putIfAbsent(canonicalValue, canonicalValue);
return racedValue != null ? racedValue : canonicalValue;
}
@Override
public @Nullable V remove(K keyValue) {
return backingMap.remove(keyValue);
}
@Override
public void clear() {
backingMap.clear();
}
@Override
public @NotNull Set<V> keySet() {
return backingMap.keySet();
}
@Override
public @NotNull Collection<V> values() {
return backingMap.values();
}
}
@@ -1,12 +1,12 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
package games.cubi.raycastedantiesp.core.utils;
import games.cubi.logs.Logger;
import org.jetbrains.annotations.Nullable;
@@ -0,0 +1,19 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import java.lang.annotation.*; /**
* {@code int[]} fields annotated with this are backing arrays for {@code IntArrayLists}. {@code IntArrayLists} are not objects directly, instead just an {@code int[]} array, with static operations provided by {@link PrimitiveIntArrayList}.
* <p>
* This is used to avoid the overhead of an actual object for each {@link PrimitiveIntArrayList}. To further reduce overhead, the field may not be initialised, {@link PrimitiveIntArrayList} is null safe.
*
* <p> Do not use this array directly, all calls should go through {@link PrimitiveIntArrayList}.
*/
@Documented @Retention(RetentionPolicy.SOURCE) @Target({ElementType.TYPE_USE, ElementType.FIELD, ElementType.PARAMETER})
public @interface IntArrayListMarker {}
@@ -0,0 +1,293 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import org.jetbrains.annotations.NotNull;
import java.lang.invoke.VarHandle;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Objects;
/**
* An intrusive doubly linked node designed for a single-writer,
* multiple-reader access pattern.
*
* <h2>Concurrency model</h2>
* <ul>
* <li>Exactly one writer may modify a list.</li>
* <li>Readers may traverse forward concurrently.</li>
* <li>Readers must not inspect {@code previousWriterOnly()}.</li>
* <li>The writer must not reuse a removed node until all readers that
* could still hold that node have quiesced.</li>
* </ul>
*
* <p>Forward links are published with release semantics and read with
* acquire semantics. The backward link is plain because only the writer
* may access it.</p>
*
* <p>A common layout uses a permanent sentinel node. Data nodes are placed
* after the sentinel, and the sentinel itself is never unlinked.</p>
*
* @param <T> the concrete node type
*/
public abstract class InvasivelyLinkedSWMRList<T extends InvasivelyLinkedSWMRList<T>> implements Iterable<T> {
private T next; private static final VarHandle NEXT = VarHandler.get(InvasivelyLinkedSWMRList.class, "next", InvasivelyLinkedSWMRList.class);
private T previous;
/**
* Returns this object with its concrete node type.
*
* <p>An implementation must return {@code this}:</p>
*
* <pre>{@code
* @Override
* protected MyNode self() {
* return this;
* }
* }</pre>
*/
@SuppressWarnings("unchecked")
protected final T self() {
return (T) this;
}
/**
* Provides access to private fields {@code next} and {@code previous}. They are only accessible from within this class, not subclasses.
*/
private static <N extends InvasivelyLinkedSWMRList<N>> InvasivelyLinkedSWMRList<N> linksOf(N node) {
return node;
}
/**
* Returns the next node using acquire semantics.
*
* <p>This is the forward-link operation intended for concurrent
* readers.</p>
*/
@SuppressWarnings("unchecked")
public final T nextAcquire() {
return (T) NEXT.getAcquire(this);
}
/**
* Returns the next node without memory ordering.
*
* <p>Only the single writer may call this method.</p>
*/
private T nextWriterOnly() {
return next;
}
private void setNextRelease(T value) {
NEXT.setRelease(this, value);
}
/**
* Returns the preceding node.
*
* <p>Only the single writer may call this method. Concurrent readers
* must not use the backward link.</p>
*/
public final T previousWriterOnly() {
return previous;
}
/**
* Reports whether this node has a predecessor.
*
* <p>Only the single writer may call this method. A permanent sentinel
* normally has no predecessor and therefore returns {@code false}.</p>
*/
public final boolean isLinkedWriterOnly() {
return previous != null;
}
/**
* Reports whether both intrusive links are clear.
*
* <p>This does not prove that no reader still holds the node. Node
* lifetime and reader quiescence must be managed separately.</p>
*/
public final boolean isDetachedWriterOnly() {
return previous == null && nextWriterOnly() == null;
}
/**
* Inserts {@code node} directly after this node.
*
* <p>Only the single writer may call this method.</p>
*
* <p>The inserted node must:</p>
* <ul>
* <li>not be this node;</li>
* <li>have both intrusive links clear;</li>
* <li>not be visible to any reader;</li>
* <li>not belong to another list.</li>
* </ul>
*
* <p>The release store to this node's forward link is the insertion
* linearisation point. A reader that observes the inserted node through
* {@link #nextAcquire()} also observes writes made to the node before
* insertion.</p>
*
* @param node detached node to insert
* @throws NullPointerException if {@code node} is null
* @throws IllegalArgumentException if asked to insert this node
* @throws IllegalStateException if {@code node} appears linked
*/
public final void linkAfter(T node) {
Objects.requireNonNull(node, "node");
T self = self();
if (node == self) {
throw new IllegalArgumentException("A node cannot be linked after itself");
}
InvasivelyLinkedSWMRList<T> nodeLinks = linksOf(node);
if (nodeLinks.previous != null || nodeLinks.nextWriterOnly() != null) {
throw new IllegalStateException("The node is already linked or is not detached");
}
T oldNext = nextWriterOnly();
if (node == oldNext) {
throw new IllegalStateException("The node is already the current successor");
}
/*
* Fully initialise the inserted node before publishing it.
*/
nodeLinks.previous = self;
nodeLinks.next = oldNext;
if (oldNext != null) {
InvasivelyLinkedSWMRList<T> oldNextLinks = linksOf(oldNext);
oldNextLinks.previous = node;
}
/*
* Publication and insertion linearisation point.
*/
setNextRelease(node);
}
/**
* Removes this node from its current list.
*
* <p>Only the single writer may call this method.</p>
*
* <p>The node must have a predecessor. This rule prevents accidental
* removal of a permanent sentinel and avoids the need to update an
* external head reference.</p>
*
* <p>A concurrent reader may still:</p>
* <ul>
* <li>return this node after it has been removed;</li>
* <li>continue from this node to its former successor;</li>
* <li>observe the cleared forward link and stop early.</li>
* </ul>
*
* <p>The removed node must not be modified, reused, or inserted again
* until every reader that could hold it has quiesced.</p>
*
* @return the node that followed this node, or {@code null}
* @throws IllegalStateException if this node has no predecessor
*/
public final T unlink() {
T oldPrevious = previous;
if (oldPrevious == null) {
throw new IllegalStateException(
"Cannot unlink a detached node or sentinel node"
);
}
T oldNext = nextWriterOnly();
/*
* Update the writer-only backward link first. The following release
* store also publishes this change, though readers must not depend
* on it.
*/
if (oldNext != null) {
InvasivelyLinkedSWMRList<T> oldNextLinks = linksOf(oldNext);
oldNextLinks.previous = oldPrevious;
}
/*
* Bypass this node. This is the removal linearisation point.
*/
InvasivelyLinkedSWMRList<T> previousLinks = linksOf(oldPrevious);
previousLinks.setNextRelease(oldNext);
/*
* Clear this node after it has been bypassed. Release semantics are
* stronger than strictly required here, but they keep the ordering
* rules simple and explicit.
*/
previous = null;
setNextRelease(null);
return oldNext;
}
/**
* Detaches a list head after its owner has published a replacement head.
*
* <p>Only the single writer may call this method. Concurrent readers that already hold the old head may either
* continue to the former successor or stop at the cleared link, matching the weakly-consistent iterator contract.</p>
*/
public final T detachHeadWriterOnly() {
if (previous != null) {
throw new IllegalStateException("Only a list head may be detached with this method");
}
T oldNext = nextWriterOnly();
if (oldNext != null) {
linksOf(oldNext).previous = null;
}
setNextRelease(null);
return oldNext;
}
/**
* Returns a weakly consistent forward iterator beginning with this node.
*
* <p>The iterator does not create a snapshot. During concurrent writes
* it may miss inserted nodes, return removed nodes, or stop early after
* reaching a removed node. It does not throw
* {@link java.util.ConcurrentModificationException}.</p>
*/
@Override
public final @NotNull Iterator<T> iterator() {
return new Iterator<>() {
private T next = self();
@Override
public boolean hasNext() {
return next != null;
}
@Override
public T next() {
T result = next;
if (result == null) {
throw new NoSuchElementException();
}
next = result.nextAcquire();
return result;
}
};
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
@@ -0,0 +1,111 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import games.cubi.logs.Logger;
/**
* Static utility class for operations on int arrays annotated with {@link IntArrayListMarker}, which are intended to be used as lists of integers without the overhead of autoboxing.
* <p>
* {@link IntArrayListMarker} fields may be null or non-initialised to save memory, {@code IntArrayList} methods will treat null or non-initialised arrays as empty lists.
* <p>
* Arrays expand and contract as needed such that the length of the backing array is always equal to the number of elements in the list, so there is no extra capacity. This means that adding or removing elements from the list will involve creating a new array and copying the existing elements, which can be inefficient for large lists. However, this design choice was made to save memory and avoid the overhead of maintaining a separate size field and capacity management logic.
*/
public class PrimitiveIntArrayList {
private PrimitiveIntArrayList() {}
public static int size(int@IntArrayListMarker[] array) {
return array == null ? 0 : array.length;
}
public static boolean isEmpty(int@IntArrayListMarker[] array) {
return array == null || array.length == 0;
}
public static boolean contains(int@IntArrayListMarker[] array, int value) {
if (array == null) return false;
for (int i : array) {
if (i == value) return true;
}
return false;
}
/**
* Caller of this method <b>must</b> reassign the returned array to the original array reference, as the original array will not be modified and a new array with the added element will be returned.
*/
public static int@IntArrayListMarker[] add(int@IntArrayListMarker[] array, int value) {
if (array == null) {
return new int[]{value};
} else {
int[] newArray = new int[array.length + 1];
System.arraycopy(array, 0, newArray, 0, array.length);
newArray[array.length] = value;
return newArray;
}
}
/**
* Caller of this method <b>must</b> reassign the returned array to the original array reference, as the original array will not be modified and a new array with the added element will be returned.
*/
public static int@IntArrayListMarker[] remove(int@IntArrayListMarker[] array, int value) {
if (array == null) return null;
int index = -1;
for (int i = 0; i < array.length; i++) {
if (array[i] == value) {
index = i;
break;
}
}
if (index == -1) return array; // value not found, return original array
int[] newArray = new int[array.length - 1];
System.arraycopy(array, 0, newArray, 0, index);
System.arraycopy(array, index + 1, newArray, index, array.length - index - 1);
return newArray;
}
/**
* Caller of this method <b>must</b> reassign the returned array to the original array reference, as the original array will not be modified and a new array with the added element will be returned.
*/
public static int@IntArrayListMarker[] clear(int@IntArrayListMarker[] array) {
return null;
}
public static int get(int@IntArrayListMarker[] array, int index) {
if (array == null) Logger.errorAndReturn(new IndexOutOfBoundsException("Attempted to find value at index: " + index + ", for IntArrayList with size: 0"), 3, PrimitiveIntArrayList.class);
if (index < 0 || index >= array.length) Logger.errorAndReturn(new IndexOutOfBoundsException("Attempted to find value at index: " + index + ", for IntArrayList with size: " + size(array)), 3, PrimitiveIntArrayList.class);
return array[index];
}
public static int@IntArrayListMarker[] set(int@IntArrayListMarker[] array, int index, int value) {
array[index] = value;
return array;
}
public static int[] getCopyOrNull(int@IntArrayListMarker[] array) {
if (size(array) == 0) return null;
int[] copy = new int[array.length];
System.arraycopy(array, 0, copy, 0, array.length);
return copy;
}
public static String toString(int@IntArrayListMarker[] array) {
if (array == null) return "[]";
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int i = 0; i < array.length; i++) {
sb.append(array[i]);
if (i < array.length - 1) {
sb.append(", ");
}
}
sb.append("]");
return sb.toString();
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
@@ -0,0 +1,30 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.utils;
import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
import java.lang.invoke.VarHandle;
/** Just a shorter alias of useful methods from ConcurrentUtil**/
public final class VarHandler {
public static final VarHandle BYTE_ARRAY_HANDLE = ConcurrentUtil.getArrayHandle(byte[].class);
public static final VarHandle CHAR_ARRAY_HANDLE = ConcurrentUtil.getArrayHandle(char[].class);
public static final VarHandle LONG_ARRAY_HANDLE = ConcurrentUtil.getArrayHandle(long[].class);
private VarHandler() {}
public static VarHandle get(Class<?> classOf, String fieldName, Class<?> fieldClass) {
return ConcurrentUtil.getVarHandle(classOf, fieldName, fieldClass);
}
public static VarHandle $tatic(Class<?> classOf, String fieldName, Class<?> fieldClass) {
return ConcurrentUtil.getStaticVarHandle(classOf, fieldName, fieldClass);
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
@@ -19,9 +19,9 @@ import games.cubi.raycastedantiesp.core.chunks.OccludingChunkData;
import games.cubi.raycastedantiesp.core.tracked.TrackedTileEntity;
import games.cubi.raycastedantiesp.core.tracked.NettyTileEntity;
import games.cubi.raycastedantiesp.core.players.PlayerData;
import games.cubi.utils.Clearable;
import games.cubi.utils.lists.InvasivelyLinkedSWMRList;
import games.cubi.utils.VarHandler;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.InvasivelyLinkedSWMRList;
import games.cubi.raycastedantiesp.core.utils.VarHandler;
import games.cubi.raycastedantiesp.core.view.chunks.BlockChunkSectionStore;
import games.cubi.raycastedantiesp.core.view.chunks.ChunkSectionStore;
import games.cubi.raycastedantiesp.core.view.chunks.OccludingChunkSectionStore;
@@ -37,6 +37,9 @@ import java.util.function.IntSupplier;
import static games.cubi.raycastedantiesp.core.chunks.ChunkData.packUncheckedGuarded;
public abstract class AbstractBlockView<R extends Clearable, T extends NettyTileEntity<R>> implements BlockView {
public static final int CHUNK_SIZE = 16;
public static final int LOCAL_MASK = CHUNK_SIZE - 1;
private final ChunkSectionStore chunks;
private final boolean trackAllBlocks;
/**
@@ -155,7 +158,7 @@ public abstract class AbstractBlockView<R extends Clearable, T extends NettyTile
tileEntity.setVisible(shouldBeVisible);
tileEntity.setLastChecked(currentTick);
if (visibilityChanged) {
TransitionType.Tile type = shouldBeVisible ? TransitionType.Tile.SHOW : TransitionType.Tile.HIDE;
BlockViewTransition.Type type = shouldBeVisible ? BlockViewTransition.Type.SHOW : BlockViewTransition.Type.HIDE;
transitions.add(type, tileEntity, modeToken, expectedWorldEpoch);
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
@@ -15,7 +15,7 @@ import games.cubi.raycastedantiesp.core.chunks.ChunkOcclusionView;
import games.cubi.raycastedantiesp.core.tracked.TrackedTileEntity;
import games.cubi.raycastedantiesp.core.chunks.BlockChunkData;
import games.cubi.raycastedantiesp.core.chunks.OccludingChunkData;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import java.util.Collection;
import java.util.UUID;
import java.util.function.Consumer;
@@ -113,7 +113,7 @@ public interface BlockView extends Clearable {
@FunctionalInterface
interface TransitionConsumer {
void accept(TransitionType.Tile type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch);
void accept(BlockViewTransition.Type type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch);
}
void drainTransitions(TransitionConsumer consumer);
@@ -0,0 +1,19 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
import games.cubi.raycastedantiesp.core.tracked.TrackedTileEntity;
// Retains the originating object identity so a delayed transition cannot target a replacement at the same coordinates.
public record BlockViewTransition(Type type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch) {
public enum Type {
SHOW,
HIDE,
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
@@ -11,7 +11,7 @@ package games.cubi.raycastedantiesp.core.view;
import games.cubi.raycastedantiesp.core.tracked.TrackedEntity;
import games.cubi.locatables.api.Spatial;
import games.cubi.raycastedantiesp.core.tracked.NettyEntity;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import java.util.Collection;
import java.util.UUID;
@@ -45,6 +45,9 @@ public interface EntityView<T extends TrackedEntity<?>> extends Clearable {
*/
int size();
@Deprecated
boolean isVisible(UUID entityUUID, int currentTick);
boolean isVisible(UUID entityUUID);
boolean isVisible(int entityID);
@@ -83,7 +86,7 @@ public interface EntityView<T extends TrackedEntity<?>> extends Clearable {
@FunctionalInterface
interface TransitionConsumer {
void accept(TransitionType.Entity type, TrackedEntity<?> entity, int worldEpoch);
void accept(EntityViewTransition.Type type, TrackedEntity<?> entity, int worldEpoch);
}
void drainTransitions(TransitionConsumer consumer);
@@ -0,0 +1,20 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
import games.cubi.raycastedantiesp.core.tracked.TrackedEntity;
// Used to cache visibility changes until the player's netty thread next processes
public record EntityViewTransition(Type type, TrackedEntity<?> entity, int worldEpoch) {
public enum Type {
SHOW,
HIDE,
FORGET,
}
}
@@ -1,14 +1,14 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import games.cubi.utils.IntrusiveSPSCQueue;
import games.cubi.raycastedantiesp.core.tracked.TrackedTileEntity;
@@ -28,7 +28,7 @@ public final class PackedBlockTransitionQueue {
private final IntrusiveSPSCQueue<QueueEntry> publishedEntries = new IntrusiveSPSCQueue<>();
private final PendingBatch pending = new PendingBatch();
public void add(TransitionType.Tile type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch) {
public void add(BlockViewTransition.Type type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch) {
Objects.requireNonNull(type, "type");
Objects.requireNonNull(tileEntity, "tileEntity");
@@ -91,17 +91,17 @@ public final class PackedBlockTransitionQueue {
pending.clear();
}
private abstract static sealed class QueueEntry extends IntrusiveSPSCQueue.Node {
private abstract static class QueueEntry extends IntrusiveSPSCQueue.Node {
abstract void drain(BlockView.TransitionConsumer consumer);
}
private static final class SingleEntry extends QueueEntry {
private final TransitionType.Tile type;
private final BlockViewTransition.Type type;
private final TrackedTileEntity<?> tileEntity;
private final long modeToken;
private final int worldEpoch;
private SingleEntry(TransitionType.Tile type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch) {
private SingleEntry(BlockViewTransition.Type type, TrackedTileEntity<?> tileEntity, long modeToken, int worldEpoch) {
this.type = type;
this.tileEntity = tileEntity;
this.modeToken = modeToken;
@@ -115,13 +115,13 @@ public final class PackedBlockTransitionQueue {
}
private static final class PendingBatch implements Clearable {
private TransitionType.Tile t1, t2, t3, t4, t5, t6, t7, t8;
private BlockViewTransition.Type t1, t2, t3, t4, t5, t6, t7, t8;
private TrackedTileEntity<?> e1, e2, e3, e4, e5, e6, e7, e8;
private long modeToken;
private int worldEpoch;
private int count;
private void add(TransitionType.Tile type, TrackedTileEntity<?> tileEntity) {
private void add(BlockViewTransition.Type type, TrackedTileEntity<?> tileEntity) {
switch (++count) {
case 1 -> { t1 = type; e1 = tileEntity; }
case 2 -> { t2 = type; e2 = tileEntity; }
@@ -136,12 +136,22 @@ public final class PackedBlockTransitionQueue {
}
public void clear() {
t1 = null; t2 = null; t3 = null; t4 = null;
t5 = null; t6 = null; t7 = null; t8 = null;
e1 = null; e2 = null; e3 = null; e4 = null;
e5 = null; e6 = null; e7 = null; e8 = null;
t1 = null;
t2 = null;
t3 = null;
t4 = null;
t5 = null;
t6 = null;
t7 = null;
t8 = null;
e1 = null;
e2 = null;
e3 = null;
e4 = null;
e5 = null;
e6 = null;
e7 = null;
e8 = null;
modeToken = 0L;
worldEpoch = 0;
count = 0;
@@ -149,22 +159,29 @@ public final class PackedBlockTransitionQueue {
}
private static final class BatchEntry extends QueueEntry {
private final TransitionType.Tile t1, t2, t3, t4, t5, t6, t7, t8;
private final BlockViewTransition.Type t1, t2, t3, t4, t5, t6, t7, t8;
private final TrackedTileEntity<?> e1, e2, e3, e4, e5, e6, e7, e8;
private final long modeToken;
private final int worldEpoch;
private final int count;
private BatchEntry(PendingBatch pending) {
t1 = pending.t1; t2 = pending.t2;
t3 = pending.t3; t4 = pending.t4;
t5 = pending.t5; t6 = pending.t6;
t7 = pending.t7; t8 = pending.t8;
e1 = pending.e1; e2 = pending.e2;
e3 = pending.e3; e4 = pending.e4;
e5 = pending.e5; e6 = pending.e6;
e7 = pending.e7; e8 = pending.e8;
t1 = pending.t1;
t2 = pending.t2;
t3 = pending.t3;
t4 = pending.t4;
t5 = pending.t5;
t6 = pending.t6;
t7 = pending.t7;
t8 = pending.t8;
e1 = pending.e1;
e2 = pending.e2;
e3 = pending.e3;
e4 = pending.e4;
e5 = pending.e5;
e6 = pending.e6;
e7 = pending.e7;
e8 = pending.e8;
modeToken = pending.modeToken;
worldEpoch = pending.worldEpoch;
count = pending.count;
@@ -1,14 +1,14 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import games.cubi.utils.IntrusiveSPSCQueue;
import games.cubi.raycastedantiesp.core.tracked.TrackedEntity;
@@ -28,7 +28,7 @@ public final class PackedEntityTransitionQueue { //todo: potentially merge this
private final IntrusiveSPSCQueue<QueueEntry> publishedEntries = new IntrusiveSPSCQueue<>();
private final PendingBatch pending = new PendingBatch();
public void add(TransitionType.Entity type, TrackedEntity<?> entity, int worldEpoch) {
public void add(EntityViewTransition.Type type, TrackedEntity<?> entity, int worldEpoch) {
Objects.requireNonNull(type, "type");
Objects.requireNonNull(entity, "entity");
@@ -95,11 +95,11 @@ public final class PackedEntityTransitionQueue { //todo: potentially merge this
}
private static final class SingleEntry extends QueueEntry {
private final TransitionType.Entity type;
private final EntityViewTransition.Type type;
private final TrackedEntity<?> entity;
private final int worldEpoch;
private SingleEntry(TransitionType.Entity type, TrackedEntity<?> entity, int worldEpoch) {
private SingleEntry(EntityViewTransition.Type type, TrackedEntity<?> entity, int worldEpoch) {
this.type = type;
this.entity = entity;
this.worldEpoch = worldEpoch;
@@ -112,12 +112,26 @@ public final class PackedEntityTransitionQueue { //todo: potentially merge this
}
private static final class PendingBatch implements Clearable {
private TransitionType.Entity t1, t2, t3, t4, t5, t6, t7, t8;
private TrackedEntity<?> e1, e2, e3, e4, e5, e6, e7, e8;
private EntityViewTransition.Type t1;
private EntityViewTransition.Type t2;
private EntityViewTransition.Type t3;
private EntityViewTransition.Type t4;
private EntityViewTransition.Type t5;
private EntityViewTransition.Type t6;
private EntityViewTransition.Type t7;
private EntityViewTransition.Type t8;
private TrackedEntity<?> e1;
private TrackedEntity<?> e2;
private TrackedEntity<?> e3;
private TrackedEntity<?> e4;
private TrackedEntity<?> e5;
private TrackedEntity<?> e6;
private TrackedEntity<?> e7;
private TrackedEntity<?> e8;
private int worldEpoch;
private int count;
private void add(TransitionType.Entity type, TrackedEntity<?> entity) {
private void add(EntityViewTransition.Type type, TrackedEntity<?> entity) {
switch (++count) {
case 1 -> { t1 = type; e1 = entity; }
case 2 -> { t2 = type; e2 = entity; }
@@ -132,33 +146,64 @@ public final class PackedEntityTransitionQueue { //todo: potentially merge this
}
public void clear() {
t1 = null; t2 = null; t3 = null; t4 = null;
t5 = null; t6 = null; t7 = null; t8 = null;
e1 = null; e2 = null; e3 = null; e4 = null;
e5 = null; e6 = null; e7 = null; e8 = null;
t1 = null;
t2 = null;
t3 = null;
t4 = null;
t5 = null;
t6 = null;
t7 = null;
t8 = null;
e1 = null;
e2 = null;
e3 = null;
e4 = null;
e5 = null;
e6 = null;
e7 = null;
e8 = null;
worldEpoch = 0;
count = 0;
}
}
private static final class BatchEntry extends QueueEntry {
private final TransitionType.Entity t1, t2, t3, t4, t5, t6, t7, t8;
private final TrackedEntity<?> e1, e2, e3, e4, e5, e6, e7, e8;
private final EntityViewTransition.Type t1;
private final EntityViewTransition.Type t2;
private final EntityViewTransition.Type t3;
private final EntityViewTransition.Type t4;
private final EntityViewTransition.Type t5;
private final EntityViewTransition.Type t6;
private final EntityViewTransition.Type t7;
private final EntityViewTransition.Type t8;
private final TrackedEntity<?> e1;
private final TrackedEntity<?> e2;
private final TrackedEntity<?> e3;
private final TrackedEntity<?> e4;
private final TrackedEntity<?> e5;
private final TrackedEntity<?> e6;
private final TrackedEntity<?> e7;
private final TrackedEntity<?> e8;
private final int worldEpoch;
private final int count;
private BatchEntry(PendingBatch pending) {
t1 = pending.t1; t2 = pending.t2;
t3 = pending.t3; t4 = pending.t4;
t5 = pending.t5; t6 = pending.t6;
t7 = pending.t7; t8 = pending.t8;
e1 = pending.e1; e2 = pending.e2;
e3 = pending.e3; e4 = pending.e4;
e5 = pending.e5; e6 = pending.e6;
e7 = pending.e7; e8 = pending.e8;
t1 = pending.t1;
t2 = pending.t2;
t3 = pending.t3;
t4 = pending.t4;
t5 = pending.t5;
t6 = pending.t6;
t7 = pending.t7;
t8 = pending.t8;
e1 = pending.e1;
e2 = pending.e2;
e3 = pending.e3;
e4 = pending.e4;
e5 = pending.e5;
e6 = pending.e6;
e7 = pending.e7;
e8 = pending.e8;
worldEpoch = pending.worldEpoch;
count = pending.count;
}
@@ -1,21 +0,0 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
public interface TransitionType {
enum Entity {
SHOW,
HIDE,
FORGET,
}
enum Tile {
SHOW,
HIDE,
}
}
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.view.controller;
@@ -18,7 +18,7 @@ import games.cubi.raycastedantiesp.core.tracked.NettyEntity;
import games.cubi.raycastedantiesp.core.players.NettyData;
import games.cubi.raycastedantiesp.core.players.PlayerData;
import games.cubi.raycastedantiesp.core.players.PlayerRegistry;
import games.cubi.utils.lists.PrimitiveIntArrayList;
import games.cubi.raycastedantiesp.core.utils.PrimitiveIntArrayList;
import games.cubi.raycastedantiesp.core.utils.Packet;
import games.cubi.raycastedantiesp.core.view.EntityView;
import it.unimi.dsi.fastutil.ints.IntArrayList;
@@ -253,7 +253,7 @@ public abstract class PacketEntityViewController<P> {
protected boolean handleEntityPassengers(int entityID, int[] passengers, PlayerData playerData, int currentTick) {
boolean bypassedVehicle = EntityBypassRegistry.isBypassed(entityID);
NettyEntity<?> vehicle = bypassedVehicle ? null : playerData.entityFromID(entityID);
final int[] previousPassengers = getPreviousPassengerState(entityID, vehicle, playerData);
int[] previousPassengers = getPreviousPassengerState(entityID, vehicle, playerData);
playerData.nettyData().consumeUnresolvedPassengers(entityID); // throw away any unresolved passengers as this new packet will have the correct passenger list
// "Stale" passengers are passengers that the previous authoritative state said were mounted,
// but the new full replacement passenger list no longer contains.
@@ -336,19 +336,19 @@ public abstract class PacketEntityViewController<P> {
private int[] getPreviousPassengerState(int vehicleID, NettyEntity<?> vehicle, PlayerData playerData) {
if (vehicle != null) {
final int[] previousPassengerIDs = vehicle.passengerIDsNoAlloc();
int[] previousPassengerIDs = vehicle.passengerIDs();
if (!PrimitiveIntArrayList.isEmpty(previousPassengerIDs)) {
return previousPassengerIDs;
}
}
return playerData.nettyData().getUnresolvedPassengersNoAlloc(vehicleID);
return playerData.nettyData().getUnresolvedPassengers(vehicleID);
}
/**
* Clears reverse vehicle links for passengers that were part of the previous vehicle state,
* but are absent from the new authoritative replacement list.
*/
private void clearStalePassengerReferences(int vehicleID, final int[] previousPassengers, int[] newPassengers, PlayerData playerData) {
private void clearStalePassengerReferences(int vehicleID, int[] previousPassengers, int[] newPassengers, PlayerData playerData) {
if (PrimitiveIntArrayList.isEmpty(previousPassengers)) {
return;
}
@@ -420,7 +420,7 @@ public abstract class PacketEntityViewController<P> {
NettyEntity<?> unresolvedVehicle = playerData.entityFromID(unresolvedVehicleID);
if (unresolvedVehicle != null) {
// this can occur if the vehicle existed at the time of the passenger packet but not the passenger, and somehow the passenger never got resolved to the vehicle (missing spawn packets etc). In reality this should never happen.
unresolvedVehicle.setPassengerIDs(PrimitiveIntArrayList.remove(unresolvedVehicle.passengerIDsNoAlloc(), entityID));
unresolvedVehicle.setPassengerIDs(PrimitiveIntArrayList.remove(unresolvedVehicle.passengerIDs(), entityID));
}
}
@@ -429,7 +429,7 @@ public abstract class PacketEntityViewController<P> {
return;
}
int[] currentPassengerIDs = entity.passengerIDsNoAlloc();
int[] currentPassengerIDs = entity.passengerIDs();
if (!PrimitiveIntArrayList.isEmpty(currentPassengerIDs)) {
for (int passengerID : currentPassengerIDs) {
NettyEntity<?> passenger = playerData.entityFromID(passengerID);
@@ -445,7 +445,7 @@ public abstract class PacketEntityViewController<P> {
}
NettyEntity<?> vehicle = playerData.entityFromID(vehicleID);
if (vehicle != null) {
vehicle.setPassengerIDs(PrimitiveIntArrayList.remove(vehicle.passengerIDsNoAlloc(), entityID));
vehicle.setPassengerIDs(PrimitiveIntArrayList.remove(vehicle.passengerIDs(), entityID));
}
entity.setVehicleID(NO_VEHICLE);
}
@@ -481,7 +481,7 @@ public abstract class PacketEntityViewController<P> {
}
// A tracked entity owns the same two relationship directions in its resolved state.
final int[] currentLeashedEntityIDs = entity.leashedEntityIDsOrNullNoAlloc();
int[] currentLeashedEntityIDs = entity.leashedEntityIDsOrNull();
if (!PrimitiveIntArrayList.isEmpty(currentLeashedEntityIDs)) {
for (int leashedEntityID : currentLeashedEntityIDs) {
NettyEntity<?> leashedEntity = playerData.entityFromID(leashedEntityID);
@@ -630,7 +630,7 @@ public abstract class PacketEntityViewController<P> {
* 2. this entity is the passenger and the vehicle was already known.
*/
protected void reconcileUnresolvedPassengers(NettyEntity<?> insertedEntity, PlayerData playerData) {
int[] pendingPassengers = playerData.nettyData().getUnresolvedPassengersNoAlloc(insertedEntity.entityID());
int[] pendingPassengers = playerData.nettyData().getUnresolvedPassengers(insertedEntity.entityID());
if (!PrimitiveIntArrayList.isEmpty(pendingPassengers)) {
playerData.nettyData().consumeUnresolvedPassengers(insertedEntity.entityID());
handleEntityPassengersNow(insertedEntity, pendingPassengers, playerData, insertedEntity.lastChecked());
@@ -665,7 +665,7 @@ public abstract class PacketEntityViewController<P> {
// Vanilla may send entity state before its spawn packet, and those packets were already
// forwarded to the client. Discard deferred tracking work rather than replaying duplicates.
playerData.nettyData().clearPendingPostSpawnTasksForEntity(entityID);
int[] pendingPassengers = playerData.nettyData().getUnresolvedPassengersNoAlloc(entityID);
int[] pendingPassengers = playerData.nettyData().getUnresolvedPassengers(entityID);
if (!PrimitiveIntArrayList.isEmpty(pendingPassengers)) {
for (int passengerID : pendingPassengers) {
NettyEntity<?> passenger = playerData.entityFromID(passengerID);
@@ -684,7 +684,7 @@ public abstract class PacketEntityViewController<P> {
holder.addLeashedEntity(entityID);
}
}
int[] pendingLeashedEntityIDs = playerData.nettyData().getUnresolvedLeashesNoAlloc(entityID);
int[] pendingLeashedEntityIDs = playerData.nettyData().getUnresolvedLeashes(entityID);
if (!PrimitiveIntArrayList.isEmpty(pendingLeashedEntityIDs)) {
for (int leashedEntityID : pendingLeashedEntityIDs) {
NettyEntity<?> leashedEntity = playerData.entityFromID(leashedEntityID);
@@ -714,7 +714,7 @@ public abstract class PacketEntityViewController<P> {
}
}
int[] pendingLeashedEntityIDs = playerData.nettyData().getUnresolvedLeashesNoAlloc(entityID);
int[] pendingLeashedEntityIDs = playerData.nettyData().getUnresolvedLeashes(entityID);
if (PrimitiveIntArrayList.isEmpty(pendingLeashedEntityIDs)) {
return;
}
@@ -747,15 +747,15 @@ public abstract class PacketEntityViewController<P> {
if (!vehicle.clientVisible() || (keepingClientEntityWhenHidden(vehicle, playerData) && !vehicle.visible())) {
return;
}
sendEntityPassengerPacket(vehicle.entityID(), collectClientVisiblePassengers(vehicle.passengerIDsNoAlloc(), playerData), playerData);
sendEntityPassengerPacket(vehicle.entityID(), collectClientVisiblePassengers(vehicle.passengerIDs(), playerData), playerData);
}
protected IntArrayList collectClientVisiblePassengers(final int[] passengerIDs, PlayerData playerData) {
protected IntArrayList collectClientVisiblePassengers(int[] passengerIDs, PlayerData playerData) {
// HackyEntityIDGuard reserves -1, so it cannot accidentally match an entity being shown.
return collectClientVisiblePassengers(passengerIDs, playerData, -1);
}
protected IntArrayList collectClientVisiblePassengers(final int[] passengerIDs, PlayerData playerData, int entityBeingShownID) {
protected IntArrayList collectClientVisiblePassengers(int[] passengerIDs, PlayerData playerData, int entityBeingShownID) {
int size = passengerIDs == null ? 0 : passengerIDs.length;
IntArrayList visiblePassengers = new IntArrayList(size);
if (passengerIDs == null) {
@@ -1,12 +1,12 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.paper;
package games.cubi.raycastedantiesp.core;
import games.cubi.raycastedantiesp.core.utils.BuildProperties.Version;
import org.junit.jupiter.api.Test;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.chunks;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.config.raycast;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.engine;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.players;
@@ -1,9 +1,9 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.raycast;
@@ -1,14 +1,14 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright © 2026 Cubicake.
* This file is part of RaycastedAntiESP. RaycastedAntiESP is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at
* https://www.gnu.org/licenses/agpl-3.0.html. See README.md for warranty disclaimer and further information.
* This file is part of RaycastedAntiESP.
* RaycastedAntiESP is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3.0 only, which can be accessed at https://www.gnu.org/licenses/agpl-3.0.html.
* See README.md for warranty disclaimer and further information.
*/
package games.cubi.raycastedantiesp.core.tracked;
import games.cubi.utils.Clearable;
import games.cubi.raycastedantiesp.core.utils.Clearable;
import org.junit.jupiter.api.Test;
import java.time.Duration;
@@ -19,8 +19,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -89,27 +87,6 @@ class NettyEntityTrackedStateTest {
});
}
@Test
void relationshipSnapshotsRemainDefensiveWhileInternalAccessorsDoNotCopy() {
TestEntity entity = new TestEntity();
entity.setPassengerIDs(new int[]{2, 3});
entity.addLeashedEntity(4);
int[] passengerSnapshot = entity.passengerIDs();
int[] passengerInternal = entity.passengerIDsNoAlloc();
assertNotSame(passengerSnapshot, passengerInternal);
passengerSnapshot[0] = 99;
assertEquals(2, passengerInternal[0]);
assertSame(passengerInternal, entity.passengerIDsNoAlloc());
int[] leashSnapshot = entity.leashedEntityIDsOrNull();
int[] leashInternal = entity.leashedEntityIDsOrNullNoAlloc();
assertNotSame(leashSnapshot, leashInternal);
leashSnapshot[0] = 99;
assertEquals(4, leashInternal[0]);
assertSame(leashInternal, entity.leashedEntityIDsOrNullNoAlloc());
}
private static final class TestEntity extends NettyEntity<Clearable> {
private TestEntity() {
super(null, 0, 0, 0, 1, UUID.randomUUID(), false, 0, true);
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff. Show more