Little more progress
Keep getting interrupted so not as much as I'd like :(
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 9241874139..9776a29923 100644
|
||||
index 3458333c9..6ef5d2ebd 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -16,9 +16,9 @@ index 9241874139..9776a29923 100644
|
||||
+ public boolean i; public final boolean blocksEntitySpawning() { return this.i; } // Paper - OBFHELPER
|
||||
public final List<Entity> passengers;
|
||||
protected int j;
|
||||
private Entity vehicle;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index 3328a84792..367b02800a 100644
|
||||
index 8d9b9af9b..08d884649 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
@@ -30,21 +30,21 @@ index 3328a84792..367b02800a 100644
|
||||
return this.getBlock().b(this, iblockaccess, blockposition, voxelshapecollision);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
|
||||
index c34c635a85..0c8b11bbec 100644
|
||||
index ab875a736..aed353365 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
|
||||
@@ -0,0 +0,0 @@ public class ItemBlock extends Item {
|
||||
EntityHuman entityhuman = blockactioncontext.getEntity();
|
||||
VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman);
|
||||
// CraftBukkit start - store default return
|
||||
- boolean defaultReturn = (!this.d() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
- boolean defaultReturn = (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
+ World world = blockactioncontext.getWorld(); // Paper
|
||||
+ boolean defaultReturn = (!this.d() || iblockdata.canPlace(world, blockactioncontext.getClickPosition())) && world.checkEntityCollision(iblockdata, entityhuman, voxelshapecollision, blockactioncontext.getClickPosition(), true); // Paper
|
||||
+ boolean defaultReturn = (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && world.checkEntityCollision(iblockdata, entityhuman, voxelshapecollision, blockactioncontext.getClickPosition(), true); // Paper
|
||||
org.bukkit.entity.Player player = (blockactioncontext.getEntity() instanceof EntityPlayer) ? (org.bukkit.entity.Player) blockactioncontext.getEntity().getBukkitEntity() : null;
|
||||
|
||||
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn);
|
||||
diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java
|
||||
index 3801b3f21d..092f02cc2f 100644
|
||||
index 0f64a3c05..0f95bcbcc 100644
|
||||
--- a/src/main/java/net/minecraft/server/VoxelShape.java
|
||||
+++ b/src/main/java/net/minecraft/server/VoxelShape.java
|
||||
@@ -0,0 +0,0 @@ public abstract class VoxelShape {
|
||||
@@ -56,7 +56,7 @@ index 3801b3f21d..092f02cc2f 100644
|
||||
return (VoxelShape) (this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2)));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java
|
||||
index b8659f703c..c8bd4b7034 100644
|
||||
index 143be566c..08c83c62d 100644
|
||||
--- a/src/main/java/net/minecraft/server/VoxelShapes.java
|
||||
+++ b/src/main/java/net/minecraft/server/VoxelShapes.java
|
||||
@@ -0,0 +0,0 @@ public final class VoxelShapes {
|
||||
@@ -74,19 +74,19 @@ index b8659f703c..c8bd4b7034 100644
|
||||
+ public static final boolean applyOperation(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { return VoxelShapes.c(voxelshape, voxelshape1, operatorboolean); } // Paper - OBFHELPER
|
||||
public static boolean c(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) {
|
||||
if (operatorboolean.apply(false, false)) {
|
||||
throw new IllegalArgumentException();
|
||||
throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException());
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index cacc18ca41..c60279da8f 100644
|
||||
index eea3a542d..bdbabe6a0 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ // ret true if no collision
|
||||
+ public final boolean checkEntityCollision(IBlockData data, Entity source, VoxelShapeCollision voxelshapedcollision,
|
||||
+ BlockPosition position, boolean checkCanSee) {
|
||||
+ BlockPosition position, boolean checkCanSee) {
|
||||
+ // Copied from IWorldReader#a(IBlockData, BlockPosition, VoxelShapeCollision) & EntityAccess#a(Entity, VoxelShape)
|
||||
+ VoxelShape voxelshape = data.getCollisionShape(this, position, voxelshapedcollision);
|
||||
+ if (voxelshape.isEmpty()) {
|
||||
@@ -94,18 +94,16 @@ index cacc18ca41..c60279da8f 100644
|
||||
+ }
|
||||
+
|
||||
+ voxelshape = voxelshape.offset((double) position.getX(), (double) position.getY(), (double) position.getZ());
|
||||
+
|
||||
+ if (voxelshape.isEmpty()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ List<Entity> entities = this.getEntities(null, voxelshape.getBoundingBox());
|
||||
+
|
||||
+ for (int i = 0, len = entities.size(); i < len; ++i) {
|
||||
+ Entity entity = entities.get(i);
|
||||
+
|
||||
+ if (checkCanSee && source instanceof EntityPlayer && entity instanceof EntityPlayer
|
||||
+ && !((EntityPlayer)source).getBukkitEntity().canSee(((EntityPlayer)entity).getBukkitEntity())) {
|
||||
+ && !((EntityPlayer) source).getBukkitEntity().canSee(((EntityPlayer) entity).getBukkitEntity())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
@@ -126,10 +124,10 @@ index cacc18ca41..c60279da8f 100644
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public BiomeBase getBiome(BlockPosition blockposition) {
|
||||
IChunkProvider ichunkprovider = this.getChunkProvider();
|
||||
public boolean p_() {
|
||||
return this.isClientSide;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index ade1d42f7e..ac4369dcef 100644
|
||||
index 7967222d9..e954c59d5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
|
||||
Reference in New Issue
Block a user