Skip to content

Commit

Permalink
feat: added spawn eggs for Galacticraft entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Roelymole committed Jan 10, 2025
1 parent 2228bc6 commit 0495bdc
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/generated/assets/galacticraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
"item.galacticraft.aluminum_ingot": "Aluminum Ingot",
"item.galacticraft.aluminum_nugget": "Aluminum Nugget",
"item.galacticraft.ambient_thermal_controller": "Ambient Thermal Controller",
"item.galacticraft.arch_grey_spawn_egg": "Arch Grey Spawn Egg",
"item.galacticraft.astro_miner_schematic": "Astro Miner Schematic",
"item.galacticraft.atmospheric_valve": "Atmospheric Valve",
"item.galacticraft.basic_rocket_body_schematic": "Basic Rocket Body Schematic",
Expand Down Expand Up @@ -392,6 +393,7 @@
"item.galacticraft.cheese_curd": "Cheese Curd",
"item.galacticraft.cheese_slice": "Cheese Slice",
"item.galacticraft.cheeseburger": "Cheeseburger",
"item.galacticraft.comet_cube_spawn_egg": "Comet Cube Spawn Egg",
"item.galacticraft.compressed_aluminum": "Compressed Aluminum",
"item.galacticraft.compressed_bronze": "Compressed Bronze",
"item.galacticraft.compressed_copper": "Compressed Copper",
Expand All @@ -416,12 +418,22 @@
"item.galacticraft.desh_shovel": "Desh Shovel",
"item.galacticraft.desh_stick": "Desh Stick",
"item.galacticraft.desh_sword": "Desh Sword",
"item.galacticraft.evolved_creeper_spawn_egg": "Evolved Creeper Spawn Egg",
"item.galacticraft.evolved_evoker_spawn_egg": "Evolved Evoker Spawn Egg",
"item.galacticraft.evolved_pillager_spawn_egg": "Evolved Pillager Spawn Egg",
"item.galacticraft.evolved_skeleton_boss_spawn_egg": "Evolved Skeleton Boss Spawn Egg",
"item.galacticraft.evolved_skeleton_spawn_egg": "Evolved Skeleton Spawn Egg",
"item.galacticraft.evolved_spider_spawn_egg": "Evolved Spider Spawn Egg",
"item.galacticraft.evolved_vindicator_spawn_egg": "Evolved Vindicator Spawn Egg",
"item.galacticraft.evolved_zombie_spawn_egg": "Evolved Zombie Spawn Egg",
"item.galacticraft.fluid_manipulator": "Fluid Manipulator",
"item.galacticraft.frequency_module": "Frequency Module",
"item.galacticraft.fuel_bucket": "Fuel Bucket",
"item.galacticraft.full_solar_panel": "Full Solar Panel",
"item.galacticraft.gazer_spawn_egg": "Gazer Spawn Egg",
"item.galacticraft.gray_parachute": "Gray Parachute",
"item.galacticraft.green_parachute": "Green Parachute",
"item.galacticraft.grey_spawn_egg": "Grey Spawn Egg",
"item.galacticraft.ground_beef": "Raw Beef Patty",
"item.galacticraft.heavy_duty_axe": "Heavy Duty Axe",
"item.galacticraft.heavy_duty_boots": "Heavy Duty Boots",
Expand Down Expand Up @@ -452,7 +464,9 @@
"item.galacticraft.meteoric_iron_ingot": "Meteoric Iron Ingot",
"item.galacticraft.meteoric_iron_nugget": "Meteoric Iron Nugget",
"item.galacticraft.moon_buggy_schematic": "Moon Buggy Schematic",
"item.galacticraft.moon_villager_spawn_egg": "Moon Villager Spawn Egg",
"item.galacticraft.nose_cone": "Nose Cone",
"item.galacticraft.oli_grub_spawn_egg": "Oli Grub Spawn Egg",
"item.galacticraft.olivine_shard": "Olivine Shard",
"item.galacticraft.orange_parachute": "Orange Parachute",
"item.galacticraft.orion_drive": "Orion Drive",
Expand All @@ -473,6 +487,7 @@
"item.galacticraft.rocket": "Rocket",
"item.galacticraft.rocket_engine": "Rocket Engine",
"item.galacticraft.rocket_fin": "Rocket Fin",
"item.galacticraft.rumbler_spawn_egg": "Rumbler Spawn Egg",
"item.galacticraft.sensor_glasses": "Sensor Glasses",
"item.galacticraft.sensor_lens": "Sensor Lens",
"item.galacticraft.shield_controller": "Shield Controller",
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/dev/galacticraft/mod/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,24 @@ interface Entity {
String EVOLVED_SKELETON_BOSS = "evolved_skeleton_boss";
}

