2014-11-28 01:17:45 +00:00
|
|
|
From 7772412950502bba4c4f2b0ddb765ff274b554b6 Mon Sep 17 00:00:00 2001
|
2014-06-22 20:30:53 +00:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-11-28 01:17:45 +00:00
|
|
|
Date: Fri, 28 Nov 2014 00:35:56 -0600
|
2014-06-22 20:30:53 +00:00
|
|
|
Subject: [PATCH] Invisible players don't have rights
|
|
|
|
|
2014-08-10 05:21:18 +00:00
|
|
|
|
2014-06-22 20:30:53 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
2014-11-28 01:17:45 +00:00
|
|
|
index 7d1727d..d1c588a 100644
|
2014-06-22 20:30:53 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -221,6 +221,14 @@ public class EntityArrow extends Entity implements IProjectile {
|
2014-06-22 20:30:53 +00:00
|
|
|
float f3;
|
2014-11-28 01:17:45 +00:00
|
|
|
float f4;
|
2014-06-22 20:30:53 +00:00
|
|
|
|
2014-07-21 23:52:19 +00:00
|
|
|
+ // PaperSpigot start - Allow arrows to fly through players
|
|
|
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && shooter != null && shooter instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) shooter).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
2014-06-22 20:30:53 +00:00
|
|
|
+ movingobjectposition = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
|
|
|
+
|
|
|
|
if (movingobjectposition != null) {
|
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event
|
2014-11-28 01:17:45 +00:00
|
|
|
|
2014-07-21 23:52:19 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
2014-11-28 01:17:45 +00:00
|
|
|
index ce3e628..7fc9abe 100644
|
2014-07-21 23:52:19 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -146,6 +146,14 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
2014-07-21 23:52:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // PaperSpigot start - Allow projectiles to fly through players the shooter can't see
|
|
|
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && shooter != null && shooter instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) shooter).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
|
|
|
+ movingobjectposition = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
|
|
|
+
|
|
|
|
if (movingobjectposition != null) {
|
2014-11-28 01:17:45 +00:00
|
|
|
if (movingobjectposition.type == EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.a()).getBlock() == Blocks.PORTAL) {
|
|
|
|
this.aq();
|
2014-06-22 20:30:53 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2014-11-28 01:17:45 +00:00
|
|
|
index 516447e..1537d76 100644
|
2014-06-22 20:30:53 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -1641,6 +1641,14 @@ public abstract class World implements IBlockAccess {
|
2014-06-22 20:30:53 +00:00
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
|
Entity entity1 = (Entity) list.get(i);
|
2014-11-28 01:17:45 +00:00
|
|
|
|
2014-07-21 23:52:19 +00:00
|
|
|
+ // PaperSpigot start - Allow block placement if the placer cannot see the blocker
|
|
|
|
+ if (entity instanceof EntityPlayer && entity1 instanceof EntityPlayer) {
|
|
|
|
+ if (!((EntityPlayer) entity).getBukkitEntity().canSee(((EntityPlayer) entity1).getBukkitEntity())) {
|
2014-06-22 20:30:53 +00:00
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
2014-11-28 01:17:45 +00:00
|
|
|
+
|
|
|
|
if (!entity1.dead && entity1.k && entity1 != entity && (entity == null || entity.vehicle != entity1 && entity.passenger != entity1)) {
|
2014-06-22 20:30:53 +00:00
|
|
|
return false;
|
2014-11-28 01:17:45 +00:00
|
|
|
}
|
2014-06-22 20:30:53 +00:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|