2013-04-03 15:20:29 +08:00
|
|
|
From a7074cb42a6e61500be1926ddf1af17e07f4986f Mon Sep 17 00:00:00 2001
|
2013-01-22 07:04:57 +08:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Fri, 18 Jan 2013 19:31:14 -0500
|
|
|
|
Subject: [PATCH] Reduce number of LivingEntity collision checks.
|
|
|
|
|
|
|
|
---
|
2013-04-03 15:20:29 +08:00
|
|
|
.../java/net/minecraft/server/EntityLiving.java | 8 ++++++++
|
|
|
|
1 files changed, 8 insertions(+), 0 deletions(-)
|
2013-01-22 07:04:57 +08:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-03-25 15:57:00 +08:00
|
|
|
index 14854ac..322e37f 100644
|
2013-01-22 07:04:57 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-03-25 15:57:00 +08:00
|
|
|
@@ -1430,12 +1430,20 @@ public abstract class EntityLiving extends Entity {
|
2013-01-22 07:04:57 +08:00
|
|
|
}
|
|
|
|
|
2013-03-16 05:35:56 +08:00
|
|
|
protected void bg() {
|
2013-01-22 07:04:57 +08:00
|
|
|
+ // 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-20 00:43:00 +08:00
|
|
|
+ if (entity instanceof EntityLiving && skip) { continue; } // Spigot
|
2013-03-16 05:35:56 +08:00
|
|
|
if (entity.L()) {
|
2013-01-22 07:04:57 +08:00
|
|
|
this.o(entity);
|
|
|
|
}
|
|
|
|
--
|
2013-04-03 15:20:29 +08:00
|
|
|
1.7.0.4
|
2013-01-22 07:04:57 +08:00
|
|
|
|