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


Java Aspect.ORDER属性代码示例

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


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

示例1: preInit

public void preInit() {
	if (Loader.isModLoaded(Name) && Config.thaumcraftActive) {
		isThaumcraftPresent = true;
		aspectTime = new Aspect("tempus", 0xB68CFF, new Aspect[] {
				Aspect.VOID, Aspect.ORDER }, new ResourceLocation(
				CommonProxy.DOMAIN, CommonProxy.TEXTURE
						+ "aspects/tempus.png"), 1);
		MagicBeesAPI.thaumcraftAspectTempus = aspectTime;
	} else {
		// Switch off TC-dependant items.
		ResourceType.LORE_FRAGMENT.setHidden();
		ResourceType.TC_DUST_AIR.setHidden();
		ResourceType.TC_DUST_CHAOS.setHidden();
		ResourceType.TC_DUST_EARTH.setHidden();
		ResourceType.TC_DUST_FIRE.setHidden();
		ResourceType.TC_DUST_ORDER.setHidden();
		ResourceType.TC_DUST_WATER.setHidden();
	}
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:19,代码来源:ThaumcraftHelper.java

示例2: gemerateOre

private void gemerateOre(BlockInfusedBlockOre block, World world, Random random, int chunkX, int chunkZ, int count,
		int chancesToSpawn, int minHeight, int maxHeight) {
	if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
		throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");

	int heightDiff = maxHeight - minHeight + 1;
	for (int i = 0; i < chancesToSpawn; i++) {
		int x = chunkX * 16 + random.nextInt(16);
		int y = minHeight + random.nextInt(heightDiff);
		int z = chunkZ * 16 + random.nextInt(16);

		int md = random.nextInt(6);
		if (random.nextInt(3) == 0) {
			Aspect tag = BiomeHandler.getRandomBiomeTag(world.getBiomeGenForCoords(x, z).biomeID, random);
			if (tag == null) {
				md = random.nextInt(6);
			} else if (tag == Aspect.AIR)
				md = 0;
			else if (tag == Aspect.FIRE)
				md = 1;
			else if (tag == Aspect.WATER)
				md = 2;
			else if (tag == Aspect.EARTH)
				md = 3;
			else if (tag == Aspect.ORDER)
				md = 4;
			else if (tag == Aspect.ENTROPY)
				md = 5;
		}
		new WorldGenMinable(block, md, count, block.getBaseBlock()).generate(world, random, x, y, z);
	}
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:32,代码来源:InfusedOreGeneration.java

示例3: getWeightedRandomAspect

public static Aspect getWeightedRandomAspect(Random rand) {
	Aspect aspectToAdd;
	if (0.685f <= rand.nextFloat()) {
		List<Aspect> aspects = new ArrayList<Aspect>(Aspect.aspects.values());
		aspectToAdd = aspects.get(rand.nextInt(aspects.size()));
	}
	else {
		switch (rand.nextInt(6)) {
		default:
		case 0:
			aspectToAdd = Aspect.EARTH;
			break;
		case 1:
			aspectToAdd = Aspect.WATER;
			break;
		case 2:
			aspectToAdd = Aspect.FIRE;
			break;
		case 3:
			aspectToAdd = Aspect.AIR;
			break;
		case 4:
			aspectToAdd = Aspect.ORDER;
			break;
		case 5:
			aspectToAdd = Aspect.ENTROPY;
			break;
		}
	}
	return aspectToAdd;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:31,代码来源:NodeHelper.java

示例4: tryAuraCoreCreation

private static void tryAuraCoreCreation(ItemStack i, EntityPlayer entityPlayer, World world, int x, int y, int z) {
    if(world.isRemote) return;

    List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)
            .expand(EntityAuraCore.CLUSTER_RANGE, EntityAuraCore.CLUSTER_RANGE, EntityAuraCore.CLUSTER_RANGE));
    Iterator it = items.iterator();
    EntityItem itemAuraCore = null;
    while(itemAuraCore == null && it.hasNext()) {
        Object item = it.next();
        if(item != null && item instanceof EntityItem && !((EntityItem) item).isDead) {
            EntityItem entityItem = (EntityItem) item;
            if(entityItem.getEntityItem() != null && entityItem.getEntityItem().getItem() != null
                    && entityItem.getEntityItem().getItem() instanceof ItemAuraCore && !(item instanceof EntityAuraCore)) {
                if(((ItemAuraCore) entityItem.getEntityItem().getItem()).isBlank(entityItem.getEntityItem())) itemAuraCore = entityItem;
            }
        }
    }

    if(itemAuraCore == null) return;

    int meta = world.getBlockMetadata(x, y, z);
    if(meta <= 6) {
        Aspect[] aspects;
        switch (meta) {
            case 0:
                aspects = new Aspect[]{Aspect.AIR};
                break;
            case 1:
                aspects = new Aspect[]{Aspect.FIRE};
                break;
            case 2:
                aspects = new Aspect[]{Aspect.WATER};
                break;
            case 3:
                aspects = new Aspect[]{Aspect.EARTH};
                break;
            case 4:
                aspects = new Aspect[]{Aspect.ORDER};
                break;
            case 5:
                aspects = new Aspect[]{Aspect.ENTROPY};
                break;
            case 6:
                aspects = new Aspect[]{Aspect.AIR, Aspect.FIRE, Aspect.EARTH, Aspect.WATER, Aspect.ORDER, Aspect.ENTROPY};
                break;
            default:
                return;
        }

        if(!ThaumcraftApiHelper.consumeVisFromWandCrafting(i, entityPlayer, (AspectList)RegisteredRecipes.auraCoreRecipes[meta].get(0), true))
            return;


        PacketStartAnimation packet = new PacketStartAnimation(PacketStartAnimation.ID_BURST, x, y, z);
        PacketHandler.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
        world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, 1.5F, false);
        world.setBlockToAir(x, y, z);

        EntityAuraCore ea =
                new EntityAuraCore(itemAuraCore.worldObj, itemAuraCore.posX, itemAuraCore.posY, itemAuraCore.posZ,
                        itemAuraCore.getEntityItem(), new ChunkCoordinates(x, y, z), aspects);
        ea.age = itemAuraCore.age;
        ea.hoverStart = itemAuraCore.hoverStart;
        ea.motionX = itemAuraCore.motionX;
        ea.motionY = itemAuraCore.motionY;
        ea.motionZ = itemAuraCore.motionZ;
        itemAuraCore.worldObj.spawnEntityInWorld(ea);
        itemAuraCore.setDead();
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:70,代码来源:WandHandler.java


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