mirror of
https://github.com/Cubicake/RaycastedAntiESP.git
synced 2026-11-17 06:26:04 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e74a1ba15 | ||
|
|
9a822af8bc | ||
|
|
c6afbf0733 | ||
|
|
4eaa11b193 | ||
|
|
258e47c39f | ||
|
|
c825a4af96 |
No files matched your search
@@ -8,7 +8,6 @@
|
||||
|
||||
package games.cubi.raycastedantiesp.core.engine;
|
||||
|
||||
import games.cubi.locatables.api.ImmutableSpatial;
|
||||
import games.cubi.locatables.api.Locatable;
|
||||
import games.cubi.logs.Logger;
|
||||
import games.cubi.raycastedantiesp.core.config.ConfigManager;
|
||||
@@ -25,6 +24,8 @@ import games.cubi.raycastedantiesp.core.raycast.RaycastUtil;
|
||||
import games.cubi.raycastedantiesp.core.utils.PrimitiveIntArrayList;
|
||||
import games.cubi.raycastedantiesp.core.view.BlockView;
|
||||
import games.cubi.raycastedantiesp.core.view.EntityView;
|
||||
import games.cubi.utils.events.CancellableEvent;
|
||||
import games.cubi.utils.events.CancellableEventRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -120,6 +121,9 @@ public abstract class AsyncEngine implements Engine {
|
||||
}
|
||||
}
|
||||
|
||||
public static class EngineTickEvent extends CancellableEvent {}
|
||||
|
||||
public final CancellableEventRegistry<EngineTickEvent> engineTickEventRegistry = new CancellableEventRegistry<>();
|
||||
/**
|
||||
* Claims worker capacity and either runs work immediately or schedules worker batches.
|
||||
*
|
||||
@@ -127,6 +131,11 @@ public abstract class AsyncEngine implements Engine {
|
||||
* lifecycle; false if this attempt was skipped or cleaned up during setup.
|
||||
*/
|
||||
private boolean dispatchTick(int scheduledTick, int startTick, long scheduledNanos) {
|
||||
if (!engineTickEventRegistry.dispatch(EngineTickEvent::new)) {
|
||||
Logger.debug("Skipping tick due to event being cancelled");
|
||||
finishTickState();
|
||||
return false;
|
||||
}
|
||||
int threads = config.getEngineConfig().asyncConfig().asyncProcessingThreads();
|
||||
if (threads < 1) threads = 1;
|
||||
|
||||
|
||||
+1
-1
Submodule leafpile updated: dca89261e9...d49fa5bc39.
+1
-1
Submodule locatables updated: 7de6bff030...97ff3c29dc.
@@ -21,7 +21,6 @@ repositories {
|
||||
maven { url = uri("https://repo.codemc.io/repository/maven-releases/") }
|
||||
maven { url = uri("https://repo.codemc.io/repository/maven-snapshots/") }
|
||||
maven { url = uri("https://eldonexus.de/repository/maven-public/") }
|
||||
maven("https://repo.fancyinnovations.com/releases")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -31,9 +30,6 @@ dependencies {
|
||||
compileOnly("org.spongepowered:configurate-core:4.2.0")
|
||||
compileOnly("org.spongepowered:configurate-yaml:4.2.0")
|
||||
|
||||
compileOnly("de.oliver:FancyHolograms:2.9.1")
|
||||
compileOnly("de.oliver:FancyNpcs:2.9.2")
|
||||
|
||||
compileOnly("net.strokkur.commands:annotations-paper:2.1.2")
|
||||
annotationProcessor("net.strokkur.commands:processor-paper:2.1.2")
|
||||
|
||||
|
||||
@@ -17,9 +17,10 @@ import games.cubi.raycastedantiesp.core.players.PlayerRegistry;
|
||||
import games.cubi.raycastedantiesp.paper.engine.PaperAsyncEngine;
|
||||
import games.cubi.raycastedantiesp.core.players.PlayerData;
|
||||
import games.cubi.raycastedantiesp.paper.utils.PaperListener;
|
||||
import games.cubi.utils.events.CancellableEvent;
|
||||
import games.cubi.utils.events.CancellableEventRegistry;
|
||||
import io.papermc.paper.event.player.PlayerClientLoadedWorldEvent;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -44,6 +45,9 @@ public class EventListener extends PaperListener {
|
||||
this.plugin = plugin;
|
||||
this.engine = engine;
|
||||
this.currentTickSupplier = currentTickSupplier;
|
||||
playerValidityCheckEventRegistry.register(CancellableEventRegistry.Order.NORMAL, (event) -> {
|
||||
if (event.player.hasMetadata("NPC")) event.cancel();
|
||||
});
|
||||
}
|
||||
|
||||
public static EventListener initialise(RaycastedAntiESP plugin, PaperAsyncEngine engine, IntSupplier currentTickSupplier) {
|
||||
@@ -58,11 +62,23 @@ public class EventListener extends PaperListener {
|
||||
EntityBypassRegistry.markEntityDespawned(event.getEntity().getEntityId());
|
||||
}
|
||||
|
||||
public static final class PlayerValidityCheckEvent extends CancellableEvent {
|
||||
public final Player player;
|
||||
PlayerValidityCheckEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If this event is cancelled, player join processing will be skipped for this entity
|
||||
*/
|
||||
public static final CancellableEventRegistry<PlayerValidityCheckEvent> playerValidityCheckEventRegistry = new CancellableEventRegistry<PlayerValidityCheckEvent>();
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST) //Runs first
|
||||
public void onPlayerJoin(PlayerClientLoadedWorldEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
|
||||
if (player.hasMetadata("NPC")) return;
|
||||
if (!playerValidityCheckEventRegistry.dispatch(new PlayerValidityCheckEvent(player))) return;
|
||||
|
||||
PlayerData playerData = PlayerRegistry.getInstance().getPlayerData(player.getUniqueId());
|
||||
if (playerData == null) {
|
||||
|
||||
-78
@@ -1,78 +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.paper;
|
||||
|
||||
import de.oliver.fancyholograms.api.events.*;
|
||||
import de.oliver.fancyholograms.api.hologram.Hologram;
|
||||
import de.oliver.fancynpcs.api.events.NpcCreateEvent;
|
||||
import de.oliver.fancynpcs.api.events.NpcModifyEvent;
|
||||
import de.oliver.fancynpcs.api.events.NpcSpawnEvent;
|
||||
import games.cubi.logs.Logger;
|
||||
import games.cubi.raycastedantiesp.core.entity.EntityBypassRegistry;
|
||||
import games.cubi.raycastedantiesp.paper.utils.PaperListener;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
// Entity remove events aren't listened to because the event names are a bit confusing to me and I'm unclear when each event is called.
|
||||
// This should not be an issue as NPCs and Holograms are typically static entities which are not spawned or unspawned.
|
||||
public class FancyCompatibility {
|
||||
FancyCompatibility() {
|
||||
Logger.info("Attempting to initiate FancyNPCs and FancyHolograms compatibility layer. If you are not using those plugins, you will see an error. This is safe to ignore.", 5);
|
||||
new NPCs();
|
||||
new Holograms();
|
||||
}
|
||||
|
||||
static class NPCs extends PaperListener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void npcLoad(NpcSpawnEvent event) {
|
||||
int id = event.getNpc().getEntityId();
|
||||
Logger.info("NpcSpawnEvent called, adding entity: " + id, 1);
|
||||
EntityBypassRegistry.addEntity(id);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void npcLoad(NpcCreateEvent event) {
|
||||
int id = event.getNpc().getEntityId();
|
||||
Logger.info("NpcCreateEvent called, adding entity: " + id, 1);
|
||||
EntityBypassRegistry.addEntity(id);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void npcLoad(NpcModifyEvent event) {
|
||||
int id = event.getNpc().getEntityId();
|
||||
Logger.info("NpcModifyEvent called, adding entity: " + id, 1);
|
||||
EntityBypassRegistry.addEntity(id);
|
||||
}
|
||||
}
|
||||
|
||||
static class Holograms extends PaperListener {
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onHologramCreate(HologramCreateEvent event) {
|
||||
add(event.getHologram());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onHologramShow(HologramShowEvent event) {
|
||||
add(event.getHologram());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onHologramsLoaded(HologramsLoadedEvent event) {
|
||||
event.getManager().forEach(this::add);
|
||||
}
|
||||
|
||||
private void add(Hologram hologram) {
|
||||
int id = hologram.getEntityId();
|
||||
Logger.info("Hologram event called, adding entity: " + id, 1);
|
||||
EntityBypassRegistry.addEntity(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,6 @@ public final class RaycastedAntiESP extends JavaPlugin implements CommandExecuto
|
||||
}
|
||||
}, 1200, 1200);*/
|
||||
/*Do not delete, this is a legal notice*/Attribution.sendAttributionMessage(Bukkit.getConsoleSender()); // Legal notice as required by AGPLv3, it prominently offers users of this plugin the source code and displays an appropriate copyright notice. If you are a fork developer, do NOT remove this unless you have a thorough understanding of the AGPL and have replaced it with a suitable equivalent notice which is "prominently visible", displays the copyright notice, and includes a link to the source code of your fork which is accessible to all users of the plugin.
|
||||
new FancyCompatibility();
|
||||
}
|
||||
|
||||
private String parseTrackers(Set<Player> trackers) {
|
||||
|
||||
+7
-6
@@ -69,7 +69,8 @@ public class PacketEventsPaperBlockInfoResolver implements BlockInfoResolver {
|
||||
run = false;
|
||||
continue;
|
||||
}
|
||||
if (blockData.getMaterial() == Material.AIR) {
|
||||
Material material = blockData.getMaterial();
|
||||
if (material == Material.AIR) {
|
||||
airs++;
|
||||
if (airs > 80000) { // There is a sequence of ~40 air blocks around ID 100, and another of several hundred at ~3000. We scan forwards 80k to future-proof any mojank. Since it runs once at startup, perf is irrelevant here
|
||||
run = false;
|
||||
@@ -79,12 +80,12 @@ public class PacketEventsPaperBlockInfoResolver implements BlockInfoResolver {
|
||||
else {
|
||||
airs = 0;
|
||||
lastNonAirID = iterator;
|
||||
if (materialToIDMode) {
|
||||
Logger.info(blockData.getAsString() + iterator,1);
|
||||
}
|
||||
}
|
||||
|
||||
occlusion.put(iterator, blockData.getMaterial().isOccluding());
|
||||
boolean occluding = material != Material.BARRIER && material.isOccluding();
|
||||
if (materialToIDMode && material != Material.AIR) {
|
||||
Logger.info(blockData.getAsString() + iterator + occluding,1);
|
||||
}
|
||||
occlusion.put(iterator, occluding);
|
||||
try {
|
||||
if (blockData.createBlockState() instanceof TileState) {
|
||||
//Logger.debug("tile at" + iterator + " is tile entity" + material.name());
|
||||
|
||||
Reference in new issue
Block a user