当前位置: 首页>>代码示例>>Java>>正文


Java FishingHooks.addTreasure方法代码示例

本文整理汇总了Java中net.minecraftforge.common.FishingHooks.addTreasure方法的典型用法代码示例。如果您正苦于以下问题:Java FishingHooks.addTreasure方法的具体用法?Java FishingHooks.addTreasure怎么用?Java FishingHooks.addTreasure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.FishingHooks的用法示例。


在下文中一共展示了FishingHooks.addTreasure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addTreasure

import net.minecraftforge.common.FishingHooks; //导入方法依赖的package包/类
@Override
public void addTreasure(WeightedRandomFishable fish) {
    FishingHooks.addTreasure(toNms(fish));
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:FishingInterface.java

示例2: preInit

import net.minecraftforge.common.FishingHooks; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
   	egg = new ItemFatCatEgg().setUnlocalizedName("fatcat_egg");
   	unko = new ItemFatCatUnko().setUnlocalizedName("fatcat_unko");
   	brush = new ItemCatBrush().setUnlocalizedName("fatcat_brush");
   	furball = new ItemFurball().setUnlocalizedName("furball");
   	feather_toy = new ItemFeatherToy().setUnlocalizedName("fatcat_feather_toy");
   	GameRegistry.registerItem(egg, egg.getUnlocalizedName().substring(5));
   	GameRegistry.registerItem(unko, unko.getUnlocalizedName().substring(5));
   	GameRegistry.registerItem(brush, brush.getUnlocalizedName().substring(5));
   	GameRegistry.registerItem(furball, furball.getUnlocalizedName().substring(5));
   	GameRegistry.registerItem(feather_toy, feather_toy.getUnlocalizedName().substring(5));
   	
   	EntityRegistry.registerModEntity(EntityFatCat.class, "FatCat", ++modEntityIndex, this, 64, 10, true);
   	EntityRegistry.registerModEntity(EntityItemUnko.class, "FatCatUnko", ++modEntityIndex, this, 64, 10, true);

   	GameRegistry.addRecipe(
   			new ItemStack(brush, 1),
   			"BT ", "BT ", " T ",
   			'B', Blocks.hay_block, 'T', Items.stick);
   	GameRegistry.addRecipe(
   			new ItemStack(feather_toy, 1),
   			" F ", " F ", " T ",
   			'F', furball, 'T', Items.stick);
   	
   	// Get a fatcat egg via fishing.
   	FishingHooks.addTreasure(new WeightedRandomFishable(new ItemStack(egg), 1));
   	ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 15));
   	ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 15));
   	ChestGenHooks.addItem(ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new ItemStack(egg, 1, 0), 1, 1, 7));
   	
   	Configuration config = new Configuration(event.getSuggestedConfigurationFile());

   	config.load();
   	Property breeding_mode_property = config.get(Configuration.CATEGORY_GENERAL, "BreedingMode", true);
   	breeding_mode_property.comment = "Breeding MODE(true/false): FatCat status is fixed if you disable this option";
   	breeding_mode = breeding_mode_property.getBoolean(true);
   	Property logging_mode_property = config.get(Configuration.CATEGORY_GENERAL, "Logging", false);
   	logging_mode_property.comment = "logging for debug";
   	logging = logging_mode_property.getBoolean(false);
    	Property debug_property = config.get(Configuration.CATEGORY_GENERAL, "Debug", false);
   	debug_property.comment = "debugging mode for development";
   	DEBUG = debug_property.getBoolean(false);
   	config.save();
}
 
开发者ID:shu3,项目名称:FatCatMOD,代码行数:47,代码来源:FatCatMod.java


注:本文中的net.minecraftforge.common.FishingHooks.addTreasure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。