2016-05-12 04:07:46 +02:00
|
|
|
From 71af32a912b140b221e5df8701fdefe297a19ceb Mon Sep 17 00:00:00 2001
|
2015-01-29 22:25:50 +01:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Mon, 29 Feb 2016 21:20:21 -0600
|
2014-12-06 05:28:08 +01:00
|
|
|
Subject: [PATCH] Vanished players don't have rights
|
2014-06-22 22:30:53 +02:00
|
|
|
|
2014-08-10 07:21:18 +02:00
|
|
|
|
2014-06-22 22:30:53 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
2016-05-12 04:07:46 +02:00
|
|
|
index 7593aa2..29b6f16 100644
|
2014-06-22 22:30:53 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
2016-05-12 04:07:46 +02:00
|
|
|
@@ -185,6 +185,14 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
}
|
2014-06-22 22:30:53 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Allow arrows to fly through vanished players the shooter can't see
|
2014-07-22 01:52:19 +02:00
|
|
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && shooter != null && shooter instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) shooter).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
2014-06-22 22:30:53 +02:00
|
|
|
+ movingobjectposition = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2014-06-22 22:30:53 +02:00
|
|
|
+
|
|
|
|
if (movingobjectposition != null) {
|
2016-03-01 00:09:49 +01:00
|
|
|
this.a(movingobjectposition);
|
|
|
|
}
|
2015-11-27 02:51:01 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
2016-05-12 04:07:46 +02:00
|
|
|
index c47b009..12e2303 100644
|
2015-11-27 02:51:01 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -198,6 +198,14 @@ public class EntityFishingHook extends Entity {
|
|
|
|
movingobjectposition = new MovingObjectPosition(entity);
|
|
|
|
}
|
2015-11-27 02:51:01 +01:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Allow fishing hooks to fly through vanished players the shooter can't see
|
|
|
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
|
|
|
+ movingobjectposition = null;
|
|
|
|
+ }
|
2015-11-27 02:51:01 +01:00
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-11-27 02:51:01 +01:00
|
|
|
+
|
2016-03-01 00:09:49 +01:00
|
|
|
if (movingobjectposition != null) {
|
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
|
|
|
|
if (movingobjectposition.entity != null) {
|
2014-07-22 01:52:19 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
2016-05-12 04:07:46 +02:00
|
|
|
index f47b148..0c36bad 100644
|
2014-07-22 01:52:19 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
2016-05-12 04:07:46 +02:00
|
|
|
@@ -158,6 +158,14 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
2016-03-01 00:09:49 +01:00
|
|
|
movingobjectposition = new MovingObjectPosition(entity);
|
2014-07-22 01:52:19 +02:00
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Allow projectiles to fly through vanished players the shooter can't see
|
2014-07-22 01:52:19 +02:00
|
|
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && shooter != null && shooter instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) shooter).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
|
|
|
+ movingobjectposition = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2014-07-22 01:52:19 +02:00
|
|
|
+
|
|
|
|
if (movingobjectposition != null) {
|
2015-03-08 02:16:09 +01:00
|
|
|
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.a()).getBlock() == Blocks.PORTAL) {
|
2016-03-01 00:09:49 +01:00
|
|
|
this.e(movingobjectposition.a());
|
2015-01-07 05:13:40 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
|
2016-05-12 04:07:46 +02:00
|
|
|
index b9aa1fc..6dbad10 100644
|
2015-01-07 05:13:40 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/ItemBlock.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
|
2016-05-12 04:07:46 +02:00
|
|
|
@@ -23,7 +23,7 @@ public class ItemBlock extends Item {
|
2016-03-01 00:09:49 +01:00
|
|
|
blockposition = blockposition.shift(enumdirection);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (itemstack.count != 0 && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, (Entity) null, itemstack)) {
|
|
|
|
+ if (itemstack.count != 0 && entityhuman.a(blockposition, enumdirection, itemstack) && world.a(this.a, blockposition, false, enumdirection, entityhuman, itemstack)) { // Paper - Pass entityhuman instead of null
|
2015-01-07 05:13:40 +01:00
|
|
|
int i = this.filterData(itemstack.getData());
|
|
|
|
IBlockData iblockdata1 = this.a.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityhuman);
|
|
|
|
|
2014-06-22 22:30:53 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2016-05-12 04:07:46 +02:00
|
|
|
index 0c3ed2d..e2a06f1 100644
|
2014-06-22 22:30:53 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2016-05-12 04:07:46 +02:00
|
|
|
@@ -1690,6 +1690,14 @@ public abstract class World implements IBlockAccess {
|
2014-06-22 22:30:53 +02:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity1 = (Entity) list.get(i);
|
2014-11-28 02:17:45 +01:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Allow block placement if the placer cannot see the vanished blocker
|
2014-07-22 01:52:19 +02:00
|
|
|
+ if (entity instanceof EntityPlayer && entity1 instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) entity).getBukkitEntity().canSee(((EntityPlayer) entity1).getBukkitEntity())) {
|
2014-06-22 22:30:53 +02:00
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2016-03-01 00:09:49 +01:00
|
|
|
if (!entity1.dead && entity1.i && entity1 != entity && (entity == null || entity1.x(entity))) {
|
2014-06-22 22:30:53 +02:00
|
|
|
return false;
|
2014-11-28 02:17:45 +01:00
|
|
|
}
|
2014-06-22 22:30:53 +02:00
|
|
|
--
|
2016-05-12 04:07:46 +02:00
|
|
|
2.8.2
|
2014-06-22 22:30:53 +02:00
|
|
|
|