mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-25 01:13:53 -07:00
Update to mcdev rename revision 01 for 1.8.1
This commit is contained in:
@@ -8,7 +8,7 @@ import java.util.Set;
|
||||
public class EntityTracker {
|
||||
|
||||
private Set a = new HashSet();
|
||||
private EntityList b = new EntityList();
|
||||
private EntityList trackedEntities = new EntityList();
|
||||
private MinecraftServer c;
|
||||
private int d;
|
||||
private int e;
|
||||
@@ -22,7 +22,7 @@ public class EntityTracker {
|
||||
// CraftBukkit - synchronized
|
||||
public synchronized void track(Entity entity) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
this.a(entity, 512, 2);
|
||||
this.addEntity(entity, 512, 2);
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
Iterator iterator = this.a.iterator();
|
||||
|
||||
@@ -33,55 +33,55 @@ public class EntityTracker {
|
||||
entitytrackerentry.b(entityplayer);
|
||||
}
|
||||
}
|
||||
} else if (entity instanceof EntityFish) {
|
||||
this.a(entity, 64, 5, true);
|
||||
} else if (entity instanceof EntityFishingHook) {
|
||||
this.addEntity(entity, 64, 5, true);
|
||||
} else if (entity instanceof EntityArrow) {
|
||||
this.a(entity, 64, 20, false);
|
||||
this.addEntity(entity, 64, 20, false);
|
||||
} else if (entity instanceof EntityFireball) {
|
||||
this.a(entity, 64, 10, false);
|
||||
this.addEntity(entity, 64, 10, false);
|
||||
} else if (entity instanceof EntitySnowball) {
|
||||
this.a(entity, 64, 10, true);
|
||||
this.addEntity(entity, 64, 10, true);
|
||||
} else if (entity instanceof EntityEgg) {
|
||||
this.a(entity, 64, 10, true);
|
||||
this.addEntity(entity, 64, 10, true);
|
||||
} else if (entity instanceof EntityItem) {
|
||||
this.a(entity, 64, 20, true);
|
||||
this.addEntity(entity, 64, 20, true);
|
||||
} else if (entity instanceof EntityMinecart) {
|
||||
this.a(entity, 160, 5, true);
|
||||
this.addEntity(entity, 160, 5, true);
|
||||
} else if (entity instanceof EntityBoat) {
|
||||
this.a(entity, 160, 5, true);
|
||||
this.addEntity(entity, 160, 5, true);
|
||||
} else if (entity instanceof EntitySquid) {
|
||||
this.a(entity, 160, 3, true);
|
||||
this.addEntity(entity, 160, 3, true);
|
||||
} else if (entity instanceof IAnimal) {
|
||||
this.a(entity, 160, 3, true);
|
||||
this.addEntity(entity, 160, 3, true);
|
||||
} else if (entity instanceof EntityTNTPrimed) {
|
||||
this.a(entity, 160, 10, true);
|
||||
this.addEntity(entity, 160, 10, true);
|
||||
} else if (entity instanceof EntityFallingSand) {
|
||||
this.a(entity, 160, 20, true);
|
||||
this.addEntity(entity, 160, 20, true);
|
||||
} else if (entity instanceof EntityPainting) {
|
||||
this.a(entity, 160, Integer.MAX_VALUE, false);
|
||||
this.addEntity(entity, 160, Integer.MAX_VALUE, false);
|
||||
} else if (entity instanceof EntityExperienceOrb) {
|
||||
this.a(entity, 160, 20, true);
|
||||
this.addEntity(entity, 160, 20, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Entity entity, int i, int j) {
|
||||
this.a(entity, i, j, false);
|
||||
public void addEntity(Entity entity, int i, int j) {
|
||||
this.addEntity(entity, i, j, false);
|
||||
}
|
||||
|
||||
// CraftBukkit - synchronized
|
||||
public synchronized void a(Entity entity, int i, int j, boolean flag) {
|
||||
public synchronized void addEntity(Entity entity, int i, int j, boolean flag) {
|
||||
if (i > this.d) {
|
||||
i = this.d;
|
||||
}
|
||||
|
||||
if (this.b.b(entity.id)) {
|
||||
if (this.trackedEntities.b(entity.id)) {
|
||||
// CraftBukkit - removed exception throw as tracking an already tracked entity theoretically shouldn't cause any issues.
|
||||
// throw new IllegalStateException("Entity is already tracked!");
|
||||
} else {
|
||||
EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entity, i, j, flag);
|
||||
|
||||
this.a.add(entitytrackerentry);
|
||||
this.b.a(entity.id, entitytrackerentry);
|
||||
this.trackedEntities.a(entity.id, entitytrackerentry);
|
||||
entitytrackerentry.scanPlayers(this.c.getWorldServer(this.e).players);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class EntityTracker {
|
||||
}
|
||||
}
|
||||
|
||||
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) this.b.d(entity.id);
|
||||
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) this.trackedEntities.d(entity.id);
|
||||
|
||||
if (entitytrackerentry1 != null) {
|
||||
this.a.remove(entitytrackerentry1);
|
||||
@@ -137,7 +137,7 @@ public class EntityTracker {
|
||||
|
||||
// CraftBukkit - synchronized
|
||||
public synchronized void a(Entity entity, Packet packet) {
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.b.a(entity.id);
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntities.a(entity.id);
|
||||
|
||||
if (entitytrackerentry != null) {
|
||||
entitytrackerentry.a(packet);
|
||||
@@ -146,7 +146,7 @@ public class EntityTracker {
|
||||
|
||||
// CraftBukkit - synchronized
|
||||
public synchronized void sendPacketToEntity(Entity entity, Packet packet) {
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.b.a(entity.id);
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntities.a(entity.id);
|
||||
|
||||
if (entitytrackerentry != null) {
|
||||
entitytrackerentry.b(packet);
|
||||
|
Reference in New Issue
Block a user