Add bundles

This commit is contained in:
Ampflower 🌺 2025-03-12 01:28:51 -07:00
parent bfe4e236e8
commit 0b49330a37
No known key found for this signature in database
GPG Key ID: FC0397C90D508D7F
4 changed files with 87 additions and 16 deletions

View File

@ -73,18 +73,22 @@ public class JoyModelProvider extends FabricModelProvider {
} }
@Override @Override
public void generateItemModels(ItemModelGenerator itemModelGenerator) { public void generateItemModels(ItemModelGenerator gen) {
itemModelGenerator.register(JoyItems.TOTEM_OF_PRIDE, Models.GENERATED); for (final var bundle : JoyItems.BUNDLES) {
itemModelGenerator.register(JoyItems.PRIDE_ELYTRA, Models.GENERATED); gen.register(bundle, Models.GENERATED);
itemModelGenerator.register(JoyItems.PRIDE_BRUSH, Models.GENERATED); }
itemModelGenerator.register(JoyItems.SOCK_FOX_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
itemModelGenerator.register(JoyItems.BII_SPAWN_EGG, TEMPLATE_SPAWN_EGG); gen.register(JoyItems.TOTEM_OF_PRIDE, Models.GENERATED);
itemModelGenerator.register(JoyItems.ENBEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG); gen.register(JoyItems.PRIDE_ELYTRA, Models.GENERATED);
itemModelGenerator.register(JoyItems.TRANS_BEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG); gen.register(JoyItems.PRIDE_BRUSH, Models.GENERATED);
itemModelGenerator.register(JoyItems.FROG_SPAWN_EGG, TEMPLATE_SPAWN_EGG); gen.register(JoyItems.SOCK_FOX_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
itemModelGenerator.register(JoyItems.SNIFFER_SPAWN_EGG, TEMPLATE_SPAWN_EGG); gen.register(JoyItems.BII_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
itemModelGenerator.register(JoyItems.TEST_DISC, Models.GENERATED); gen.register(JoyItems.ENBEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
itemModelGenerator.register(JoyItems.TEST_DISK, Models.GENERATED); gen.register(JoyItems.TRANS_BEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
gen.register(JoyItems.FROG_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
gen.register(JoyItems.SNIFFER_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
gen.register(JoyItems.DOUGLAS_DISC, Models.GENERATED);
gen.register(JoyItems.MELANCOLIE_DISC, Models.GENERATED);
} }
public static final Model TEMPLATE_SPAWN_EGG = new Model(Optional.of(Identifier.ofVanilla("item/template_spawn_egg")), Optional.empty()); public static final Model TEMPLATE_SPAWN_EGG = new Model(Optional.of(Identifier.ofVanilla("item/template_spawn_egg")), Optional.empty());

View File

@ -96,6 +96,9 @@ public final class JoyItemGroups {
entries.add(JoyItems.PRIDE_ELYTRA); entries.add(JoyItems.PRIDE_ELYTRA);
}); });
public static final ItemGroup JOY_BUNDLES = register("bundles",
JoyItems.PROGRESS_BUNDLE::getDefaultStack,
(ctx, entries) -> JoyItems.BUNDLES.forEach(entries::add));
private static ItemGroup register(String name, Supplier<ItemStack> icon, ItemGroup.EntryCollector collector) { private static ItemGroup register(String name, Supplier<ItemStack> icon, ItemGroup.EntryCollector collector) {
return Pivot.INSTANCE.register(RegistryKeys.ITEM_GROUP, name, Pivot.itemGroupBuilder() return Pivot.INSTANCE.register(RegistryKeys.ITEM_GROUP, name, Pivot.itemGroupBuilder()

View File

@ -4,13 +4,18 @@ package gay.pridecraft.joy.registry;
import gay.pridecraft.joy.JoyUtil; import gay.pridecraft.joy.JoyUtil;
import gay.pridecraft.joy.Pivot; import gay.pridecraft.joy.Pivot;
import gay.pridecraft.joy.item.CustomElytraItem; import gay.pridecraft.joy.item.CustomElytraItem;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.BundleContentsComponent;
import net.minecraft.item.BrushItem; import net.minecraft.item.BrushItem;
import net.minecraft.item.BundleItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.SpawnEggItem; import net.minecraft.item.SpawnEggItem;
import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Rarity; import net.minecraft.util.Rarity;
import java.util.List;
public final class JoyItems { public final class JoyItems {
public static final Item PRIDE_ELYTRA = registerItem( public static final Item PRIDE_ELYTRA = registerItem(
"pride_elytra", "pride_elytra",
@ -61,7 +66,7 @@ public final class JoyItems {
public static final Item FROG_SPAWN_EGG = registerItem( public static final Item FROG_SPAWN_EGG = registerItem(
"frog_spawn_egg", "frog_spawn_egg",
new SpawnEggItem( new SpawnEggItem(
JoyEntities.FROG, 0xd07444, 0xff80bf, new Item.Settings()) JoyEntities.FROG, 0xd07444, 0xff80bf, new Item.Settings())
); );
public static final Item SNIFFER_SPAWN_EGG = registerItem( public static final Item SNIFFER_SPAWN_EGG = registerItem(
@ -71,9 +76,67 @@ public final class JoyItems {
); );
// endregion // endregion
// Test disc item that can be used as template in case someone wants to create one. Note: it's not added to any item group, only obtainable via commands. // region bundles
public static final Item TEST_DISC = registerItem("test_disc", new Item(new Item.Settings().maxCount(1).rarity(Rarity.RARE).jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, JoyUtil.id("douglas"))))); public static final Item
public static final Item TEST_DISK = registerItem("test_disk", new Item(new Item.Settings().maxCount(1).rarity(Rarity.RARE).jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, JoyUtil.id("melancolie"))))); QUEER_BUNDLE = registerBundle("queer_bundle"),
GAY_BUNDLE = registerBundle("gay_bundle"),
ENBY_BUNDLE = registerBundle("enby_bundle"),
INTERSEX_BUNDLE = registerBundle("intersex_bundle"),
AGENDER_BUNDLE = registerBundle("agender_bundle"),
BIGENDER_BUNDLE = registerBundle("bigender_bundle"),
BISEXUAL_BUNDLE = registerBundle("bisexual_bundle"),
MLM_BUNDLE = registerBundle("mlm_bundle"),
ACE_BUNDLE = registerBundle("ace_bundle"),
ARO_BUNDLE = registerBundle("aro_bundle"),
APLATONIC_BUNDLE = registerBundle("aplatonic_bundle"),
GENDER_FLUID_BUNDLE = registerBundle("gender_fluid_bundle"),
PAN_BUNDLE = registerBundle("pan_bundle"),
TRANS_BUNDLE = registerBundle("trans_bundle"),
AROACE_BUNDLE = registerBundle("aroace_bundle"),
LESBIAN_BUNDLE = registerBundle("lesbian_bundle"),
PROGRESS_BUNDLE = registerBundle("progress_bundle");
public static final List<Item> BUNDLES = List.of(
QUEER_BUNDLE,
GAY_BUNDLE,
ENBY_BUNDLE,
INTERSEX_BUNDLE,
AGENDER_BUNDLE,
BIGENDER_BUNDLE,
BISEXUAL_BUNDLE,
MLM_BUNDLE,
ACE_BUNDLE,
ARO_BUNDLE,
APLATONIC_BUNDLE,
GENDER_FLUID_BUNDLE,
PAN_BUNDLE,
TRANS_BUNDLE,
AROACE_BUNDLE,
LESBIAN_BUNDLE,
PROGRESS_BUNDLE
);
private static Item registerBundle(String name) {
return registerItem(name, new BundleItem(new Item.Settings()
.maxCount(1)
.component(DataComponentTypes.BUNDLE_CONTENTS, BundleContentsComponent.DEFAULT)
));
}
// endregion
// Currently inaccessible, only exists to serve as an example.
public static final Item
DOUGLAS_DISC = registerDisc("douglas"),
MELANCOLIE_DISC = registerDisc("melancolie");
private static Item registerDisc(String name) {
return registerItem(name + "_disc", new Item(new Item.Settings()
.maxCount(1)
.rarity(Rarity.RARE)
.jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, JoyUtil.id(name)))
));
}
private static Item registerItem(String name, Item item) { private static Item registerItem(String name, Item item) {
return Pivot.INSTANCE.register(RegistryKeys.ITEM, name, item); return Pivot.INSTANCE.register(RegistryKeys.ITEM, name, item);

View File

@ -1,5 +1,6 @@
{ {
"itemgroup.joy.beds": "Joy Beds", "itemgroup.joy.beds": "Joy Beds",
"itemgroup.joy.bundles": "Joy Bundles",
"itemgroup.joy.candles": "Joy Candles", "itemgroup.joy.candles": "Joy Candles",
"itemgroup.joy.entities": "Joy Entities", "itemgroup.joy.entities": "Joy Entities",
"itemgroup.joy.hajs": "Håjs", "itemgroup.joy.hajs": "Håjs",