mirror of
https://github.com/Elecast2/EntityTrackerFixer.git
synced 2024-11-25 11:25:31 +01:00
apply lastest changes to 1.14 and 1.15
This commit is contained in:
parent
370af0f6f7
commit
45f26c28e9
@ -1,6 +1,6 @@
|
||||
name: EntityTrackerFixer
|
||||
main: net.minemora.entitytrackerfixer.EntityTrackerFixer
|
||||
version: 1.2.6
|
||||
version: 1.2.7
|
||||
api-version: 1.14
|
||||
author: Esmorall
|
||||
description: Untrack entities that are not used at all by the server.
|
||||
|
@ -29,9 +29,6 @@ public final class NMSEntityTracker {
|
||||
public static void trackEntities(ChunkProviderServer cps, Set<net.minecraft.server.v1_14_R1.Entity> trackList) {
|
||||
try {
|
||||
for(net.minecraft.server.v1_14_R1.Entity entity : trackList) {
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(entity.getId())) {
|
||||
continue;
|
||||
}
|
||||
addEntityMethod.invoke(cps.playerChunkMap, entity);
|
||||
}
|
||||
} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
|
@ -39,6 +39,10 @@ public class CheckTask extends BukkitRunnable {
|
||||
int d = ConfigMain.getTrackingRange();
|
||||
for(Player player : Bukkit.getWorld(worldName).getPlayers()) {
|
||||
for(Entity ent : player.getNearbyEntities(d, d, d)) {
|
||||
net.minecraft.server.v1_14_R1.Entity nms = ((CraftEntity)ent).getHandle();
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(nms.getId()) || !nms.valid) {
|
||||
continue;
|
||||
}
|
||||
trackAgain.add(((CraftEntity)ent).getHandle());
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,6 @@ public final class NMSEntityTracker {
|
||||
public static void trackEntities(ChunkProviderServer cps, Set<net.minecraft.server.v1_15_R1.Entity> trackList) {
|
||||
try {
|
||||
for(net.minecraft.server.v1_15_R1.Entity entity : trackList) {
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(entity.getId())) {
|
||||
continue;
|
||||
}
|
||||
addEntityMethod.invoke(cps.playerChunkMap, entity);
|
||||
}
|
||||
} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
|
@ -39,6 +39,10 @@ public class CheckTask extends BukkitRunnable {
|
||||
int d = ConfigMain.getTrackingRange();
|
||||
for(Player player : Bukkit.getWorld(worldName).getPlayers()) {
|
||||
for(Entity ent : player.getNearbyEntities(d, d, d)) {
|
||||
net.minecraft.server.v1_15_R1.Entity nms = ((CraftEntity)ent).getHandle();
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(nms.getId()) || !nms.valid) {
|
||||
continue;
|
||||
}
|
||||
trackAgain.add(((CraftEntity)ent).getHandle());
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,7 @@ public class CheckTask extends BukkitRunnable {
|
||||
for(Player player : Bukkit.getWorld(worldName).getPlayers()) {
|
||||
for(Entity ent : player.getNearbyEntities(d, d, d)) {
|
||||
net.minecraft.server.v1_16_R1.Entity nms = ((CraftEntity)ent).getHandle();
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(nms.getId())) {
|
||||
continue;
|
||||
}
|
||||
if(!nms.valid) {
|
||||
if(cps.playerChunkMap.trackedEntities.containsKey(nms.getId()) || !nms.valid) {
|
||||
continue;
|
||||
}
|
||||
trackAgain.add(nms);
|
||||
|
Loading…
Reference in New Issue
Block a user