Mappings Update

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-12-06 10:00:00 +11:00
parent e9e6bec4e5
commit 102dee7d4f
123 changed files with 393 additions and 442 deletions

View File

@@ -38,7 +38,7 @@
protected Slot a(Slot slot) {
@@ -128,6 +151,7 @@
l = playerinventory.getCarried().getCount();
k = playerinventory.getCarried().getCount();
Iterator iterator = this.h.iterator();
+ Map<Integer, ItemStack> draggedSlots = new HashMap<Integer, ItemStack>(); // CraftBukkit - Store slots from drag in map (raw slot id -> new stack)
@@ -48,19 +48,19 @@
@@ -143,12 +167,48 @@
}
l -= itemstack4.getCount() - j1;
k -= itemstack4.getCount() - j1;
- slot1.set(itemstack4);
+ // slot1.set(itemstack4);
+ draggedSlots.put(slot1.rawSlotIndex, itemstack4); // CraftBukkit - Put in map instead of setting
}
}
- itemstack2.setCount(l);
- itemstack2.setCount(k);
- playerinventory.setCarried(itemstack2);
+ // CraftBukkit start - InventoryDragEvent
+ InventoryView view = getBukkitView();
+ org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack2);
+ newcursor.setAmount(l);
+ newcursor.setAmount(k);
+ Map<Integer, org.bukkit.inventory.ItemStack> eventmap = new HashMap<Integer, org.bukkit.inventory.ItemStack>();
+ for (Map.Entry<Integer, ItemStack> ditem : draggedSlots.entrySet()) {
+ eventmap.put(ditem.getKey(), CraftItemStack.asBukkitCopy(ditem.getValue()));
@@ -126,7 +126,7 @@
}
}
} else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) {
@@ -567,6 +639,7 @@
@@ -565,6 +637,7 @@
if (inventorycraftresult.a(world, entityplayer, irecipe) && irecipe != null) {
itemstack = irecipe.craftItem(iinventory);
}