2013-12-01 05:02:56 +00:00
|
|
|
From 7c62ad80df53048515179a7866b5918f8cd3f519 Mon Sep 17 00:00:00 2001
|
2013-08-03 09:27:26 +00: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 03:40:53 +00:00
|
|
|
index 7442943..14f5510 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-12-01 03:40:53 +00:00
|
|
|
@@ -430,7 +430,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
2013-08-03 09:27:26 +00:00
|
|
|
|
|
|
|
List list = this.world.getEntities(this, axisalignedbb);
|
|
|
|
|
|
|
|
- if (list != null) {
|
|
|
|
+ if (list != null && this.L()) { // Spigot: Add this.L() condition
|
|
|
|
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-01 03:40:53 +00:00
|
|
|
index a61001d..35d30f1 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2013-12-01 03:40:53 +00:00
|
|
|
@@ -1478,7 +1478,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
protected void bo() {
|
2013-08-03 09:27:26 +00:00
|
|
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
|
|
|
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
|
+ if (this.L() && list != null && !list.isEmpty()) { // Spigot: Add this.L() condition
|
|
|
|
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-01 03:40:53 +00:00
|
|
|
index af08d2f..d6a384b 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2013-12-01 03:40:53 +00:00
|
|
|
@@ -64,6 +64,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
2013-08-03 09:27:26 +00:00
|
|
|
public double maxHealthCache;
|
2013-08-03 09:35:01 +00:00
|
|
|
public int lastPing = -1; // Spigot
|
2013-08-03 09:27:26 +00:00
|
|
|
// CraftBukkit end
|
|
|
|
+ // Spigot start
|
|
|
|
+ public boolean collidesWithEntities = true;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean L()
|
|
|
|
+ {
|
|
|
|
+ return this.collidesWithEntities && super.L();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2013-09-20 01:46:45 +00:00
|
|
|
+ public boolean M()
|
2013-08-03 09:27:26 +00:00
|
|
|
+ {
|
2013-09-20 01:46:45 +00:00
|
|
|
+ return this.collidesWithEntities && super.M();
|
2013-08-03 09:27:26 +00:00
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
|
2013-12-01 03:40:53 +00:00
|
|
|
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
|
|
|
super(worldserver, gameprofile);
|
2013-08-03 09:27:26 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2013-12-01 03:40:53 +00:00
|
|
|
index 0b8b324..fb53781 100644
|
2013-08-03 09:27:26 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2013-12-01 03:40:53 +00:00
|
|
|
@@ -1130,6 +1130,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
// Spigot start
|
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|
|
|
|
{
|
2013-08-03 09:35:01 +00:00
|
|
|
+
|
2013-08-03 09:27:26 +00:00
|
|
|
+ @Override
|
|
|
|
+ public boolean getCollidesWithEntities()
|
|
|
|
+ {
|
|
|
|
+ return getHandle().collidesWithEntities;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCollidesWithEntities(boolean collides)
|
|
|
|
+ {
|
|
|
|
+ getHandle().collidesWithEntities = collides;
|
|
|
|
+ getHandle().m = collides; // First boolean of Entity
|
|
|
|
+ }
|
|
|
|
};
|
|
|
|
|
2013-08-03 09:59:46 +00:00
|
|
|
public Player.Spigot spigot()
|
2013-08-03 09:27:26 +00:00
|
|
|
--
|
2013-12-01 03:40:53 +00:00
|
|
|
1.8.3.2
|
2013-08-03 09:27:26 +00:00
|
|
|
|