Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ((in another class)private ConcurrentHashMap<UUID, List<Location>> tileEntityLocations = new ConcurrentHashMap<>();
- private ConcurrentHashMap<Location, Material> tileEntityMaterials = new ConcurrentHashMap<>();)
- public void checkChestVisibility() {
- for (Player player : Bukkit.getOnlinePlayers()) {
- if (previousplayerpos.containsKey(player.getUniqueId())) {
- if (!samelocation(previousplayerpos.get(player.getUniqueId()), player.getLocation())) {
- List<Location> tileEntityLocations = Overseer.getESPLoader().getPacketChestHider1_13().getTileEntityLocations(player.getUniqueId());
- if (tileEntityLocations != null) {
- List<Location> remove = new ArrayList<>();
- for (Location tLocation : tileEntityLocations) {
- Location loc = player.getLocation();
- World world = loc.getWorld();
- if (world != tLocation.getWorld()) {
- remove.add(tLocation);
- continue;
- }
- int distanceSquared = (int) player.getLocation().distanceSquared(tLocation);
- if (distanceSquared > 250 * 250) {
- remove.add(tLocation);
- continue;
- }
- if (distanceSquared < (8 * 8)) {
- changeBlock(player, tLocation);
- remove.add(tLocation);
- continue;
- }
- if (distanceSquared < 2500) {
- Vector3D actualEye = MathUtils.toUnitVector(
- Vector3D.fromLocation(player.getLocation().add(0, player.getEyeHeight(), 0)), 0.2,
- player.getLocation().getYaw(), player.getLocation().getPitch());
- boolean shouldSeeChest = Utils.roughcheckChest(actualEye, tLocation, ischest(tLocation));
- if (shouldSeeChest) {
- changeBlock(player, tLocation);
- remove.add(tLocation);
- }
- }
- }
- if (!remove.isEmpty()) {
- ConcurrentHashMap<Location, Material> tileentitymaterials = Overseer.getESPLoader().getPacketChestHider1_13().getTileEntityMaterials();
- for (Location l : remove) {
- tileEntityLocations.remove(l);
- tileentitymaterials.remove(l);
- }
- Overseer.getESPLoader().getPacketChestHider1_13().setTileEntityLocations(player.getUniqueId(), tileEntityLocations);
- Overseer.getESPLoader().getPacketChestHider1_13().setTileEntityMaterials(tileentitymaterials);
- }
- }
- }
- }
- previousplayerpos.put(player.getUniqueId(), player.getLocation());
- }
- }
- 29.03 08:55:44 [Server] WARN [Overseer] Plugin Overseer v1.0 generated an exception while executing task 41445
- 29.03 08:55:44 [Server] INFO java.util.ConcurrentModificationException: null
- 29.03 08:55:44 [Server] INFO at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) ~[?:1.8.0_212]
- 29.03 08:55:44 [Server] INFO at java.util.ArrayList$Itr.next(ArrayList.java:859) ~[?:1.8.0_212]
- 29.03 08:55:44 [Server] INFO at me.olly.overseer.AntiESP.v1_13.ChestHider.ChestHider1_13.checkChestVisibility(ChestHider1_13.java:30) ~[?:?]
- 29.03 08:55:44 [Server] INFO at me.olly.overseer.AntiESP.v1_13.Loader_v1_13.lambda$onEnable$0(Loader_v1_13.java:42) ~[?:?]
- 29.03 08:55:44 [Server] INFO at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-121]
- 29.03 08:55:44 [Server] INFO at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-121]
- 29.03 08:55:44 [Server] INFO at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-121]
- 29.03 08:55:44 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
- 29.03 08:55:44 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
- 29.03 08:55:44 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement