2020-09-22 15:11:20 +02:00
|
|
|
package com.minelittlepony.unicopia.item;
|
|
|
|
|
2020-09-23 22:38:28 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2021-08-13 15:57:21 +02:00
|
|
|
|
2021-09-02 19:11:51 +02:00
|
|
|
import com.minelittlepony.unicopia.Race;
|
2020-09-22 15:11:20 +02:00
|
|
|
import com.minelittlepony.unicopia.USounds;
|
2021-09-02 19:11:51 +02:00
|
|
|
import com.minelittlepony.unicopia.block.UBlocks;
|
2021-08-24 21:15:43 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.UEntities;
|
2021-02-16 12:39:39 +01:00
|
|
|
import com.minelittlepony.unicopia.item.enchantment.UEnchantments;
|
2020-09-22 15:11:20 +02:00
|
|
|
import com.minelittlepony.unicopia.item.toxin.UFoodComponents;
|
|
|
|
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.Item.Settings;
|
|
|
|
import net.minecraft.item.ItemGroup;
|
2021-06-21 23:49:55 +02:00
|
|
|
import net.minecraft.item.Items;
|
2021-02-03 21:25:42 +01:00
|
|
|
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
2020-09-22 15:11:20 +02:00
|
|
|
import net.minecraft.item.BlockItem;
|
|
|
|
import net.minecraft.item.FoodComponents;
|
|
|
|
import net.minecraft.item.MusicDiscItem;
|
2021-08-19 19:52:35 +02:00
|
|
|
import net.minecraft.item.SpawnEggItem;
|
2020-09-22 15:11:20 +02:00
|
|
|
import net.minecraft.sound.SoundEvent;
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
import net.minecraft.util.Rarity;
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
|
|
|
|
public interface UItems {
|
|
|
|
|
2020-09-23 22:38:28 +02:00
|
|
|
List<Item> ITEMS = new ArrayList<>();
|
|
|
|
|
2020-09-22 15:11:20 +02:00
|
|
|
AppleItem GREEN_APPLE = register("green_apple", new AppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)));
|
|
|
|
AppleItem SWEET_APPLE = register("sweet_apple", new AppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)));
|
|
|
|
AppleItem SOUR_APPLE = register("sour_apple", new AppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)));
|
|
|
|
|
|
|
|
ZapAppleItem ZAP_APPLE = register("zap_apple", new ZapAppleItem(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.ZAP_APPLE)));
|
|
|
|
|
|
|
|
AppleItem ROTTEN_APPLE = register("rotten_apple", new RottenAppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)));
|
|
|
|
AppleItem COOKED_ZAP_APPLE = register("cooked_zap_apple", new AppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)));
|
|
|
|
|
|
|
|
Item MUSIC_DISC_CRUSADE = register("music_disc_crusade", USounds.RECORD_CRUSADE);
|
|
|
|
Item MUSIC_DISC_PET = register("music_disc_pet", USounds.RECORD_PET);
|
|
|
|
Item MUSIC_DISC_POPULAR = register("music_disc_popular", USounds.RECORD_POPULAR);
|
|
|
|
Item MUSIC_DISC_FUNK = register("music_disc_funk", USounds.RECORD_FUNK);
|
|
|
|
|
2021-02-03 21:25:42 +01:00
|
|
|
FriendshipBraceletItem FRIENDSHIP_BRACELET = register("friendship_bracelet", new FriendshipBraceletItem(
|
|
|
|
new FabricItemSettings()
|
|
|
|
.rarity(Rarity.UNCOMMON)
|
|
|
|
.group(ItemGroup.TOOLS)
|
|
|
|
));
|
|
|
|
|
2021-02-14 16:53:44 +01:00
|
|
|
Item EMPTY_JAR = register("empty_jar", new JarItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(16).fireproof(), false, false, false));
|
2021-02-14 21:15:30 +01:00
|
|
|
FilledJarItem FILLED_JAR = register("filled_jar", new FilledJarItem(new Item.Settings().maxCount(1)));
|
2021-02-14 16:53:44 +01:00
|
|
|
Item RAIN_CLOUD_JAR = register("rain_cloud_jar", new JarItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(1).fireproof(), true, false, false));
|
|
|
|
Item STORM_CLOUD_JAR = register("storm_cloud_jar", new JarItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(1).fireproof(), true, true, false));
|
|
|
|
Item LIGHTNING_JAR = register("lightning_jar", new JarItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(1).fireproof(), false, false, true));
|
|
|
|
Item ZAP_APPLE_JAM_JAR = register("zap_apple_jam_jar", new JarItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(1).fireproof(), false, false, true));
|
|
|
|
|
2021-02-18 21:30:43 +01:00
|
|
|
Item CRYSTAL_HEART = register("crystal_heart", new CrystalHeartItem(new Item.Settings().group(ItemGroup.DECORATIONS).maxCount(1)));
|
2021-02-19 09:34:26 +01:00
|
|
|
Item CRYSTAL_SHARD = register("crystal_shard", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
|
|
|
|
2021-03-01 11:56:30 +01:00
|
|
|
Item GEMSTONE = register("gemstone", new GemstoneItem(new Item.Settings().group(ItemGroup.MATERIALS)));
|
2021-02-27 11:24:09 +01:00
|
|
|
|
|
|
|
Item PEGASUS_FEATHER = register("pegasus_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
|
|
|
Item GRYPHON_FEATHER = register("gryphon_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
|
|
|
|
2021-06-21 23:49:55 +02:00
|
|
|
Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.DAFODIL_DAISY_SANDWICH)));
|
|
|
|
Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(1).food(UFoodComponents.HAY_BURGER)));
|
|
|
|
Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(16).food(UFoodComponents.HAY_FRIES)));
|
2021-08-17 19:06:04 +02:00
|
|
|
Item WHEAT_WORMS = register("wheat_worms", new Item(new Item.Settings().group(ItemGroup.MISC).maxCount(16).food(UFoodComponents.INSECTS)));
|
2021-06-21 23:49:55 +02:00
|
|
|
|
2021-09-02 19:11:51 +02:00
|
|
|
Item PEBBLES = register("pebbles", new RacePredicatedAliasedBlockItem(UBlocks.ROCKS, new Item.Settings().group(ItemGroup.MATERIALS), Race::canUseEarth));
|
|
|
|
Item ROCK = register("rock", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
2021-09-03 00:02:34 +02:00
|
|
|
Item WEIRD_ROCK = register("weird_rock", new Item(new Item.Settings().group(ItemGroup.MATERIALS)));
|
2021-09-02 23:44:53 +02:00
|
|
|
Item ROCK_STEW = register("rock_stew", new Item(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.MUSHROOM_STEW)));
|
2021-09-02 19:11:51 +02:00
|
|
|
|
2021-06-21 23:49:55 +02:00
|
|
|
Item MUG = register("mug", new Item(new Settings().group(ItemGroup.MATERIALS).maxCount(16)));
|
|
|
|
Item CIDER = register("cider", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.CIDER).maxCount(1).recipeRemainder(MUG)));
|
|
|
|
Item JUICE = register("juice", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.JUICE)));
|
2021-06-24 22:43:26 +02:00
|
|
|
Item BURNED_JUICE = register("burned_juice", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.BURNED_JUICE)));
|
2021-06-21 23:49:55 +02:00
|
|
|
|
2021-02-27 11:24:09 +01:00
|
|
|
Item GOLDEN_FEATHER = register("golden_feather", new Item(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.MATERIALS)));
|
|
|
|
Item GOLDEN_WING = register("golden_wing", new Item(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.MATERIALS)));
|
|
|
|
|
2021-08-19 19:52:35 +02:00
|
|
|
Item BUTTERFLY_SPAWN_EGG = register("butterfly_spawn_egg", new SpawnEggItem(UEntities.BUTTERFLY, 0x222200, 0xaaeeff, new Item.Settings().group(ItemGroup.MISC)));
|
2021-08-23 15:37:44 +02:00
|
|
|
Item BUTTERFLY = register("butterfly", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.INSECTS)));
|
2021-08-19 19:52:35 +02:00
|
|
|
|
2021-11-09 17:29:55 +01:00
|
|
|
Item SPELLBOOK = register("spellbook", new SpellbookItem(new Item.Settings().maxCount(1).rarity(Rarity.UNCOMMON).group(ItemGroup.TOOLS)));
|
|
|
|
|
2021-02-27 17:42:29 +01:00
|
|
|
AmuletItem PEGASUS_AMULET = register("pegasus_amulet", new AmuletItem(new FabricItemSettings()
|
2021-08-13 15:57:21 +02:00
|
|
|
.maxCount(1)
|
2021-02-27 11:24:09 +01:00
|
|
|
.maxDamage(890)
|
|
|
|
.rarity(Rarity.UNCOMMON)
|
2021-03-03 19:32:51 +01:00
|
|
|
.group(ItemGroup.DECORATIONS), 900));
|
2021-08-13 15:57:21 +02:00
|
|
|
AlicornAmuletItem ALICORN_AMULET = register("alicorn_amulet", new AlicornAmuletItem(new FabricItemSettings()
|
|
|
|
.maxCount(1)
|
|
|
|
.maxDamage(1000)
|
|
|
|
.rarity(Rarity.RARE)
|
|
|
|
.group(ItemGroup.DECORATIONS)));
|
2021-02-18 21:30:43 +01:00
|
|
|
|
2020-09-22 15:11:20 +02:00
|
|
|
static <T extends Item> T register(String name, T item) {
|
2020-09-23 22:38:28 +02:00
|
|
|
ITEMS.add(item);
|
2020-09-22 15:11:20 +02:00
|
|
|
if (item instanceof BlockItem) {
|
|
|
|
((BlockItem)item).appendBlocks(Item.BLOCK_ITEMS, item);
|
|
|
|
}
|
|
|
|
return Registry.register(Registry.ITEM, new Identifier("unicopia", name), item);
|
|
|
|
}
|
|
|
|
|
|
|
|
static MusicDiscItem register(String name, SoundEvent sound) {
|
|
|
|
return register(name, new MusicDiscItem(1, sound, new Settings()
|
|
|
|
.maxCount(1)
|
|
|
|
.group(ItemGroup.MISC)
|
|
|
|
.rarity(Rarity.RARE)
|
|
|
|
) {});
|
|
|
|
}
|
|
|
|
|
|
|
|
static void bootstrap() {
|
2021-02-16 12:39:39 +01:00
|
|
|
UEnchantments.bootstrap();
|
2020-10-02 21:09:14 +02:00
|
|
|
URecipes.bootstrap();
|
2021-03-01 11:56:30 +01:00
|
|
|
UItemGroups.bootstrap();
|
2020-09-22 15:11:20 +02:00
|
|
|
}
|
|
|
|
}
|