@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -3,6 +3,15 @@
|
||||
import java.util.Objects;
|
||||
@@ -4,6 +4,16 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.ArrayList;
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
@@ -13,10 +13,11 @@
|
||||
+import org.bukkit.event.block.Action;
|
||||
+import org.bukkit.event.player.PlayerInteractEvent;
|
||||
+// CraftBukkit end
|
||||
|
||||
+
|
||||
public class PlayerInteractManager {
|
||||
|
||||
@@ -38,7 +47,7 @@
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -38,7 +48,7 @@
|
||||
this.gamemode = enumgamemode;
|
||||
enumgamemode.a(this.player.abilities);
|
||||
this.player.updateAbilities();
|
||||
@@ -25,7 +26,7 @@
|
||||
this.world.everyoneSleeping();
|
||||
}
|
||||
|
||||
@@ -67,7 +76,7 @@
|
||||
@@ -67,7 +77,7 @@
|
||||
}
|
||||
|
||||
public void a() {
|
||||
@@ -34,7 +35,7 @@
|
||||
IBlockData iblockdata;
|
||||
|
||||
if (this.j) {
|
||||
@@ -123,9 +132,31 @@
|
||||
@@ -123,9 +133,31 @@
|
||||
|
||||
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
|
||||
if (!this.world.a((EntityHuman) this.player, blockposition)) {
|
||||
@@ -66,7 +67,7 @@
|
||||
|
||||
if (this.isCreative()) {
|
||||
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy");
|
||||
@@ -141,11 +172,43 @@
|
||||
@@ -141,11 +173,43 @@
|
||||
float f = 1.0F;
|
||||
|
||||
iblockdata = this.world.getType(blockposition);
|
||||
@@ -111,7 +112,7 @@
|
||||
if (!iblockdata.isAir() && f >= 1.0F) {
|
||||
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine");
|
||||
} else {
|
||||
@@ -189,7 +252,7 @@
|
||||
@@ -189,7 +253,7 @@
|
||||
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
|
||||
this.f = false;
|
||||
if (!Objects.equals(this.h, blockposition)) {
|
||||
@@ -120,7 +121,7 @@
|
||||
this.world.a(this.player.getId(), this.h, -1);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying"));
|
||||
}
|
||||
@@ -205,17 +268,73 @@
|
||||
@@ -205,17 +269,73 @@
|
||||
if (this.breakBlock(blockposition)) {
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, s));
|
||||
} else {
|
||||
@@ -196,7 +197,7 @@
|
||||
TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
@@ -225,6 +344,10 @@
|
||||
@@ -225,6 +345,10 @@
|
||||
} else if (this.player.a((World) this.world, blockposition, this.gamemode)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -207,7 +208,7 @@
|
||||
block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player);
|
||||
boolean flag = this.world.a(blockposition, false);
|
||||
|
||||
@@ -233,19 +356,32 @@
|
||||
@@ -233,19 +357,32 @@
|
||||
}
|
||||
|
||||
if (this.isCreative()) {
|
||||
@@ -243,7 +244,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,12 +423,46 @@
|
||||
@@ -287,12 +424,46 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +291,7 @@
|
||||
|
||||
if (itileinventory != null) {
|
||||
entityplayer.openContainer(itileinventory);
|
||||
@@ -306,7 +476,7 @@
|
||||
@@ -306,7 +477,7 @@
|
||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||
|
||||
if (!flag1) {
|
||||
@@ -299,7 +300,7 @@
|
||||
|
||||
if (enuminteractionresult.a()) {
|
||||
CriterionTriggers.M.a(entityplayer, blockposition, itemstack1);
|
||||
@@ -314,17 +484,17 @@
|
||||
@@ -314,17 +485,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +321,7 @@
|
||||
}
|
||||
|
||||
if (enuminteractionresult1.a()) {
|
||||
@@ -332,10 +502,10 @@
|
||||
@@ -332,10 +503,10 @@
|
||||
}
|
||||
|
||||
return enuminteractionresult1;
|
||||
|
||||
Reference in New Issue
Block a user