本文整理汇总了Java中thaumcraft.api.aspects.Aspect.FIRE属性的典型用法代码示例。如果您正苦于以下问题:Java Aspect.FIRE属性的具体用法?Java Aspect.FIRE怎么用?Java Aspect.FIRE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类thaumcraft.api.aspects.Aspect
的用法示例。
在下文中一共展示了Aspect.FIRE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3: 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();
}
}