|
| 1 | +package juuxel.adorn.item; |
| 2 | + |
| 3 | +import juuxel.adorn.AdornCommon; |
| 4 | +import juuxel.adorn.block.AdornBlocks; |
| 5 | +import juuxel.adorn.lib.registry.Registered; |
| 6 | +import juuxel.adorn.lib.registry.Registrar; |
| 7 | +import juuxel.adorn.lib.registry.RegistrarFactory; |
| 8 | +import net.minecraft.entity.effect.StatusEffectInstance; |
| 9 | +import net.minecraft.entity.effect.StatusEffects; |
| 10 | +import net.minecraft.item.FoodComponent; |
| 11 | +import net.minecraft.item.Item; |
| 12 | +import net.minecraft.registry.RegistryKeys; |
| 13 | +import net.minecraft.util.Rarity; |
| 14 | +import net.minecraft.util.math.Direction; |
| 15 | + |
| 16 | +public final class AdornItems { |
| 17 | + public static final Registrar<Item> ITEMS = RegistrarFactory.get().create(RegistryKeys.ITEM); |
| 18 | + private static final FoodComponent DRINK_FOOD_COMPONENT = drinkFoodComponentBuilder().build(); |
| 19 | + |
| 20 | + public static final Registered<Item> STONE_ROD = ITEMS.register("stone_rod", () -> new ItemWithDescription(new Item.Settings())); |
| 21 | + public static final Registered<Item> MUG = ITEMS.register("mug", () -> new ItemWithDescription(new Item.Settings().maxCount(16))); |
| 22 | + public static final Registered<Item> HOT_CHOCOLATE = ITEMS.register("hot_chocolate", |
| 23 | + () -> new DrinkInMugItem(new Item.Settings().food(DRINK_FOOD_COMPONENT).maxCount(1))); |
| 24 | + public static final Registered<Item> SWEET_BERRY_JUICE = ITEMS.register("sweet_berry_juice", |
| 25 | + () -> new DrinkInMugItem(new Item.Settings().food(DRINK_FOOD_COMPONENT).maxCount(1))); |
| 26 | + public static final Registered<Item> GLOW_BERRY_TEA = ITEMS.register("glow_berry_tea", |
| 27 | + () -> new DrinkInMugItem( |
| 28 | + new Item.Settings() |
| 29 | + .food(drinkFoodComponentBuilder().statusEffect(new StatusEffectInstance(StatusEffects.GLOWING, 400), 1.0f).build()) |
| 30 | + .maxCount(1) |
| 31 | + )); |
| 32 | + public static final Registered<Item> NETHER_WART_COFFEE = ITEMS.register("nether_wart_coffee", |
| 33 | + () -> new DrinkInMugItem(new Item.Settings().food(DRINK_FOOD_COMPONENT).maxCount(1))); |
| 34 | + |
| 35 | + public static final Registered<Item> STONE_TORCH = ITEMS.register("stone_torch", |
| 36 | + () -> new VerticallyAttachableBlockItemWithDescription( |
| 37 | + AdornBlocks.STONE_TORCH_GROUND.get(), |
| 38 | + AdornBlocks.STONE_TORCH_WALL.get(), |
| 39 | + new Item.Settings(), |
| 40 | + Direction.DOWN |
| 41 | + )); |
| 42 | + |
| 43 | + public static final Registered<Item> GUIDE_BOOK = ITEMS.register("guide_book", |
| 44 | + () -> new AdornBookItem(AdornCommon.id("guide"), new Item.Settings().rarity(Rarity.UNCOMMON))); |
| 45 | + public static final Registered<Item> TRADERS_MANUAL = ITEMS.register("traders_manual", |
| 46 | + () -> new AdornBookItem(AdornCommon.id("traders_manual"), new Item.Settings())); |
| 47 | + |
| 48 | + public static final Registered<Item> COPPER_NUGGET = ITEMS.register("copper_nugget", () -> new ItemWithDescription(new Item.Settings())); |
| 49 | + public static final Registered<Item> WATERING_CAN = ITEMS.register("watering_can", () -> new WateringCanItem(new Item.Settings())); |
| 50 | + |
| 51 | + private static FoodComponent.Builder drinkFoodComponentBuilder() { |
| 52 | + return new FoodComponent.Builder().hunger(4).saturationModifier(0.3F).alwaysEdible(); |
| 53 | + } |
| 54 | + |
| 55 | + public static void init() { |
| 56 | + } |
| 57 | +} |
0 commit comments