Unicopia/src/main/java/com/minelittlepony/unicopia/item/UItems.java

206 lines
15 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia.item;
import static com.minelittlepony.unicopia.EquinePredicates.*;
import com.minelittlepony.unicopia.USounds;
import com.minelittlepony.unicopia.Unicopia;
2020-04-15 19:06:45 +02:00
import com.minelittlepony.unicopia.block.UBlocks;
import com.minelittlepony.unicopia.entity.UEntities;
import com.minelittlepony.unicopia.magic.spell.ScorchSpell;
import com.minelittlepony.unicopia.toxin.DynamicToxicBlockItem;
import com.minelittlepony.unicopia.toxin.DynamicToxicItem;
import com.minelittlepony.unicopia.toxin.ToxicBlockItem;
import com.minelittlepony.unicopia.toxin.ToxicItem;
import com.minelittlepony.unicopia.toxin.Toxicity;
import com.minelittlepony.unicopia.toxin.Toxin;
2020-01-16 16:46:24 +01:00
2018-09-12 01:29:49 +02:00
import net.minecraft.item.Item;
2020-01-16 16:46:24 +01:00
import net.minecraft.item.ItemGroup;
import net.minecraft.block.Blocks;
2020-01-27 13:47:14 +01:00
import net.minecraft.item.AliasedBlockItem;
2020-01-16 16:46:24 +01:00
import net.minecraft.item.BlockItem;
2020-01-27 11:05:22 +01:00
import net.minecraft.item.FoodComponent;
2020-01-16 16:46:24 +01:00
import net.minecraft.item.FoodComponents;
import net.minecraft.item.Items;
import net.minecraft.item.MusicDiscItem;
2020-04-24 14:31:06 +02:00
import net.minecraft.item.SpawnEggItem;
2020-01-16 16:46:24 +01:00
import net.minecraft.item.TallBlockItem;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.Rarity;
2020-01-17 14:27:26 +01:00
import net.minecraft.util.UseAction;
2020-01-16 16:46:24 +01:00
import net.minecraft.util.registry.Registry;
2020-04-15 15:30:20 +02:00
public interface UItems {
2020-01-16 16:46:24 +01:00
2020-04-24 15:23:36 +02:00
AppleItem GREEN_APPLE = register(new AppleItem(FoodComponents.APPLE), "apple_green");
AppleItem SWEET_APPLE = register(new AppleItem(FoodComponents.APPLE), "apple_sweet");
AppleItem SOUR_APPLE = register(new AppleItem(FoodComponents.APPLE), "apple_sour");
2018-09-12 01:29:49 +02:00
2020-04-24 15:23:36 +02:00
ZapAppleItem ZAP_APPLE = register(new ZapAppleItem(), "zap_apple");
2019-01-13 21:05:40 +01:00
2020-04-24 15:23:36 +02:00
AppleItem ROTTEN_APPLE = register(new RottenAppleItem(FoodComponents.APPLE), "rotten_apple");
2020-04-15 15:30:20 +02:00
AppleItem cooked_zap_apple = register(new AppleItem(FoodComponents.APPLE), "cooked_zap_apple");
2019-01-13 21:05:40 +01:00
2020-04-24 15:23:36 +02:00
Item CLOUD_MATTER = register(new Item(new Item.Settings().group(ItemGroup.MATERIALS)), "cloud_matter");
Item DEW_DROP = register(new Item(new Item.Settings().group(ItemGroup.MATERIALS)), "dew_drop");
2020-04-24 15:23:36 +02:00
CloudPlacerItem RACING_CLOUD_SPAWNER = register(new CloudPlacerItem(UEntities.RACING_CLOUD), "racing_cloud_spawner");
CloudPlacerItem CONSTRUCTION_CLOUD_SPAWNER = register(new CloudPlacerItem(UEntities.CONSTRUCTION_CLOUD), "construction_cloud_spawner");
CloudPlacerItem WILD_CLOUD_SPAWNER = register(new CloudPlacerItem(UEntities.WILD_CLOUD), "wild_cloud_spawner");
2020-04-24 15:23:36 +02:00
Item CLOUD_BLOCK = register(new PredicatedBlockItem(UBlocks.CLOUD_BLOCK, new Item.Settings().group(ItemGroup.MATERIALS), INTERACT_WITH_CLOUDS), "cloud_block");
Item ENCHANTED_CLOUD_BLOCK = register(new PredicatedBlockItem(UBlocks.ENCHANTED_CLOUD_BLOCK, new Item.Settings().group(ItemGroup.MATERIALS), INTERACT_WITH_CLOUDS), "enchanted_cloud_block");
Item PACKED_CLOUD_BLOCK = register(new PredicatedBlockItem(UBlocks.DENSE_CLOUD_BLOCK, new Item.Settings().group(ItemGroup.MATERIALS), INTERACT_WITH_CLOUDS), "packed_cloud_block");
2020-04-24 15:23:36 +02:00
Item CLOUD_STAIRS = register(new PredicatedBlockItem(UBlocks.CLOUD_STAIRS, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS), INTERACT_WITH_CLOUDS), "cloud_stairs");
2020-04-24 15:23:36 +02:00
Item CLOUD_FENCE = register(new PredicatedBlockItem(UBlocks.CLOUD_FENCE, new Item.Settings().group(ItemGroup.DECORATIONS), INTERACT_WITH_CLOUDS), "cloud_fence");
2020-04-24 15:23:36 +02:00
Item CLOUD_ANVIL = register(new PredicatedBlockItem(UBlocks.CLOUD_ANVIL, new Item.Settings().group(ItemGroup.DECORATIONS), INTERACT_WITH_CLOUDS), "cloud_anvil");
2020-04-24 15:23:36 +02:00
Item MUSIC_DISC_CRUSADE = register(createRecord(USounds.RECORD_CRUSADE), "music_disc_crusade");
Item MUSIC_DISC_PET = register(createRecord(USounds.RECORD_PET), "music_disc_pet");
Item MUSIC_DISC_POPULAR = register(createRecord(USounds.RECORD_POPULAR), "music_disc_popular");
Item MUSIC_DISC_FUNK = register(createRecord(USounds.RECORD_FUNK), "music_disc_funk");
2019-02-04 17:16:17 +01:00
2020-04-24 15:23:36 +02:00
Item HIVE_WALL_BLOCK = register(new BlockItem(UBlocks.HIVE_WALL_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)), "hive_wall_block");
Item CHITIN_SHELL = register(new Item(new Item.Settings().group(ItemGroup.MATERIALS)), "chitin_shell");
Item CHITIN_SHELL_BLOCK = register(new BlockItem(UBlocks.CHITIN_SHELL_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)), "chitin_shell_block");
Item CHISELED_CHITIN_SHELL_BLOCK = register(new BlockItem(UBlocks.CHISELED_CHITIN_SHELL_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)), "chiseled_chitin_shell_block");
Item SLIME_DROP = register(new BlockItem(UBlocks.SLIME_DROP, new Item.Settings().group(ItemGroup.MATERIALS)), "slime_drop");
Item SLIME_LAYER = register(new BlockItem(UBlocks.SLIME_LAYER, new Item.Settings().group(ItemGroup.DECORATIONS)), "slime_layer");
2020-04-24 15:23:36 +02:00
Item MISTED_DOOR = register(new TallBlockItem(UBlocks.MISTED_GLASS_DOOR, new Item.Settings().group(ItemGroup.REDSTONE)), "misted_door");
Item LIBRARY_DOOR = register(new TallBlockItem(UBlocks.LIBRARY_DOOR, new Item.Settings().group(ItemGroup.REDSTONE)), "library_door");
Item BAKERY_DOOR = register(new TallBlockItem(UBlocks.BAKERY_DOOR, new Item.Settings().group(ItemGroup.REDSTONE)), "bakery_door");
Item DIAMOND_DOOR = register(new TallBlockItem(UBlocks.DIAMOND_DOOR, new Item.Settings().group(ItemGroup.REDSTONE)), "diamond_door");
2019-03-08 21:55:27 +01:00
2020-04-24 15:23:36 +02:00
Item SUGAR_BLOCK = register(new BlockItem(UBlocks.SUGAR_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)), "sugar_block");
2020-01-16 16:46:24 +01:00
2020-04-24 15:23:36 +02:00
Item CLOUD_SLAB = register(new PredicatedBlockItem(UBlocks.CLOUD_SLAB, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS), INTERACT_WITH_CLOUDS), "cloud_slab");
Item ENCHANTED_CLOUD_SLAB = register(new PredicatedBlockItem(UBlocks.ENCHANTED_CLOUD_SLAB, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS), INTERACT_WITH_CLOUDS), "enchanted_cloud_slab");
Item DENSE_CLOUD_SLAB = register(new PredicatedBlockItem(UBlocks.DENSE_CLOUD_SLAB, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS), INTERACT_WITH_CLOUDS), "dense_cloud_slab");
2020-04-24 15:23:36 +02:00
MagicGemItem GEM = register(new MagicGemItem(), "gem");
MagicGemItem CORRUPTED_GEM = register(new CursedMagicGemItem(), "corrupted_gem");
2020-04-24 15:23:36 +02:00
BagOfHoldingItem BAG_OF_HOLDING = register(new BagOfHoldingItem(), "bag_of_holding");
AlicornAmuletItem ALICORN_AMULET = register(new AlicornAmuletItem(), "alicorn_amulet");
2020-04-24 15:23:36 +02:00
SpellbookItem SPELLBOOK = register(new SpellbookItem(), "spellbook");
Item STAFF_MEADOW_BROOK = register(new StaffItem(new Item.Settings().maxCount(1).maxDamage(2)), "staff_meadow_brook");
Item STAFF_REMEMBERANCE = register(new EnchantedStaffItem(new Item.Settings(), new ScorchSpell()), "staff_remembrance");
2020-04-24 15:23:36 +02:00
Item SPEAR = register(new SpearItem(new Item.Settings().maxCount(1).maxDamage(500)), "spear");
2019-04-09 13:45:36 +02:00
2020-04-24 15:23:36 +02:00
MossItem MOSS = register(new MossItem(new Item.Settings()), "moss");
2019-01-10 10:35:15 +01:00
2020-04-24 15:23:36 +02:00
Item ALFALFA_SEEDS = register(new AliasedBlockItem(UBlocks.ALFALFA_CROPS, new Item.Settings()
2020-01-27 13:47:14 +01:00
.group(ItemGroup.MATERIALS)
.food(new FoodComponent.Builder()
.hunger(1)
.saturationModifier(4)
.build())), "alfalfa_seeds");
2020-04-24 15:23:36 +02:00
Item ALFALFA_LEAVES = register(new Item(new Item.Settings()
2020-01-27 11:05:22 +01:00
.group(ItemGroup.FOOD)
.food(new FoodComponent.Builder()
.hunger(1)
.saturationModifier(3)
.build())), "alfalfa_leaves");
2020-04-24 15:23:36 +02:00
Item ENCHANTED_TORCH = register(new BlockItem(UBlocks.ENCHANTED_TORCH, new Item.Settings().group(ItemGroup.DECORATIONS)), "enchanted_torch");
Item CEREAL = register(new SugaryItem(new Item.Settings()
2020-01-27 11:05:22 +01:00
.group(ItemGroup.FOOD)
.food(new FoodComponent.Builder()
.hunger(9)
.saturationModifier(0.8F)
.build())
.maxCount(1)
.recipeRemainder(Items.BOWL), 1), "cereal");
2020-04-24 15:23:36 +02:00
Item SUGAR_CEREAL = register(new SugaryItem(new Item.Settings()
2020-01-27 11:05:22 +01:00
.group(ItemGroup.FOOD)
.food(new FoodComponent.Builder()
.hunger(20)
.saturationModifier(-2)
.build())
.maxCount(1)
.recipeRemainder(Items.BOWL), 110), "sugar_cereal");
2020-04-24 15:23:36 +02:00
TomatoSeedsItem TOMATO_SEEDS = register(new TomatoSeedsItem(), "tomato_seeds");
TomatoItem TOMATO = register(new TomatoItem(4, 34), "tomato");
RottenTomatoItem ROTTEN_TOMATO = register(new RottenTomatoItem(4, 34), "rotten_tomato");
2020-04-24 15:23:36 +02:00
TomatoItem CLOUDSDALE_TOMATO = register(new TomatoItem(16, 4), "cloudsdale_tomato");
RottenTomatoItem ROTTEN_CLOUDSDALE_TOMATO = register(new RottenTomatoItem(5, 34), "rotten_cloudsdale_tomato");
2020-04-24 15:23:36 +02:00
Item APPLE_SEEDS = register(new BlockItem(UBlocks.APPLE_SAPLING, new Item.Settings().group(ItemGroup.DECORATIONS)), "apple_seeds");
Item APPLE_LEAVES = register(new BlockItem(UBlocks.APPLE_LEAVES, new Item.Settings().group(ItemGroup.DECORATIONS)), "apple_leaves");
2020-04-24 15:23:36 +02:00
Item DAFFODIL_DAISY_SANDWICH = register(new DynamicToxicItem(new Item.Settings(), 3, 2, UseAction.EAT, Toxicity::fromStack), "daffodil_daisy_sandwich");
Item HAY_BURGER = register(new DynamicToxicItem(new Item.Settings(), 3, 4, UseAction.EAT, Toxicity::fromStack), "hay_burger");
Item HAY_FRIES = register(new ToxicItem(new Item.Settings(), 1, 5, UseAction.EAT, Toxicity.SAFE), "hay_fries");
Item SALAD = register(new DynamicToxicItem(new Item.Settings().recipeRemainder(Items.BOWL), 4, 2, UseAction.EAT, Toxicity::fromStack), "salad");
2020-04-24 15:23:36 +02:00
Item WHEAT_WORMS = register(new ToxicItem(new Item.Settings(), 1, 0, UseAction.EAT, Toxicity.SEVERE), "wheat_worms");
Item MUG = register(new Item(new Item.Settings().group(ItemGroup.MATERIALS)), "mug");
Item CIDER = register(new ToxicItem(new Item.Settings().recipeRemainder(MUG), 4, 2, UseAction.DRINK, Toxicity.MILD), "apple_cider");
Item JUICE = register(new ToxicItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE), 2, 2, UseAction.DRINK, Toxicity.SAFE), "juice");
Item BURNED_JUICE = register(new ToxicItem(new Item.Settings().recipeRemainder(Items.GLASS_BOTTLE), 3, 1, UseAction.DRINK, Toxicity.FAIR), "burned_juice");
2020-01-27 13:47:14 +01:00
2020-04-24 15:23:36 +02:00
Item CLOUD_SPAWN_EGG = register(new SpawnEggItem(UEntities.CLOUD, 0x4169e1, 0x7fff00, new Item.Settings().group(ItemGroup.MISC)), "cloud_spawn_egg");
2020-04-24 18:58:09 +02:00
Item BUTTERFLY_SPAWN_EGG = register(new SpawnEggItem(UEntities.BUTTERFLY, 0x222200, 0xaaeeff, new Item.Settings().group(ItemGroup.MISC)), "butterfly_spawn_egg");
2020-04-24 14:31:06 +02:00
2020-04-15 15:30:20 +02:00
static <T extends Item> T register(T item, String name) {
return Registry.ITEM.add(new Identifier(Unicopia.MODID, name), item);
2020-01-27 11:05:22 +01:00
}
static MusicDiscItem createRecord(SoundEvent sound) {
return new MusicDiscItem(1, sound, new Item.Settings()
.maxCount(1)
.group(ItemGroup.MISC)
.rarity(Rarity.RARE)
) {};
}
2020-04-15 15:30:20 +02:00
static void bootstrap() {
2020-01-27 13:47:14 +01:00
// FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(zap_apple), new ItemStack(cooked_zap_apple), 0.1F);
// FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(juice), new ItemStack(burned_juice), 0);
// FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(cuccoon), new ItemStack(chitin_shell), 0.3F);
}
2018-09-20 22:49:10 +02:00
2020-04-15 15:30:20 +02:00
interface VanillaOverrides {
2020-04-24 15:23:36 +02:00
StickItem STICK = register(new StickItem(), Items.STICK);
ExtendedShearsItem SHEARS = register(new ExtendedShearsItem(), Items.SHEARS);
AppleItem APPLE = register(new AppleItem(FoodComponents.APPLE), Items.APPLE);
Item GRASS = register(new DynamicToxicBlockItem(Blocks.GRASS, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE, Toxin.NAUSEA), Items.GRASS);
Item FERN = register(new DynamicToxicBlockItem(Blocks.FERN, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SEVERE, Toxin.STRENGTH), Items.FERN);
Item DEAD_BUSH = register(new DynamicToxicBlockItem(Blocks.DEAD_BUSH, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SEVERE, Toxin.NAUSEA), Items.DEAD_BUSH);
Item DANDELION = register(new ToxicBlockItem(Blocks.DANDELION, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.DANDELION);
Item POPPY = register(new ToxicBlockItem(Blocks.POPPY, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SEVERE), Items.POPPY);
Item BLUE_ORCHID = register(new ToxicBlockItem(Blocks.BLUE_ORCHID, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.BLUE_ORCHID);
Item ALLIUM = register(new ToxicBlockItem(Blocks.ALLIUM, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.FAIR), Items.ALLIUM);
Item AZUER_BLUET = register(new DynamicToxicBlockItem(Blocks.AZURE_BLUET, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE, Toxin.RADIOACTIVITY), Items.AZURE_BLUET);
Item RED_TULIP = register(new ToxicBlockItem(Blocks.RED_TULIP, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.RED_TULIP);
Item ORANGE_TULIP = register(new ToxicBlockItem(Blocks.ORANGE_TULIP, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.ORANGE_TULIP);
Item WHITE_TULIP = register(new ToxicBlockItem(Blocks.WHITE_TULIP, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.FAIR), Items.WHITE_TULIP);
Item PINK_TULIP = register(new ToxicBlockItem(Blocks.PINK_TULIP, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.PINK_TULIP);
Item OXEYE_DAISY = register(new DynamicToxicBlockItem(Blocks.OXEYE_DAISY, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SEVERE, Toxin.BLINDNESS), Items.OXEYE_DAISY);
Item CORNFLOWER = register(new ToxicBlockItem(Blocks.CORNFLOWER, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.CORNFLOWER);
Item ROSE_BUSH = register(new DynamicToxicBlockItem(Blocks.ROSE_BUSH, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE, Toxin.DAMAGE), Items.ROSE_BUSH);
Item PEONY = register(new ToxicBlockItem(Blocks.PEONY, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.PEONY);
Item TALL_GRASS = register(new ToxicBlockItem(Blocks.TALL_GRASS, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SAFE), Items.TALL_GRASS);
Item LARGE_FERN = register(new DynamicToxicBlockItem(Blocks.LARGE_FERN, new Item.Settings().group(ItemGroup.DECORATIONS), 2, 1, UseAction.EAT, Toxicity.SEVERE, Toxin.DAMAGE), Items.LARGE_FERN);
static <T extends Item> T register(T newItem, Item oldItem) {
return Registry.ITEM.set(Registry.ITEM.getRawId(oldItem), Registry.ITEM.getId(oldItem), newItem);
}
}
2018-09-12 01:29:49 +02:00
}