Commits

md_5 authored f43634ae431
SPIGOT-7170: Cannot set slots in custom smithing inventory
No tags

src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java

Modified
13 13 import net.minecraft.world.inventory.ContainerDispenser;
14 14 import net.minecraft.world.inventory.ContainerEnchantTable;
15 15 import net.minecraft.world.inventory.ContainerFurnaceFurnace;
16 16 import net.minecraft.world.inventory.ContainerGrindstone;
17 17 import net.minecraft.world.inventory.ContainerHopper;
18 18 import net.minecraft.world.inventory.ContainerLectern;
19 19 import net.minecraft.world.inventory.ContainerLoom;
20 20 import net.minecraft.world.inventory.ContainerMerchant;
21 21 import net.minecraft.world.inventory.ContainerProperties;
22 22 import net.minecraft.world.inventory.ContainerShulkerBox;
23 -import net.minecraft.world.inventory.ContainerSmithing;
24 23 import net.minecraft.world.inventory.ContainerSmoker;
25 24 import net.minecraft.world.inventory.ContainerStonecutter;
26 25 import net.minecraft.world.inventory.ContainerWorkbench;
27 26 import net.minecraft.world.inventory.Containers;
28 27 import net.minecraft.world.inventory.Slot;
29 28 import net.minecraft.world.item.ItemStack;
30 29 import org.bukkit.entity.HumanEntity;
31 30 import org.bukkit.event.inventory.InventoryType;
32 31 import org.bukkit.inventory.Inventory;
33 32 import org.bukkit.inventory.InventoryView;
176 175 case ENCHANTING:
177 176 delegate = new ContainerEnchantTable(windowId, bottom);
178 177 break;
179 178 case BREWING:
180 179 delegate = new ContainerBrewingStand(windowId, bottom, top, new ContainerProperties(2));
181 180 break;
182 181 case HOPPER:
183 182 delegate = new ContainerHopper(windowId, bottom, top);
184 183 break;
185 184 case ANVIL:
186 - setupAnvil(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
187 - break;
188 185 case SMITHING:
189 - delegate = new ContainerSmithing(windowId, bottom);
186 + setupAnvil(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
190 187 break;
191 188 case BEACON:
192 189 delegate = new ContainerBeacon(windowId, bottom);
193 190 break;
194 191 case SHULKER_BOX:
195 192 delegate = new ContainerShulkerBox(windowId, bottom, top);
196 193 break;
197 194 case BLAST_FURNACE:
198 195 delegate = new ContainerBlastFurnace(windowId, bottom, top, new ContainerProperties(4));
199 196 break;

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

Add shortcut