Commits

Starbuck Johnson authored and turt2live committed 3626720d537
Modify the invalid item set to permit command blocks. Fixes BUKKIT-4342

When using a "vanilla" Minecraft server using the "pick block" key on a command block yields the invoker with a command block within their inventory while in creative mode. Implications of the invalid items set containing the command block also include having a "ghost" item that cannot be placed due to it not actually existing. This commit resolves the problem and brings Craftbukkit closer to vanilla behaviour by removing the command block item ID, 137, from the invalid items set.
No tags

src/main/java/net/minecraft/server/PlayerConnection.java

Modified
109 109
110 110 // For the PacketPlayOutBlockPlace hack :(
111 111 Long lastPacket;
112 112
113 113 // Store the last block right clicked and what type it was
114 114 private Item lastMaterial;
115 115
116 116 public CraftPlayer getPlayer() {
117 117 return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
118 118 }
119 - private final static HashSet<Integer> invalidItems = new HashSet<Integer>(java.util.Arrays.asList(8, 9, 10, 11, 26, 34, 36, 43, 51, 52, 55, 59, 60, 62, 63, 64, 68, 71, 74, 75, 83, 90, 92, 93, 94, 104, 105, 115, 117, 118, 119, 125, 127, 132, 137, 140, 141, 142, 144)); // TODO: Check after every update.
119 + private final static HashSet<Integer> invalidItems = new HashSet<Integer>(java.util.Arrays.asList(8, 9, 10, 11, 26, 34, 36, 43, 51, 52, 55, 59, 60, 62, 63, 64, 68, 71, 74, 75, 83, 90, 92, 93, 94, 104, 105, 115, 117, 118, 119, 125, 127, 132, 140, 141, 142, 144)); // TODO: Check after every update.
120 120 // CraftBukkit end
121 121
122 122 public void a() {
123 123 this.g = false;
124 124 ++this.e;
125 125 this.minecraftServer.methodProfiler.a("keepAlive");
126 126 if ((long) this.e - this.k > 40L) {
127 127 this.k = (long) this.e;
128 128 this.i = this.d();
129 129 this.h = (int) this.i;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut