returns a list of items with the same ID, but different meta (eg: dye returns 16 items) @param subItems The List of sub-items. This is a List of ItemStacks.
(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
| 342 | * @param subItems The List of sub-items. This is a List of ItemStacks. |
| 343 | */ |
| 344 | public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) |
| 345 | { |
| 346 | super.getSubItems(itemIn, tab, subItems); |
| 347 | |
| 348 | if (SUB_ITEMS_CACHE.isEmpty()) |
| 349 | { |
| 350 | for (int i = 0; i <= 15; ++i) |
| 351 | { |
| 352 | for (int j = 0; j <= 1; ++j) |
| 353 | { |
| 354 | int lvt_6_1_; |
| 355 | |
| 356 | if (j == 0) |
| 357 | { |
| 358 | lvt_6_1_ = i | 8192; |
| 359 | } |
| 360 | else |
| 361 | { |
| 362 | lvt_6_1_ = i | 16384; |
| 363 | } |
| 364 | |
| 365 | for (int l = 0; l <= 2; ++l) |
| 366 | { |
| 367 | int i1 = lvt_6_1_; |
| 368 | |
| 369 | if (l != 0) |
| 370 | { |
| 371 | if (l == 1) |
| 372 | { |
| 373 | i1 = lvt_6_1_ | 32; |
| 374 | } |
| 375 | else if (l == 2) |
| 376 | { |
| 377 | i1 = lvt_6_1_ | 64; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | List<PotionEffect> list = PotionHelper.getPotionEffects(i1, false); |
| 382 | |
| 383 | if (list != null && !list.isEmpty()) |
| 384 | { |
| 385 | SUB_ITEMS_CACHE.put(list, i1); |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | Iterator iterator = SUB_ITEMS_CACHE.values().iterator(); |
| 393 | |
| 394 | while (iterator.hasNext()) |
| 395 | { |
| 396 | int j1 = ((Integer)iterator.next()); |
| 397 | subItems.add(new ItemStack(itemIn, 1, j1)); |
| 398 | } |
| 399 | } |
| 400 | } |