2014-01-22 16:19:39 +08:00
|
|
|
From eb38a6812659dd0856232d86bd09699ee79f3298 Mon Sep 17 00:00:00 2001
|
2013-08-03 17:27:26 +08:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Sat, 3 Aug 2013 19:27:07 +1000
|
|
|
|
Subject: [PATCH] Player Collision API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-12-01 14:12:38 +08:00
|
|
|
index 7442943..f034d30 100644
|
2013-08-03 17:27:26 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-12-01 11:40:53 +08:00
|
|
|
@@ -430,7 +430,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
2013-08-03 17:27:26 +08:00
|
|
|
|
|
|
|
List list = this.world.getEntities(this, axisalignedbb);
|
|
|
|
|
|
|
|
- if (list != null) {
|
2013-12-01 14:12:38 +08:00
|
|
|
+ if (list != null && this.R()) { // Spigot: Add this.R() condition
|
2013-08-03 17:27:26 +08:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-12-14 14:58:22 +08:00
|
|
|
index d06ec7b..35b2f75 100644
|
2013-08-03 17:27:26 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-12-14 14:58:22 +08:00
|
|
|
@@ -1485,7 +1485,7 @@ public abstract class EntityLiving extends Entity {
|
2013-12-01 11:40:53 +08:00
|
|
|
protected void bo() {
|
2013-08-03 17:27:26 +08:00
|
|
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
|
|
|
|
|
|
- if (list != null && !list.isEmpty()) {
|
2013-12-01 14:12:38 +08:00
|
|
|
+ if (this.R() && list != null && !list.isEmpty()) { // Spigot: Add this.R() condition
|
2013-08-03 17:27:26 +08:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity = (Entity) list.get(i);
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2013-12-22 07:05:27 +08:00
|
|
|
index 4945955..ab39926 100644
|
2013-08-03 17:27:26 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2013-12-01 11:40:53 +08:00
|
|
|
@@ -64,6 +64,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
2013-08-03 17:27:26 +08:00
|
|
|
public double maxHealthCache;
|
2013-08-03 17:35:01 +08:00
|
|
|
public int lastPing = -1; // Spigot
|
2013-08-03 17:27:26 +08:00
|
|
|
// CraftBukkit end
|
|
|
|
+ // Spigot start
|
|
|
|
+ public boolean collidesWithEntities = true;
|
|
|
|
+
|
|
|
|
+ @Override
|
2013-12-01 14:12:38 +08:00
|
|
|
+ public boolean R()
|
2013-08-03 17:27:26 +08:00
|
|
|
+ {
|
2013-12-01 14:12:38 +08:00
|
|
|
+ return this.collidesWithEntities && super.R();
|
2013-08-03 17:27:26 +08:00
|
|
|
+ }
|
|
|
|
+
|
2013-12-01 14:12:38 +08:00
|
|
|
+ @Override
|
|
|
|
+ public boolean S()
|
2013-08-03 17:27:26 +08:00
|
|
|
+ {
|
2013-12-01 14:12:38 +08:00
|
|
|
+ return this.collidesWithEntities && super.S();
|
|
|
|
+ }
|
2013-08-03 17:27:26 +08:00
|
|
|
+ // Spigot end
|
|
|
|
|
2013-12-01 11:40:53 +08:00
|
|
|
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
|
|
|
super(worldserver, gameprofile);
|
2013-08-03 17:27:26 +08:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-01-21 12:32:54 +08:00
|
|
|
index 2542d56..eaffcdc 100644
|
2013-08-03 17:27:26 +08:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2014-01-21 12:32:54 +08:00
|
|
|
@@ -1259,6 +1259,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2013-12-01 11:40:53 +08:00
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|
2013-08-03 17:35:01 +08:00
|
|
|
+
|
2013-08-03 17:27:26 +08:00
|
|
|
+ @Override
|
|
|
|
+ public boolean getCollidesWithEntities()
|
|
|
|
+ {
|
|
|
|
+ return getHandle().collidesWithEntities;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCollidesWithEntities(boolean collides)
|
|
|
|
+ {
|
|
|
|
+ getHandle().collidesWithEntities = collides;
|
2013-12-01 13:17:16 +08:00
|
|
|
+ getHandle().l = collides; // First boolean of Entity
|
2013-08-03 17:27:26 +08:00
|
|
|
+ }
|
|
|
|
};
|
|
|
|
|
2013-08-03 17:59:46 +08:00
|
|
|
public Player.Spigot spigot()
|
2013-08-03 17:27:26 +08:00
|
|
|
--
|
2013-12-01 11:40:53 +08:00
|
|
|
1.8.3.2
|
2013-08-03 17:27:26 +08:00
|
|
|
|