本文整理汇总了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));
}
示例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();
}