interface SpawnEgg {
String MOON_VILLAGER = "moon_villager_spawn_egg";
String EVOLVED_ZOMBIE = "evolved_zombie_spawn_egg";
String EVOLVED_CREEPER = "evolved_creeper_spawn_egg";
String EVOLVED_SKELETON = "evolved_skeleton_spawn_egg";
String EVOLVED_SPIDER = "evolved_spider_spawn_egg";
String EVOLVED_PILLAGER = "evolved_pillager_spawn_egg";
String EVOLVED_EVOKER = "evolved_evoker_spawn_egg";
String EVOLVED_VINDICATOR = "evolved_vindicator_spawn_egg";
String GREY = "grey_spawn_egg";
String ARCH_GREY = "arch_grey_spawn_egg";
String RUMBLER = "rumbler_spawn_egg";
String OLI_GRUB = "oli_grub_spawn_egg";
String COMET_CUBE = "comet_cube_spawn_egg";
String GAZER = "gazer_spawn_egg";
// String SKELETON_BOSS = "evolved_skeleton_boss_spawn_egg";
}

interface EntityTexture {
String GREY = "textures/entity/grey.png";
String ARCH_GREY = "textures/entity/arch_grey.png";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import dev.galacticraft.mod.storage.PlaceholderItemStorage;
import dev.galacticraft.mod.util.Translations;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
Expand All @@ -40,6 +41,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.ItemStack;

Expand Down Expand Up @@ -490,9 +492,30 @@ public class GCCreativeModeTabs {
output.accept(FUEL_LOADER);
}).build();

public static void registerSpawnEggs() {
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.SPAWN_EGGS).register(content -> {
content.addAfter(ItemStack.EMPTY, MOON_VILLAGER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_ZOMBIE_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_CREEPER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_SKELETON_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_SPIDER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_PILLAGER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_EVOKER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, EVOLVED_VINDICATOR_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, GAZER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, RUMBLER_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, COMET_CUBE_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, OLI_GRUB_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, GREY_SPAWN_EGG);
content.addAfter(ItemStack.EMPTY, ARCH_GREY_SPAWN_EGG);
// content.addAfter(ItemStack.EMPTY, SKELETON_BOSS_SPAWN_EGG);
});
}

public static void register() {
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, Constant.id(Constant.Item.ITEM_GROUP), ITEMS_GROUP);
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, Constant.id(Constant.Block.ITEM_GROUP_BLOCKS), BLOCKS_GROUP);
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, Constant.id(Constant.Block.ITEM_GROUP_MACHINES), MACHINES_GROUP);
registerSpawnEggs();
}
}
37 changes: 37 additions & 0 deletions src/main/java/dev/galacticraft/mod/content/item/GCItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
import dev.galacticraft.api.rocket.RocketPrefabs;
import dev.galacticraft.mod.Constant;
import dev.galacticraft.mod.content.GCBlocks;
import dev.galacticraft.mod.content.GCEntityTypes;
import dev.galacticraft.mod.content.GCFluids;
import dev.galacticraft.mod.content.GCRegistry;
import dev.galacticraft.mod.content.GCRocketParts;
import dev.galacticraft.mod.util.Translations;
import net.fabricmc.fabric.api.item.v1.FabricItem;
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down Expand Up @@ -439,6 +441,23 @@ public class GCItems {
public static final Item TIER_3_ROCKET_SCHEMATIC = new SchematicItem(new Item.Properties());
public static final Item ASTRO_MINER_SCHEMATIC = new SchematicItem(new Item.Properties());

// SPAWN EGGS
public static final Item MOON_VILLAGER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.MOON_VILLAGER, 0x74a3cf, 0xba2500, new Item.Properties());
public static final Item EVOLVED_ZOMBIE_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_ZOMBIE, 0x00afaf, 0x463aa5, new Item.Properties());
public static final Item EVOLVED_CREEPER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_CREEPER, 0x0da70b, 0xa8d0d9, new Item.Properties());
public static final Item EVOLVED_SKELETON_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_SKELETON, 0xc1c1c1, 0xff9600, new Item.Properties());
public static final Item EVOLVED_SPIDER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_SPIDER, 0x342d27, 0x5aff0e, new Item.Properties());
public static final Item EVOLVED_PILLAGER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_PILLAGER, 0x532f36, 0x264747, new Item.Properties());
public static final Item EVOLVED_EVOKER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_EVOKER, 0x1e1c1a, 0xd3cf99, new Item.Properties());
public static final Item EVOLVED_VINDICATOR_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.EVOLVED_VINDICATOR, 0x3f3b37, 0x275e61, new Item.Properties());
public static final Item GAZER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.GAZER, 0xdbdddb, 0x5c5c5c, new Item.Properties());
public static final Item RUMBLER_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.RUMBLER, 0x5c5c5c, 0x36383e, new Item.Properties());
public static final Item COMET_CUBE_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.COMET_CUBE, 0xd5d8d8, 0x92b9fe, new Item.Properties());
public static final Item OLI_GRUB_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.OLI_GRUB, 0xd4dd7e, 0xa4bf63, new Item.Properties());
public static final Item GREY_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.GREY, 0x656463, 0x769e41, new Item.Properties());
public static final Item ARCH_GREY_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.ARCH_GREY, 0x656463, 0x2d8563, new Item.Properties());
// public static final Item SKELETON_BOSS_SPAWN_EGG = new SpawnEggItem(GCEntityTypes.SKELETON_BOSS, 0xc141414, 0x4d72a0, new Item.Properties());

