mirror of
https://github.com/Pridecraft-Studios/joy.git
synced 2025-08-03 06:26:00 -04:00
Add bundles
This commit is contained in:
parent
bfe4e236e8
commit
0b49330a37
@ -73,18 +73,22 @@ public class JoyModelProvider extends FabricModelProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||
itemModelGenerator.register(JoyItems.TOTEM_OF_PRIDE, Models.GENERATED);
|
||||
itemModelGenerator.register(JoyItems.PRIDE_ELYTRA, 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);
|
||||
itemModelGenerator.register(JoyItems.ENBEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
itemModelGenerator.register(JoyItems.TRANS_BEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
itemModelGenerator.register(JoyItems.FROG_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
itemModelGenerator.register(JoyItems.SNIFFER_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
itemModelGenerator.register(JoyItems.TEST_DISC, Models.GENERATED);
|
||||
itemModelGenerator.register(JoyItems.TEST_DISK, Models.GENERATED);
|
||||
public void generateItemModels(ItemModelGenerator gen) {
|
||||
for (final var bundle : JoyItems.BUNDLES) {
|
||||
gen.register(bundle, Models.GENERATED);
|
||||
}
|
||||
|
||||
gen.register(JoyItems.TOTEM_OF_PRIDE, Models.GENERATED);
|
||||
gen.register(JoyItems.PRIDE_ELYTRA, Models.GENERATED);
|
||||
gen.register(JoyItems.PRIDE_BRUSH, Models.GENERATED);
|
||||
gen.register(JoyItems.SOCK_FOX_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
gen.register(JoyItems.BII_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
gen.register(JoyItems.ENBEE_SPAWN_EGG, TEMPLATE_SPAWN_EGG);
|
||||
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());
|
||||
|
@ -96,6 +96,9 @@ public final class JoyItemGroups {
|
||||
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) {
|
||||
return Pivot.INSTANCE.register(RegistryKeys.ITEM_GROUP, name, Pivot.itemGroupBuilder()
|
||||
|
@ -4,13 +4,18 @@ package gay.pridecraft.joy.registry;
|
||||
import gay.pridecraft.joy.JoyUtil;
|
||||
import gay.pridecraft.joy.Pivot;
|
||||
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.BundleItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.SpawnEggItem;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Rarity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class JoyItems {
|
||||
public static final Item PRIDE_ELYTRA = registerItem(
|
||||
"pride_elytra",
|
||||
@ -61,7 +66,7 @@ public final class JoyItems {
|
||||
public static final Item FROG_SPAWN_EGG = registerItem(
|
||||
"frog_spawn_egg",
|
||||
new SpawnEggItem(
|
||||
JoyEntities.FROG, 0xd07444, 0xff80bf, new Item.Settings())
|
||||
JoyEntities.FROG, 0xd07444, 0xff80bf, new Item.Settings())
|
||||
);
|
||||
|
||||
public static final Item SNIFFER_SPAWN_EGG = registerItem(
|
||||
@ -71,9 +76,67 @@ public final class JoyItems {
|
||||
);
|
||||
// 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.
|
||||
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 TEST_DISK = registerItem("test_disk", new Item(new Item.Settings().maxCount(1).rarity(Rarity.RARE).jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, JoyUtil.id("melancolie")))));
|
||||
// region bundles
|
||||
public static final Item
|
||||
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) {
|
||||
return Pivot.INSTANCE.register(RegistryKeys.ITEM, name, item);
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"itemgroup.joy.beds": "Joy Beds",
|
||||
"itemgroup.joy.bundles": "Joy Bundles",
|
||||
"itemgroup.joy.candles": "Joy Candles",
|
||||
"itemgroup.joy.entities": "Joy Entities",
|
||||
"itemgroup.joy.hajs": "Håjs",
|
||||
|
Loading…
x
Reference in New Issue
Block a user