Commits
md_5 authored 43f66f6cb76
160 160 | + ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), slot.index, slot.getItem())); |
161 161 | + // Updating a crafting inventory makes the client reset the result slot, have to send it again |
162 162 | + if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) { |
163 163 | + ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), 0, this.getSlot(0).getItem())); |
164 164 | + } |
165 165 | + } |
166 166 | + // CraftBukkit end |
167 167 | } |
168 168 | } else { |
169 169 | int j2; |
170 - | |
170 + | |
171 + | } |
172 + | |
173 + | itemstack = slot2.safeTake(k, Integer.MAX_VALUE, entityhuman); |
174 + | - entityhuman.drop(itemstack, true); |
175 + | + // CraftBukkit start - SPIGOT-8010: break loop |
176 + | + if (entityhuman.drop(itemstack, true) == null) { |
177 + | + break; |
178 + | + } |
179 + | + // CraftBukkit end |
180 + | entityhuman.handleCreativeModeItemDrop(itemstack); |
181 + | } |
182 + | } |
183 + | |
171 184 | ItemStack itemstack = this.getCarried(); |
172 185 | |
173 186 | if (!itemstack.isEmpty()) { |
174 187 | + this.setCarried(ItemStack.EMPTY); // CraftBukkit - SPIGOT-4556 - from below |
175 188 | dropOrPlaceInInventory(entityhuman, itemstack); |
176 189 | - this.setCarried(ItemStack.EMPTY); |
177 190 | + // this.setCarried(ItemStack.EMPTY); // CraftBukkit - moved up |
178 191 | } |
179 192 | |
180 193 | } |
181 - | |
194 + | |
182 195 | } |
183 196 | |
184 197 | public ItemStack getCarried() { |
185 198 | + // CraftBukkit start |
186 199 | + if (this.carried.isEmpty()) { |
187 200 | + this.setCarried(ItemStack.EMPTY); |
188 201 | + } |
189 202 | + // CraftBukkit end |
190 203 | return this.carried; |
191 204 | } |
192 205 |