2013-02-19 16:43:00 +00:00
|
|
|
From e9079818151c8df92e2d927b0f4f3308d9cea113 Mon Sep 17 00:00:00 2001
|
2013-01-21 23:04:57 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Fri, 18 Jan 2013 19:31:14 -0500
|
|
|
|
Subject: [PATCH] Reduce number of LivingEntity collision checks.
|
|
|
|
|
|
|
|
---
|
|
|
|
src/main/java/net/minecraft/server/EntityLiving.java | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-02-19 16:43:00 +00:00
|
|
|
index b2481aa..bbbb008 100644
|
2013-01-21 23:04:57 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
@@ -1402,12 +1402,20 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void bd() {
|
|
|
|
+ // Spigot start
|
|
|
|
+ boolean skip = false;
|
|
|
|
+ if (!(this instanceof EntityPlayer) && this.ticksLived % 2 != 0) {
|
|
|
|
+ skip = true;
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
+
|
|
|
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
|
|
|
|
|
|
if (list != null && !list.isEmpty()) {
|
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
|
2013-02-19 16:43:00 +00:00
|
|
|
+ if (entity instanceof EntityLiving && skip) { continue; } // Spigot
|
2013-01-21 23:04:57 +00:00
|
|
|
if (entity.M()) {
|
|
|
|
this.o(entity);
|
|
|
|
}
|
|
|
|
--
|
2013-02-19 16:43:00 +00:00
|
|
|
1.8.1.1
|
2013-01-21 23:04:57 +00:00
|
|
|
|