/* * * * * Copyright (c) 2025 R3944Realms. All rights reserved. * * * * This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. * * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ * * or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. * * * * 本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。 * */ package top.r3944realms.eroticdungeongame.content.register; import net.minecraft.world.item.BedItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import org.jetbrains.annotations.NotNull; import top.r3944realms.eroticdungeongame.EroticDungeon; import top.r3944realms.eroticdungeongame.content.block.CuffBedBlock; import top.r3944realms.eroticdungeongame.datagen.value.ColorContent; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class EDGItems { public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, EroticDungeon.MOD_ID); // 床物品列表 public static final Map> CUFF_BED_ITEMS = new HashMap<>(); // 床物品注册 public static final RegistryObject WHITE_CUFF_BED = registerCuffBedItem(ColorContent.WHITE); public static final RegistryObject ORANGE_CUFF_BED = registerCuffBedItem(ColorContent.ORANGE); public static final RegistryObject MAGENTA_CUFF_BED = registerCuffBedItem(ColorContent.MAGENTA); public static final RegistryObject LIGHT_BLUE_CUFF_BED = registerCuffBedItem(ColorContent.LIGHT_BLUE); public static final RegistryObject YELLOW_CUFF_BED = registerCuffBedItem(ColorContent.YELLOW); public static final RegistryObject LIME_CUFF_BED = registerCuffBedItem(ColorContent.LIME); public static final RegistryObject PINK_CUFF_BED = registerCuffBedItem(ColorContent.PINK); public static final RegistryObject GRAY_CUFF_BED = registerCuffBedItem(ColorContent.GRAY); public static final RegistryObject LIGHT_GRAY_CUFF_BED = registerCuffBedItem(ColorContent.LIGHT_GRAY); public static final RegistryObject CYAN_CUFF_BED = registerCuffBedItem(ColorContent.CYAN); public static final RegistryObject PURPLE_CUFF_BED = registerCuffBedItem(ColorContent.PURPLE); public static final RegistryObject BLUE_CUFF_BED = registerCuffBedItem(ColorContent.BLUE); public static final RegistryObject BROWN_CUFF_BED = registerCuffBedItem(ColorContent.BROWN); public static final RegistryObject GREEN_CUFF_BED = registerCuffBedItem(ColorContent.GREEN); public static final RegistryObject RED_CUFF_BED = registerCuffBedItem(ColorContent.RED); public static final RegistryObject BLACK_CUFF_BED = registerCuffBedItem(ColorContent.BLACK); private static RegistryObject registerCuffBedItem(@NotNull ColorContent color) { String name = color.getName() + "_cuff_bed"; RegistryObject item = ITEMS.register(name, () -> new BlockItem( EDGBlocks.getCuffedBlock(color) ,new Item.Properties() )); CUFF_BED_ITEMS.put(color,item); return item; } public static void register(IEventBus eventBus) { ITEMS.register(eventBus); } }