本文整理匯總了Java中net.minecraftforge.common.ChestGenHooks.setMin方法的典型用法代碼示例。如果您正苦於以下問題:Java ChestGenHooks.setMin方法的具體用法?Java ChestGenHooks.setMin怎麽用?Java ChestGenHooks.setMin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.common.ChestGenHooks
的用法示例。
在下文中一共展示了ChestGenHooks.setMin方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerInit
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
static void registerInit(@SuppressWarnings("UnusedParameters") FMLInitializationEvent event) {
//TileEntityの登録 =============================================================================================
GameRegistry.registerTileEntity(TileEntityClayCrucible.class, "tileClayCrucible");
GameRegistry.registerTileEntity(TileEntityClayCrucibleHeater.class, "tileClayCrucibleHeater");
//WorldGeneratorの登録 =========================================================================================
GameRegistry.registerWorldGenerator(new OreGenerator(), 2);
//チャンク生成イベントのフック
MinecraftForge.EVENT_BUS.register(new AMMStructureEventHandler());
MapGenStructureIO.registerStructure(StructureTestStart.class, "Test");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest1.class, "Test1");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest2.class, "Test2");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest3.class, "Test3");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest4.class, "Test4");
MapGenStructureIO.registerStructure(StructureTiamatStart.class, "TiamatComet");
MapGenStructureIO.func_143031_a(ComponentTiamatCenter.class, "TiamaitCometCenter");
MapGenStructureIO.func_143031_a(ComponentTiamatCenterLine.class, "TiamatCometCenterLine");
EntityRegistry.registerModEntity(EntityHoeHoeMan.class, "HoeHoeMan", 0, AntiMatterModCore.MOD_ID, 250, 1, false);//中ボスの追加
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
RenderingRegistry.registerEntityRenderingHandler(EntityHoeHoeMan.class, new RenderHoeHoeMan());
}
//村のチェストの中身============================================================================================
//ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(ingot_01,1,1,5,5));
//ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(ingot_01,2,1,5,5));
ChestGenHooks village =ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH);
village.setMax(village.getMax()+10);
village.setMin(village.getMin()+10);
}
示例2: register
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
public void register() {
ChestGenHooks cat = ChestGenHooks.getInfo(category);
cat.setMin(minItems);
cat.setMax(maxItems);
if(entries != null) {
for(LootEntry entry : entries) {
if(entry != null) {
WeightedRandomChestContent content = entry.createContent();
if(content != null) {
cat.addItem(content);
}
}
}
}
}
示例3: bindHooks
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
private static void bindHooks() {
ChestGenHooks hooks = ChestGenHooks.getInfo("Placemod");
for (ResourceLocation itemName : GameData.getItemRegistry().getKeys()) {
Item item = Item.itemRegistry.getObject(itemName);
int maxDmg = item.getMaxDamage();
for (int meta = 0; meta <= maxDmg; ++meta) {
hooks.addItem(new WeightedRandomChestContent(new ItemStack(item, 1, meta), 1, maxChestStackSize, 256 / (1 + maxDmg)));
}
}
hooks.setMin(minChestItems);
hooks.setMax(maxChestItems);
}
示例4: bindHooks
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
private static void bindHooks() {
ChestGenHooks hooks = ChestGenHooks.getInfo("Placemod");
for (Object itemName : GameData.getItemRegistry().getKeys()) {
Item item = (Item) Item.itemRegistry.getObject(itemName);
int maxMeta = item.getMaxDamage();
for (int meta = 0; meta <= maxMeta; ++meta) {
hooks.addItem(new WeightedRandomChestContent(new ItemStack(item, 1, meta), 1, maxChestStackSize, 256 / (maxMeta + 1)));
}
}
hooks.setMin(minChestItems);
hooks.setMax(maxChestItems);
}
示例5: setCategoryStats
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
/**
* Adds all weighted contents to the specified category, setting minimum and
* maximum number of items that can generate in this chest category
*/
public static void setCategoryStats(ChestGenHooks category, int min, int max, WeightedRandomChestContent[] contents) {
category.setMin(min);
category.setMax(max);
for (WeightedRandomChestContent item : contents) {
category.addItem(item);
}
}
示例6: loadFromFile
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
public static void loadFromFile()
{
if (getFile().exists())
{
try
{
NBTTagCompound root = CompressedStreamTools.read(getFile());
//noinspection unchecked
for (NBTTagCompound tag : (Collection<NBTTagCompound>) root.getTags())
{
ChestGenHooks chestGenHooks = ChestGenHooks.getInfo(tag.getName());
chestGenHooks.setMax(tag.getInteger("max"));
chestGenHooks.setMin(tag.getInteger("min"));
getContents(chestGenHooks).clear();
NBTTagList items = tag.getTagList("weightedItemList");
for (int i = 0; i < items.tagCount(); i++)
{
NBTTagCompound contentTag = (NBTTagCompound) items.tagAt(i);
getContents(chestGenHooks).add(new WeightedRandomChestContent(ItemStack.loadItemStackFromNBT(contentTag.getCompoundTag("itemData")), contentTag.getInteger("min"), contentTag.getInteger("max"), contentTag.getInteger("weight")));
}
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
示例7: initLoot
import net.minecraftforge.common.ChestGenHooks; //導入方法依賴的package包/類
static void initLoot() {
if(initDone) {
return;
}
initDone = true;
/*public static final WeightedRandomChestContent[] mineshaftChestContents = new WeightedRandomChestContent[] {
* new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10),
* new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5),
* new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5),
* new WeightedRandomChestContent(Items.dye, 4, 4, 9, 5),
* new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 3),
* new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10),
* new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15),
* new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1),
* new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.rail), 0, 4, 8, 1),
* new WeightedRandomChestContent(Items.melon_seeds, 0, 2, 4, 10),
* new WeightedRandomChestContent(Items.pumpkin_seeds, 0, 2, 4, 10),
* new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3),
* new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1)};*/
// itemStack, MinimumChanceToGenerate, MaximumChanceToGenerate, weight
WeightedRandomChestContent alienBook = new WeightedRandomChestContent(ARItems.alienBook.getItemStack(0), 1, 1, 3);
WeightedRandomChestContent ironIngot = new WeightedRandomChestContent(new ItemStack(Items.iron_ingot, 2), 1, 5, 10);
WeightedRandomChestContent goldIngot = new WeightedRandomChestContent(new ItemStack(Items.gold_ingot, 0), 1, 3, 5);
WeightedRandomChestContent diamond = new WeightedRandomChestContent(new ItemStack(Items.diamond, 0), 1, 3, 5);
WeightedRandomChestContent lithium = new WeightedRandomChestContent(ARItems.lithiumGem.getItemStack(1), 1, 3, 5);
WeightedRandomChestContent coldcrystal = new WeightedRandomChestContent(ARItems.coldCrystal.getItemStack(1), 1, 3, 5);
WeightedRandomChestContent ruby = new WeightedRandomChestContent(ARItems.rubyGem.getItemStack(1), 1, 3, 5);
// try to add some GC stuff
WeightedRandomChestContent deshPick = new WeightedRandomChestContent(new ItemStack(MarsItems.deshPickaxe, 0), 1, 1, 1);
//WeightedRandomChestContent desh = new WeightedRandomChestContent(new ItemStack(MarsItems.deshPickaxe, 0, 2), 1, 1, 1);
WeightedRandomChestContent desh = new WeightedRandomChestContent(new ItemStack(MarsItems.marsItemBasic, 0, 0), 1, 1, 5);
// nanites
WeightedRandomChestContent nanites = new WeightedRandomChestContent(ARItems.naniteCluster.getItemStack(1), 1, 1, 2);
WeightedRandomChestContent pearl = new WeightedRandomChestContent(new ItemStack(Items.ender_pearl), 1, 1, 2);
ChestGenHooks basicLoot = ChestGenHooks.getInfo(LOOT_CATEGORY_BASIC);
basicLoot.setMin(5);
basicLoot.setMax(8);
basicLoot.addItem(LOOT_CATEGORY_BASIC, alienBook);
basicLoot.addItem(LOOT_CATEGORY_BASIC, ironIngot);
basicLoot.addItem(LOOT_CATEGORY_BASIC, goldIngot);
basicLoot.addItem(LOOT_CATEGORY_BASIC, diamond);
basicLoot.addItem(LOOT_CATEGORY_BASIC, nanites);
basicLoot.addItem(LOOT_CATEGORY_BASIC, pearl);
basicLoot.addItem(LOOT_CATEGORY_BASIC, lithium);
basicLoot.addItem(LOOT_CATEGORY_BASIC, coldcrystal);
basicLoot.addItem(LOOT_CATEGORY_BASIC, ruby);
basicLoot.addItem(LOOT_CATEGORY_BASIC, deshPick);
basicLoot.addItem(LOOT_CATEGORY_BASIC, desh);
}