本文整理汇总了Java中net.minecraftforge.registries.GameData类的典型用法代码示例。如果您正苦于以下问题:Java GameData类的具体用法?Java GameData怎么用?Java GameData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameData类属于net.minecraftforge.registries包,在下文中一共展示了GameData类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
@Load(LoaderState.INITIALIZATION)
public void registerRecipe(){
itemSet.forEach(item -> {
if (item.getItem() instanceof IRecipeProvider) {
// check is a provider
IRecipeProvider provider = (IRecipeProvider) item.getItem();
Arrays.stream(provider.createRecipes()).forEach(GameData::register_impl);
} else if (item.getItem() instanceof IRecipe){
// check if is a recipe
registerRecipe(item.getAnnotation().value(), (IRecipe) item.getItem());
}
});
}
开发者ID:MinecraftPangu,项目名称:Pangu,代码行数:14,代码来源:RecipeRegister.java
示例2: init
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
@Override
public final void init(InitPhase phase, ContentHelper helper)
{
if (phase == InitPhase.PRE_INIT)
{
item = createItem();
item.setUnlocalizedName(helper.getModId() + "." + id);
item.setRegistryName(id);
item.setMaxDamage(maxDamage);
initItem();
} else if (phase == InitPhase.REGISTER_ITEMS)
{
ForgeRegistry<Item> registry = RegistryManager.ACTIVE.getRegistry(GameData.ITEMS);
registry.register(item);
} else if (phase == InitPhase.REGISTER_MODELS)
{
registerModels();
} else if (phase == InitPhase.INIT)
{
if (tint != null)
{
if (item.getHasSubtypes())
CustomStuff4.proxy.setItemTint(item, meta -> tint.get(meta).orElse(new ColorImpl(0xffffffff)).getRGB());
else
CustomStuff4.proxy.setItemTint(item, meta -> tint.get(0).orElse(new ColorImpl(0xffffffff)).getRGB());
}
}
}
开发者ID:cubex2,项目名称:customstuff4,代码行数:30,代码来源:ContentItemBase.java
示例3: preInit
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModMetadata meta = event.getModMetadata();
meta.authorList = Arrays.asList(new String[]{"bl4ckscor3"});
meta.autogenerated = false;
meta.description = "Adds a fast way to store XP and share it with your friends!";
meta.modId = MOD_ID;
meta.name = NAME;
meta.version = VERSION;
MinecraftForge.EVENT_BUS.register(new bl4ckscor3.mod.globalxp.handlers.EventHandler());
config = new Config(event.getSuggestedConfigurationFile());
network = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);
network.registerMessage(new SPacketUpdateXPBlock.Handler(), SPacketUpdateXPBlock.class, 0, Side.CLIENT);
network.registerMessage(new CPacketRequestXPBlockUpdate.Handler(), CPacketRequestXPBlockUpdate.class, 1, Side.SERVER);
xp_block = new XPBlock(Material.IRON);
GameData.register_impl(xp_block);
GameData.register_impl(new ItemBlock(xp_block).setRegistryName(xp_block.getRegistryName().toString()));
GameRegistry.registerTileEntity(TileEntityXPBlock.class, xp_block.getRegistryName().toString());
serverProxy.loadModels();
serverProxy.registerRenderers();
}
开发者ID:bl4ckscor3,项目名称:GlobalXP,代码行数:24,代码来源:GlobalXP.java
示例4: addShapedOreRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Adds a shaped recipe that supports string inputparamers corisponding to an oredict entry, can also be used for recipes without ore dict ingredients
*
* @param output The stack that should be produced
*/
public static void addShapedOreRecipe(ItemStack output, Object... params) {
ResourceLocation location = getNameForRecipe(output);
ShapedOreRecipe recipe = new ShapedOreRecipe(location, output, params);
recipe.setRegistryName(location);
GameData.register_impl(recipe);
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:12,代码来源:CraftingRegistry.java
示例5: addShapedRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Adds a basic shaped recipe
*
* @param output The stack that should be produced
*/
public static void addShapedRecipe(ItemStack output, Object... params) {
ResourceLocation location = getNameForRecipe(output);
CraftingHelper.ShapedPrimer primer = CraftingHelper.parseShaped(params);
ShapedRecipes recipe = new ShapedRecipes(output.getItem().getRegistryName().toString(), primer.width, primer.height, primer.input, output);
recipe.setRegistryName(location);
GameData.register_impl(recipe);
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:13,代码来源:CraftingRegistry.java
示例6: addShapelessOreRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Adds a shapeless ore recipe
*
* @param output The stack that should be produced
*/
public static void addShapelessOreRecipe(ItemStack output, Object... input) {
ResourceLocation location = getNameForRecipe(output);
ShapelessOreRecipe recipe = new ShapelessOreRecipe(location, output, input);
recipe.setRegistryName(location);
GameData.register_impl(recipe);
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:12,代码来源:CraftingRegistry.java
示例7: addShapelessRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Adds a basic shapeless recipe
*
* @param output The stack that should be produced
*/
public static void addShapelessRecipe(ItemStack output, Object... input) {
ResourceLocation location = getNameForRecipe(output);
ShapelessRecipes recipe = new ShapelessRecipes(location.getResourceDomain(), output, buildInput(input));
recipe.setRegistryName(location);
GameData.register_impl(recipe);
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:12,代码来源:CraftingRegistry.java
示例8: preInit
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event){
log("Starting to load....");
log("Loading config file....");
log(SecurityCraft.VERSION + " of SecurityCraft is for a post MC-1.6.4 version! Configuration files are useless for setting anything besides options.");
SecurityCraft.configFile = new Configuration(event.getSuggestedConfigurationFile());
SecurityCraft.config.setupConfiguration();
log("Config file loaded.");
log("Setting up network....");
SecurityCraft.network = NetworkRegistry.INSTANCE.newSimpleChannel(SecurityCraft.MODID);
RegistrationHandler.registerPackets(SecurityCraft.network);
log("Network setup.");
log("Loading mod content....");
SetupHandler.setupBlocks();
SetupHandler.setupMines();
SetupHandler.setupItems();
log("Finished loading mod content.");
log("Regisering mod content... (PT 1/2)");
RegistrationHandler.registerContent();
RegistrationHandler.registerTileEntities();
SecurityCraft.serverProxy.registerResourceLocations();
serverProxy.registerTextureFiles();
for(int i = 0; i < SCSounds.values().length; i++)
{
SCSounds.values()[i].event.setRegistryName(SCSounds.values()[i].path);
GameData.register_impl(SCSounds.values()[i].event);
}
ModMetadata modMeta = event.getModMetadata();
modMeta.authorList = Arrays.asList(new String[] {
"Geforce, bl4ckscor3"
});
modMeta.autogenerated = false;
modMeta.credits = "Thanks to all of you guys for your support!";
modMeta.description = "Adds a load of things to keep your house safe with.\nIf you like this mod, hit the green arrow\nin the corner of the forum thread!\nPlease visit the URL above for help. \n \nMessage of the update: \n" + MOTU;
modMeta.url = "http://geforcemods.net";
modMeta.logoFile = "/scLogo.png";
}
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:41,代码来源:SecurityCraft.java
示例9: registerBlock
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Registers a block with a custom ItemBlock
* @param block The Block to register
* @param itemBlock The ItemBlock to register
* @param initPage Wether a SecurityCraft Manual page should be added for the block
*/
private static void registerBlock(Block block, ItemBlock itemBlock, boolean initPage)
{
GameData.register_impl(block);
GameData.register_impl(itemBlock.setRegistryName(block.getRegistryName().toString()));
if(initPage)
if(initPage)
if(block == SCContent.reinforcedStone)
SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), "help.reinforced.info"));
else
SecurityCraft.instance.manualPages.add(new SCManualPage(Item.getItemFromBlock(block), "help." + block.getUnlocalizedName().substring(5) + ".info"));
}
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:19,代码来源:RegistrationHandler.java
示例10: registerItemWithCustomRecipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Registers the given item with GameData.register_implItem(), and adds the help info for the item to the SecurityCraft manual item.
* Also overrides the default recipe that would've been drawn in the manual with a new recipe.
*/
private static void registerItemWithCustomRecipe(Item item, ItemStack... customRecipe)
{
GameData.register_impl(item);
NonNullList<Ingredient> recipeItems = NonNullList.<Ingredient>withSize(customRecipe.length, Ingredient.EMPTY);
for(int i = 0; i < recipeItems.size(); i++)
recipeItems.set(i, Ingredient.fromStacks(customRecipe[i]));
SecurityCraft.instance.manualPages.add(new SCManualPage(item, "help." + item.getUnlocalizedName().substring(5) + ".info", recipeItems));
}
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:16,代码来源:RegistrationHandler.java
示例11: registerItem
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
public static Item registerItem(Item item) {
GameData.register_impl(item);
return item;
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:5,代码来源:ModItems.java
示例12: registerBlock
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
public static Block registerBlock(Block block) {
GameData.register_impl(block);
GameData.register_impl(new ItemBlock(block).setRegistryName(block.getRegistryName()));
return block;
}
开发者ID:Bartz24,项目名称:UsefulNullifiers,代码行数:6,代码来源:ModBlocks.java
示例13: registerBlock
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
public static void registerBlock(Block block){
GameData.register_impl(block.setRegistryName(block.getUnlocalizedName().substring(5)));
GameData.register_impl(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
开发者ID:MineMaarten,项目名称:Signals,代码行数:6,代码来源:ModBlocks.java
示例14: ItemSignals
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
public ItemSignals(String name){
setUnlocalizedName(name);
setRegistryName(name);
GameData.register_impl(this);
setCreativeTab(CreativeTabSignals.getInstance());
}
开发者ID:MineMaarten,项目名称:Signals,代码行数:7,代码来源:ItemSignals.java
示例15: registerItem
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
/**
* Registers the given item with GameData.register_implItem(), and adds the help info for the item to the SecurityCraft manual item.
*/
private static void registerItem(Item item)
{
GameData.register_impl(item);
SecurityCraft.instance.manualPages.add(new SCManualPage(item, "help." + item.getUnlocalizedName().substring(5) + ".info"));
}
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:9,代码来源:RegistrationHandler.java
示例16: recipe
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
public static void recipe()
{
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_iron), new ItemStack(Items.IRON_INGOT), 0.7f); // iron
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_iron), new ItemStack(Items.IRON_INGOT), 0.7f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_iron), new ItemStack(Items.IRON_INGOT), 0.7f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_iron), new ItemStack(Items.IRON_INGOT), 0.7f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_gold), new ItemStack(Items.GOLD_INGOT), 1.0f); // gold
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_gold), new ItemStack(Items.GOLD_INGOT), 1.0f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_gold), new ItemStack(Items.GOLD_INGOT), 1.0f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_gold), new ItemStack(Items.GOLD_INGOT), 1.0f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_tin), new ItemStack(setItems.ingot_tin), 0.55f); // tin
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_tin), new ItemStack(setItems.ingot_tin), 0.55f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_tin), new ItemStack(setItems.ingot_tin), 0.55f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_tin), new ItemStack(setItems.ingot_tin), 0.55f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_copper), new ItemStack(setItems.ingot_copper), 0.4f); // copper
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_copper), new ItemStack(setItems.ingot_copper), 0.4f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_copper), new ItemStack(setItems.ingot_copper), 0.4f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_copper), new ItemStack(setItems.ingot_copper), 0.4f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_silver), new ItemStack(setItems.ingot_silver), 0.85f); // silver
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_silver), new ItemStack(setItems.ingot_silver), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_silver), new ItemStack(setItems.ingot_silver), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_silver), new ItemStack(setItems.ingot_silver), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_lead), new ItemStack(setItems.ingot_lead), 0.85f); // lead
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_lead), new ItemStack(setItems.ingot_lead), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_lead), new ItemStack(setItems.ingot_lead), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_lead), new ItemStack(setItems.ingot_lead), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_nickel), new ItemStack(setItems.ingot_nickel), 0.85f); // nickel
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_nickel), new ItemStack(setItems.ingot_nickel), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_nickel), new ItemStack(setItems.ingot_nickel), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_nickel), new ItemStack(setItems.ingot_nickel), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_platinum), new ItemStack(setItems.ingot_platinum), 0.85f); // platinum
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_platinum), new ItemStack(setItems.ingot_platinum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_platinum), new ItemStack(setItems.ingot_platinum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_platinum), new ItemStack(setItems.ingot_platinum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_aluminum), new ItemStack(setItems.ingot_aluminum), 0.85f); // aluminum
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_aluminum), new ItemStack(setItems.ingot_aluminum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_aluminum), new ItemStack(setItems.ingot_aluminum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_aluminum), new ItemStack(setItems.ingot_aluminum), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_mithril), new ItemStack(setItems.ingot_mithril), 0.85f); // mithril
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_mithril), new ItemStack(setItems.ingot_mithril), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_mithril), new ItemStack(setItems.ingot_mithril), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_mithril), new ItemStack(setItems.ingot_mithril), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_cobalt), new ItemStack(setItems.ingot_cobalt), 0.85f); // cobalt
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_cobalt), new ItemStack(setItems.ingot_cobalt), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_cobalt), new ItemStack(setItems.ingot_cobalt), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_cobalt), new ItemStack(setItems.ingot_cobalt), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_ardite), new ItemStack(setItems.ingot_ardite), 0.85f); // ardite
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_ardite), new ItemStack(setItems.ingot_ardite), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_ardite), new ItemStack(setItems.ingot_ardite), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_ardite), new ItemStack(setItems.ingot_ardite), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.chunk_yellorium), new ItemStack(setItems.ingot_yellorium), 0.85f); // yellorium
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_yellorium), new ItemStack(setItems.ingot_yellorium), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.lump_clean_yellorium), new ItemStack(setItems.ingot_yellorium), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_yellorium), new ItemStack(setItems.ingot_yellorium), 0.85f);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(setItems.dust_flour), new ItemStack(Items.BREAD), 0.85f); // bread
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(Blocks.COBBLESTONE), new Object[]{"xx", "xx", 'x', "rock"}).setRegistryName(Blocks.COBBLESTONE.getRegistryName()));
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(Blocks.TORCH, 4), new Object[]{"y", "x", 'x', "stickWood", 'y', "chunkSulfur"}).setRegistryName(Blocks.TORCH.getRegistryName()));
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(setItems.mortar_and_pestle), new Object[]{" y ", "xzx", " x ", 'z', "cobblestone", 'y', setItems.item_handel, 'x', "stone"}).setRegistryName(setItems.mortar_and_pestle.getRegistryName()));
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(setItems.item_handel, 2), new Object[]{"s s", "lxl", "s s", 's', Items.STRING, 'l', Items.LEATHER, 'x', Items.STICK}).setRegistryName(setItems.item_handel.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(Items.GUNPOWDER, 2), new Object[]{"dustCharcoal", "dustSaltpeter", "dustSaltpeter", "dustSulfur"}).setRegistryName(Items.GUNPOWDER.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(Items.STRING, 4), new Object[]{new ItemStack(Blocks.WOOL)}).setRegistryName(Items.STRING.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(setItems.dust_flour), new Object[]{new ItemStack(setItems.mortar_and_pestle, 1, all), Items.WHEAT}).setRegistryName(setItems.dust_flour.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(setItems.dust_sodium), new Object[]{new ItemStack(setItems.mortar_and_pestle, 1, all), "chunkSaltpeter"}).setRegistryName(setItems.dust_sodium.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(setItems.dust_sulfur), new Object[]{new ItemStack(setItems.mortar_and_pestle, 1, all), "chunkSulfur"}).setRegistryName(setItems.dust_sulfur.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(setItems.dust_charcoal), new Object[]{new ItemStack(setItems.mortar_and_pestle, 1, all), new ItemStack(Items.COAL, 1, 1)}).setRegistryName(setItems.dust_charcoal.getRegistryName()));
GameData.register_impl(new ShapelessOreRecipe(null, new ItemStack(Items.DYE, 5, 15), new Object[]{new ItemStack(setItems.mortar_and_pestle, 1, all), Items.BONE}).setRegistryName(Items.DYE.getRegistryName()));
for(int MT = 0; MT < ItemList[0].length; MT++)
{
Object obj = ItemList[0][MT];
for(int TL = 0; TL < ItemList.length - 1; TL++)
{
Item item = (Item)ItemList[TL + 1][MT];
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(item), new Object[]{patterns[TL], 'x', setItems.item_handel, 'y', obj}).setRegistryName(item.getRegistryName()));
}
}
GameData.register_impl(new ShapedOreRecipe(null, new ItemStack(setItems.item_dynamite, 4), new Object[]{"dsd", "pgp", "pgp", 'd', new ItemStack(Items.DYE, 1, 1), 's', Items.STRING, 'p', Items.PAPER, 'g', Items.GUNPOWDER}).setRegistryName(setItems.item_dynamite.getRegistryName()));
grenade();
}
开发者ID:lukeplechaty,项目名称:Ores-and-Tools,代码行数:79,代码来源:Recipe.java
示例17: grenade
import net.minecraftforge.registries.GameData; //导入依赖的package包/类
protected static void grenade()
{
ResourceLocation group = new ResourceLocation("grenades");
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 1), new Object[]{setItems.item_dynamite, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_0"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 2), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_1"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 3), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_2"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 4), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_3"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 5), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_4"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 6), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_5"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 7), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_6"));
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, 8), new Object[]{setItems.item_dynamite, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_7"));
for(int meta = 1; meta < 30; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 1), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T0_" + meta));
}
for(int meta = 1; meta < 29; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 2), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T1_" + meta));
}
for(int meta = 1; meta < 28; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 3), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T2_" + meta));
}
for(int meta = 1; meta < 27; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 4), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T3_" + meta));
}
for(int meta = 1; meta < 26; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 5), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T4_" + meta));
}
for(int meta = 1; meta < 25; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 6), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T5_" + meta));
}
for(int meta = 1; meta < 24; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 7), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T6_" + meta));
}
for(int meta = 1; meta < 23; meta++)
{
GameData.register_impl(new ShapelessOreRecipe(group, new ItemStack(setItems.item_grenade, 1, meta + 8), new Object[]{new ItemStack(setItems.item_grenade, 1, meta), setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock, setItems.item_rock}).setRegistryName(setItems.item_grenade.getRegistryName() + "_T7_" + meta));
}
}
开发者ID:lukeplechaty,项目名称:Ores-and-Tools,代码行数:45,代码来源:Recipe.java
注:本文中的net.minecraftforge.registries.GameData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论