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


Java ChestGenHooks.getItems方法代码示例

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


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

示例1: createBonusChest

import net.minecraftforge.common.ChestGenHooks; //导入方法依赖的package包/类
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:17,代码来源:WorldServer.java

示例2: createBonusChest

import net.minecraftforge.common.ChestGenHooks; //导入方法依赖的package包/类
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:20,代码来源:WorldServer.java

示例3: generateChestContents

import net.minecraftforge.common.ChestGenHooks; //导入方法依赖的package包/类
protected void generateChestContents(final IInventory inventory, final String category, final int count) {
	final List<WeightedRandomChestContent> contents = ChestGenHooks.getItems(category, rand);
	if (contents == null || contents.size() == 0)
		ModLog.warn("Unable to get chest contents: %s", category);
	else
		WeightedRandomChestContent.generateChestContents(rand, contents, inventory, count);
}
 
开发者ID:OreCruncher,项目名称:Restructured,代码行数:8,代码来源:CopyStructureBuilder.java

示例4: createBonusChest

import net.minecraftforge.common.ChestGenHooks; //导入方法依赖的package包/类
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest() {
	WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(
			ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

	for (int i = 0; i < 10; ++i) {
		int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
		int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
		int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

		if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k)) {
			break;
		}
	}
}
 
开发者ID:OreCruncher,项目名称:Jiffy,代码行数:18,代码来源:WorldServer.java

示例5: processCommand

import net.minecraftforge.common.ChestGenHooks; //导入方法依赖的package包/类
@Override
public void processCommand(ICommandSender commandSender, String[] args) {
    if (args.length == 1) {
        if (args[0].equalsIgnoreCase("reload")) {
            ChestLootLoader.restoreCachedLootTable();
            ChestLootLoader.loadFiles(TooMuchLoot.lootFolder);
        } else if (args[0].equalsIgnoreCase("generate")) {
            ChestLootLoader.generateFiles(TooMuchLoot.generatedFolder);
        } else if (args[0].equalsIgnoreCase("reset")) {
            ChestLootLoader.restoreCachedLootTable();
        }
    } else if (args.length == 2) {
        if (args[0].equalsIgnoreCase("generate")) {
            ChestLootLoader.generateFiles(TooMuchLoot.generatedFolder, args[1]);
        }
    } else if (args.length == 5) {
        if (args[0].equalsIgnoreCase("spawnDebugChest")) {
            String tag = args[1];
            EntityPlayerMP entityPlayerMP = getCommandSenderAsPlayer(commandSender);
            Random random = new Random();
            WeightedRandomChestContent[] contents = ChestGenHooks.getItems(tag, random);
            int count = ChestGenHooks.getCount(tag, random);
            int x = (int)Math.floor(func_110666_a(commandSender, entityPlayerMP.posX, args[2]));
            int y = (int)Math.floor(func_110665_a(commandSender, entityPlayerMP.posY, args[3], 0, 0));
            int z = (int)Math.floor(func_110666_a(commandSender, entityPlayerMP.posZ, args[4]));

            if (entityPlayerMP.worldObj.isAirBlock(x, y, z) && World.doesBlockHaveSolidTopSurface(entityPlayerMP.worldObj, x, y - 1, z)) {
                entityPlayerMP.worldObj.setBlock(x, y, z, Blocks.chest, 0, 2);
                TileEntityChest tileEntity = (TileEntityChest) entityPlayerMP.worldObj.getTileEntity(x, y, z);
                if (tileEntity != null) {
                    WeightedRandomChestContent.generateChestContents(random, contents, tileEntity, count);
                }
            }
        }
    }
}
 
开发者ID:dmillerw,项目名称:TooMuchLoot,代码行数:37,代码来源:CommandChestLoot.java


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