public static Item registerItem(String id, Item item) {
return Registry.register(BuiltInRegistries.ITEM, Constant.id(id), item);
}
Expand Down Expand Up @@ -776,6 +795,24 @@ public static void register() {
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.Item.TIER_3_ROCKET_SCHEMATIC), TIER_3_ROCKET_SCHEMATIC);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.Item.ASTRO_MINER_SCHEMATIC), ASTRO_MINER_SCHEMATIC);

// SPAWN EGGS
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.MOON_VILLAGER), MOON_VILLAGER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_ZOMBIE), EVOLVED_ZOMBIE_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_CREEPER), EVOLVED_CREEPER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_SKELETON), EVOLVED_SKELETON_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_SPIDER), EVOLVED_SPIDER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_PILLAGER), EVOLVED_PILLAGER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_EVOKER), EVOLVED_EVOKER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.EVOLVED_VINDICATOR), EVOLVED_VINDICATOR_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.GAZER), GAZER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.RUMBLER), RUMBLER_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.COMET_CUBE), COMET_CUBE_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.OLI_GRUB), OLI_GRUB_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.GREY), GREY_SPAWN_EGG);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.ARCH_GREY), ARCH_GREY_SPAWN_EGG);
// Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.SpawnEgg.SKELETON_BOSS), SKELETON_BOSS_SPAWN_EGG);


Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.Block.AIR_LOCK_FRAME), AIR_LOCK_FRAME);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.Block.AIR_LOCK_CONTROLLER), AIR_LOCK_CONTROLLER);
Registry.register(BuiltInRegistries.ITEM, Constant.id(Constant.Block.AIR_LOCK_SEAL), AIR_LOCK_SEAL);
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/dev/galacticraft/mod/data/GCTranslationProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,23 @@ protected void generateItemTranslations() {
this.item(GCItems.MOON_BUGGY_SCHEMATIC, "Moon Buggy Schematic");
this.item(GCItems.TIER_3_ROCKET_SCHEMATIC, "Tier 3 Rocket Schematic");
this.item(GCItems.ASTRO_MINER_SCHEMATIC, "Astro Miner Schematic");

// SPAWN EGGS
this.item(GCItems.MOON_VILLAGER_SPAWN_EGG, "Moon Villager Spawn Egg");
this.item(GCItems.EVOLVED_ZOMBIE_SPAWN_EGG, "Evolved Zombie Spawn Egg");
this.item(GCItems.EVOLVED_CREEPER_SPAWN_EGG, "Evolved Creeper Spawn Egg");
this.item(GCItems.EVOLVED_SKELETON_SPAWN_EGG, "Evolved Skeleton Spawn Egg");
this.item(GCItems.EVOLVED_SPIDER_SPAWN_EGG, "Evolved Spider Spawn Egg");
this.item(GCItems.EVOLVED_PILLAGER_SPAWN_EGG, "Evolved Pillager Spawn Egg");
this.item(GCItems.EVOLVED_EVOKER_SPAWN_EGG, "Evolved Evoker Spawn Egg");
this.item(GCItems.EVOLVED_VINDICATOR_SPAWN_EGG, "Evolved Vindicator Spawn Egg");
this.item(GCItems.GAZER_SPAWN_EGG, "Gazer Spawn Egg");
this.item(GCItems.RUMBLER_SPAWN_EGG, "Rumbler Spawn Egg");
this.item(GCItems.COMET_CUBE_SPAWN_EGG, "Comet Cube Spawn Egg");
this.item(GCItems.OLI_GRUB_SPAWN_EGG, "Oli Grub Spawn Egg");
this.item(GCItems.GREY_SPAWN_EGG, "Grey Spawn Egg");
this.item(GCItems.ARCH_GREY_SPAWN_EGG, "Arch Grey Spawn Egg");
// this.item(GCItems.SKELETON_BOSS_SPAWN_EGG, "Evolved Skeleton Boss Spawn Egg");
}

protected void generateGasTranslations() {
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/dev/galacticraft/mod/data/model/GCModelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,23 @@ public void generateItemModels(ItemModelGenerators generator) {
generator.generateFlatItem(GCItems.MOON_BUGGY_SCHEMATIC, ModelTemplates.FLAT_ITEM);
generator.generateFlatItem(GCItems.TIER_3_ROCKET_SCHEMATIC, ModelTemplates.FLAT_ITEM);
generator.generateFlatItem(GCItems.ASTRO_MINER_SCHEMATIC, ModelTemplates.FLAT_ITEM);

// SPAWN EGGS
generator.generateFlatItem(GCItems.MOON_VILLAGER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_ZOMBIE_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_CREEPER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_SKELETON_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_SPIDER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_PILLAGER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_EVOKER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.EVOLVED_VINDICATOR_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.GAZER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.RUMBLER_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.COMET_CUBE_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.OLI_GRUB_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.GREY_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
generator.generateFlatItem(GCItems.ARCH_GREY_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
// generator.generateFlatItem(GCItems.SKELETON_BOSS_SPAWN_EGG, GCModelTemplates.SPAWN_EGG);
}

@Contract("_ -> new")
Expand Down

0 comments on commit 0495bdc

Please sign in to comment.