2019-07-11 09:03:08 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
2019-09-12 10:00:15 +02:00
|
|
|
import com.simibubi.create.foundation.block.IWithoutBlockItem;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2019-07-11 09:03:08 +02:00
|
|
|
import net.minecraft.item.ItemGroup;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2019-09-12 10:00:15 +02:00
|
|
|
import net.minecraft.util.NonNullList;
|
2019-07-11 09:03:08 +02:00
|
|
|
|
|
|
|
public final class CreateItemGroup extends ItemGroup {
|
|
|
|
|
|
|
|
public CreateItemGroup() {
|
|
|
|
super(getGroupCountSafe(), Create.ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack createIcon() {
|
2019-10-05 19:00:43 +02:00
|
|
|
return new ItemStack(AllBlocks.COGWHEEL.get());
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
2019-09-12 10:00:15 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void fill(NonNullList<ItemStack> items) {
|
|
|
|
for (AllItems item : AllItems.values()) {
|
|
|
|
if (item.get() == null)
|
|
|
|
continue;
|
|
|
|
if (!item.module.isEnabled())
|
|
|
|
continue;
|
|
|
|
|
|
|
|
item.get().fillItemGroup(this, items);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (AllBlocks block : AllBlocks.values()) {
|
|
|
|
if (block.get() == null)
|
|
|
|
continue;
|
|
|
|
if (!block.module.isEnabled())
|
|
|
|
continue;
|
|
|
|
if (block.get() instanceof IWithoutBlockItem)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
block.get().asItem().fillItemGroup(this, items);
|
|
|
|
for (Block alsoRegistered : block.alsoRegistered)
|
|
|
|
alsoRegistered.asItem().fillItemGroup(this, items);
|
|
|
|
}
|
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|