mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Minecraft 1.9.4
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
--- a/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -1,5 +1,13 @@
|
||||
@@ -1,6 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.block.BlockBreakEvent;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -10,11 +11,10 @@
|
||||
+import org.bukkit.event.block.Action;
|
||||
+import org.bukkit.event.player.PlayerInteractEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
|
||||
public class PlayerInteractManager {
|
||||
|
||||
public World world;
|
||||
@@ -26,7 +34,7 @@
|
||||
@@ -28,7 +35,7 @@
|
||||
this.gamemode = worldsettings_enumgamemode;
|
||||
worldsettings_enumgamemode.a(this.player.abilities);
|
||||
this.player.updateAbilities();
|
||||
@@ -23,7 +23,7 @@
|
||||
this.world.everyoneSleeping();
|
||||
}
|
||||
|
||||
@@ -51,7 +59,7 @@
|
||||
@@ -53,7 +60,7 @@
|
||||
}
|
||||
|
||||
public void a() {
|
||||
@@ -32,7 +32,7 @@
|
||||
float f;
|
||||
int i;
|
||||
|
||||
@@ -98,6 +106,19 @@
|
||||
@@ -100,6 +107,19 @@
|
||||
}
|
||||
|
||||
public void a(BlockPosition blockposition, EnumDirection enumdirection) {
|
||||
@@ -52,7 +52,7 @@
|
||||
if (this.isCreative()) {
|
||||
if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) {
|
||||
this.breakBlock(blockposition);
|
||||
@@ -125,14 +146,48 @@
|
||||
@@ -127,14 +147,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
+ org.bukkit.event.block.BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this.player.inventory.getItemInHand(), f >= 1.0f);
|
||||
+
|
||||
+ if (blockEvent.isCancelled()) {
|
||||
@@ -98,12 +98,12 @@
|
||||
+
|
||||
+ if (blockEvent.getInstaBreak()) {
|
||||
+ f = 2.0f;
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (iblockdata.getMaterial() != Material.AIR && f >= 1.0F) {
|
||||
this.breakBlock(blockposition);
|
||||
@@ -150,6 +205,7 @@
|
||||
@@ -152,6 +206,7 @@
|
||||
|
||||
public void a(BlockPosition blockposition) {
|
||||
if (blockposition.equals(this.f)) {
|
||||
@@ -111,7 +111,7 @@
|
||||
int i = this.currentTick - this.lastDigTick;
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
|
||||
@@ -167,6 +223,10 @@
|
||||
@@ -169,6 +224,10 @@
|
||||
this.j = this.lastDigTick;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -190,12 +250,75 @@
|
||||
@@ -192,12 +251,75 @@
|
||||
}
|
||||
|
||||
public boolean breakBlock(BlockPosition blockposition) {
|
||||
@@ -199,7 +199,7 @@
|
||||
if (iblockdata.getBlock() instanceof BlockCommand && !this.player.a(2, "")) {
|
||||
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
return false;
|
||||
@@ -240,6 +363,12 @@
|
||||
@@ -242,6 +364,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +409,13 @@
|
||||
@@ -282,7 +410,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,12 +221,12 @@
|
||||
+ public boolean firedInteract = false;
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
|
||||
public EnumInteractionResult a(EntityHuman entityhuman, World world, @Nullable ItemStack itemstack, EnumHand enumhand, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
|
||||
+ /* CraftBukkit start - whole method
|
||||
if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
|
||||
@@ -329,6 +464,72 @@
|
||||
@@ -331,6 +465,72 @@
|
||||
return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user