-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db8e8e8
commit 3d07114
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/main/java/com/mrcrayfish/goblintraders/init/ModItems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.mrcrayfish.goblintraders.init; | ||
|
||
import com.mrcrayfish.goblintraders.Reference; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.SpawnEggItem; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.registries.IForgeRegistry; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Author: MrCrayfish | ||
*/ | ||
@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) | ||
public class ModItems | ||
{ | ||
private static final List<Item> ITEMS = new ArrayList<>(); | ||
|
||
public static final Item GOBLIN_TRADER_SPAWN_EGG = build(new ResourceLocation(Reference.MOD_ID, "goblin_trader_spawn_egg"), new SpawnEggItem(ModEntities.GOBLIN_TRADER, 0x4da744, 0x316f5d, new Item.Properties().group(ItemGroup.MISC))); | ||
|
||
private static Item build(ResourceLocation id, Item item) | ||
{ | ||
item.setRegistryName(id); | ||
ITEMS.add(item); | ||
return item; | ||
} | ||
|
||
@SubscribeEvent | ||
@SuppressWarnings("unused") | ||
public static void registerTypes(final RegistryEvent.Register<Item> event) | ||
{ | ||
IForgeRegistry<Item> registry = event.getRegistry(); | ||
ITEMS.forEach(registry::register); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"entity.goblintraders.goblin_trader": "Goblin Trader", | ||
"subtitle.goblintraders.goblin_trader.annoyed_grunt": "Annoyed Grunt", | ||
"subtitle.goblintraders.goblin_trader.idle_grunt": "Idle Grunt" | ||
"subtitle.goblintraders.goblin_trader.idle_grunt": "Idle Grunt", | ||
"item.goblintraders.goblin_traders_spawn_egg": "Goblin Trader Spawn Egg" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/goblintraders/models/item/goblin_trader_spawn_egg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "minecraft:item/template_spawn_egg" | ||
} |