Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.78 KB | None | 0 0
  1. ((in another class)private ConcurrentHashMap<UUID, List<Location>> tileEntityLocations = new ConcurrentHashMap<>();
  2.     private ConcurrentHashMap<Location, Material> tileEntityMaterials = new ConcurrentHashMap<>();)
  3.  
  4. public void checkChestVisibility() {
  5.         for (Player player : Bukkit.getOnlinePlayers()) {
  6.             if (previousplayerpos.containsKey(player.getUniqueId())) {
  7.                 if (!samelocation(previousplayerpos.get(player.getUniqueId()), player.getLocation())) {
  8.                     List<Location> tileEntityLocations = Overseer.getESPLoader().getPacketChestHider1_13().getTileEntityLocations(player.getUniqueId());
  9.                     if (tileEntityLocations != null) {
  10.                         List<Location> remove = new ArrayList<>();
  11.                        for (Location tLocation : tileEntityLocations) {
  12.                             Location loc = player.getLocation();
  13.                             World world = loc.getWorld();
  14.  
  15.                             if (world != tLocation.getWorld()) {
  16.                                 remove.add(tLocation);
  17.                                 continue;
  18.                             }
  19.                             int distanceSquared = (int) player.getLocation().distanceSquared(tLocation);
  20.  
  21.                             if (distanceSquared > 250 * 250) {
  22.                                 remove.add(tLocation);
  23.                                 continue;
  24.                             }
  25.  
  26.                             if (distanceSquared < (8 * 8)) {
  27.                                 changeBlock(player, tLocation);
  28.                                 remove.add(tLocation);
  29.                                 continue;
  30.                             }
  31.  
  32.                             if (distanceSquared < 2500) {
  33.                              
  34.                                 Vector3D actualEye = MathUtils.toUnitVector(
  35.                                         Vector3D.fromLocation(player.getLocation().add(0, player.getEyeHeight(), 0)), 0.2,
  36.                                         player.getLocation().getYaw(), player.getLocation().getPitch());
  37.  
  38.                                 boolean shouldSeeChest = Utils.roughcheckChest(actualEye, tLocation, ischest(tLocation));
  39.  
  40.                                 if (shouldSeeChest) {
  41.                                     changeBlock(player, tLocation);
  42.                                     remove.add(tLocation);
  43.                                 }
  44.                             }
  45.                         }
  46.                         if (!remove.isEmpty()) {
  47.                             ConcurrentHashMap<Location, Material> tileentitymaterials = Overseer.getESPLoader().getPacketChestHider1_13().getTileEntityMaterials();
  48.                             for (Location l : remove) {
  49.                                 tileEntityLocations.remove(l);
  50.                                 tileentitymaterials.remove(l);
  51.                             }
  52.                             Overseer.getESPLoader().getPacketChestHider1_13().setTileEntityLocations(player.getUniqueId(), tileEntityLocations);
  53.                             Overseer.getESPLoader().getPacketChestHider1_13().setTileEntityMaterials(tileentitymaterials);
  54.                         }
  55.                     }
  56.                 }
  57.             }
  58.             previousplayerpos.put(player.getUniqueId(), player.getLocation());
  59.         }
  60.     }
  61.  
  62.  
  63. 29.03 08:55:44 [Server] WARN [Overseer] Plugin Overseer v1.0 generated an exception while executing task 41445
  64. 29.03 08:55:44 [Server] INFO java.util.ConcurrentModificationException: null
  65. 29.03 08:55:44 [Server] INFO at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) ~[?:1.8.0_212]
  66. 29.03 08:55:44 [Server] INFO at java.util.ArrayList$Itr.next(ArrayList.java:859) ~[?:1.8.0_212]
  67. 29.03 08:55:44 [Server] INFO at me.olly.overseer.AntiESP.v1_13.ChestHider.ChestHider1_13.checkChestVisibility(ChestHider1_13.java:30) ~[?:?]
  68. 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) ~[?:?]
  69. 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]
  70. 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]
  71. 29.03 08:55:44 [Server] INFO at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-121]
  72. 29.03 08:55:44 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
  73. 29.03 08:55:44 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
  74. 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