mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Update to Minecraft 1.10
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
public class PlayerInteractManager {
|
||||
|
||||
@@ -28,7 +35,7 @@
|
||||
this.gamemode = worldsettings_enumgamemode;
|
||||
worldsettings_enumgamemode.a(this.player.abilities);
|
||||
this.gamemode = enumgamemode;
|
||||
enumgamemode.a(this.player.abilities);
|
||||
this.player.updateAbilities();
|
||||
- this.player.server.getPlayerList().sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_GAME_MODE, new EntityPlayer[] { this.player}));
|
||||
+ this.player.server.getPlayerList().sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_GAME_MODE, new EntityPlayer[] { this.player}), this.player); // CraftBukkit
|
||||
@@ -122,7 +122,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -192,12 +251,75 @@
|
||||
@@ -192,13 +251,76 @@
|
||||
}
|
||||
|
||||
public boolean breakBlock(BlockPosition blockposition) {
|
||||
@@ -188,6 +188,7 @@
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
+ if (iblockdata.getBlock() == Blocks.AIR) return false; // CraftBukkit - A plugin set block to air without cancelling
|
||||
TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
+ // CraftBukkit start - Special case skulls, their item data comes from a tile entity
|
||||
+ if (iblockdata.getBlock() == Blocks.SKULL && !this.isCreative()) {
|
||||
@@ -196,10 +197,10 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (iblockdata.getBlock() instanceof BlockCommand && !this.player.a(2, "")) {
|
||||
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.dh()) {
|
||||
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
return false;
|
||||
@@ -242,6 +364,12 @@
|
||||
@@ -243,6 +365,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +213,7 @@
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -282,7 +410,13 @@
|
||||
@@ -283,7 +411,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,11 +224,11 @@
|
||||
+
|
||||
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) {
|
||||
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
|
||||
@@ -331,6 +465,72 @@
|
||||
return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2);
|
||||
@@ -340,6 +474,72 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // Interact event */
|
||||
@@ -236,7 +237,7 @@
|
||||
+ if (blockdata.getBlock() != Blocks.AIR) {
|
||||
+ boolean cancelledBlock = false;
|
||||
+
|
||||
+ if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
||||
+ if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
+ TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
+ cancelledBlock = !(tileentity instanceof ITileInventory || tileentity instanceof IInventory);
|
||||
+ }
|
||||
@@ -256,7 +257,7 @@
|
||||
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down()));
|
||||
+ }
|
||||
+ result = (event.useItemInHand() != Event.Result.ALLOW) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
||||
+ } else if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
||||
+ } else if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
+ TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
+
|
||||
+ if (tileentity instanceof ITileInventory) {
|
||||
|
Reference in New Issue
Block a user