本文整理汇总了Java中net.minecraft.entity.EntityLiving.SpawnPlacementType类的典型用法代码示例。如果您正苦于以下问题:Java SpawnPlacementType类的具体用法?Java SpawnPlacementType怎么用?Java SpawnPlacementType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpawnPlacementType类属于net.minecraft.entity.EntityLiving包,在下文中一共展示了SpawnPlacementType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSpawnMode
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
private static int getSpawnMode(Chunk chunk, int x, int y, int z) {
World world = chunk.getWorld();
BlockPos pos = new BlockPos(x, y, z);
if (!SpawnerAnimals.canCreatureTypeSpawnAtLocation(SpawnPlacementType.ON_GROUND, world, pos) ||
chunk.getLightFor(EnumSkyBlock.BLOCK, pos) >= 8)
return 0;
c.set(x+0.2, y+0.01, z+0.2, x+0.8, y+1.8, z+0.8);
AxisAlignedBB aabb = c.aabb();
if (!world.checkNoEntityCollision(aabb) ||
!world.getCollidingBoundingBoxes(dummyEntity, aabb).isEmpty() ||
world.isAnyLiquid(aabb))
return 0;
if (chunk.getLightFor(EnumSkyBlock.SKY, pos) >= 8)
return 1;
return 2;
}
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:WorldOverlayRenderer.java
示例2: getSpawnMode
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
private static int getSpawnMode(Chunk chunk, int x, int y, int z) {
World world = chunk.getWorld();
BlockPos pos = new BlockPos(x, y, z);
if (!WorldEntitySpawner.canCreatureTypeSpawnAtLocation(SpawnPlacementType.ON_GROUND, world, pos) || chunk.getLightFor(EnumSkyBlock.BLOCK, pos) >= 8) {
return 0;
}
c.set(x + 0.2, y + 0.01, z + 0.2, x + 0.8, y + 1.8, z + 0.8);
AxisAlignedBB aabb = c.aabb();
if (!world.checkNoEntityCollision(aabb) || !world.getEntitiesWithinAABBExcludingEntity(null, aabb).isEmpty() || world.containsAnyLiquid(aabb)) {
return 0;
}
if (chunk.getLightFor(EnumSkyBlock.SKY, pos) >= 8) {
return 1;
}
return 2;
}
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:19,代码来源:WorldOverlayRenderer.java
示例3: canCreatureTypeSpawnAtLocation
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
/**
* Returns whether or not the specified creature type can spawn at the specified location.
*/
public static boolean canCreatureTypeSpawnAtLocation(EnumCreatureType creatureType, World world, BlockPos pos) {
Block block = world.getBlockState(pos).getBlock();
Block belowblock = world.getBlockState(pos.down(1)).getBlock();
Block aboveblock = world.getBlockState(pos.up(1)).getBlock();
if (creatureType.getCreatureClass() == EntityWaterMob.class) {
return block.getMaterial().isLiquid() && belowblock.getMaterial().isLiquid() && !aboveblock.isNormalCube();
}
boolean spawnBlock = block != null && canCreatureSpawn(belowblock, world, pos.down(1), SpawnPlacementType.ON_GROUND);
//System.out.println("tests: " + spawnBlock);
return spawnBlock && block != Blocks.bedrock &&
!block.isNormalCube() &&
!block.getMaterial().isLiquid() &&
!aboveblock.isNormalCube();
}
开发者ID:tyronx,项目名称:vintagetg,代码行数:24,代码来源:WorldGenAnimals.java
示例4: init
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
public static void init() {
int endermanEggColor1 = new Color(254, 85, 176).getRGB();
int endermanEggColor2 = new Color(97, 230, 150).getRGB();
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "enderman_evolved"), EntityEvolvedEnderman.class, "evolved_enderman", 0, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor2);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "frienderman"), EntityFrienderman.class, "frienderman", 1, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor1);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "friender_pearl"), EntityFrienderPearl.class, "friender_pearl", 2, EndermanEvolution.INSTANCE, 80, 3, true);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "evolved_endermite"), EntityEvolvedEndermite.class, "evolved_endermite", 4, EndermanEvolution.INSTANCE, 80, 3, false, new Color(1, 66, 16).getRGB(), endermanEggColor2);
EntitySpawnPlacementRegistry.setPlacementType(EntityEvolvedEnderman.class, SpawnPlacementType.ON_GROUND);
EntitySpawnPlacementRegistry.setPlacementType(EntityFrienderman.class, SpawnPlacementType.ON_GROUND);
EntityRegistry.addSpawn(EntityEvolvedEnderman.class, ConfigOptions.ENDERMAN_PROBABILITY, 1, ConfigOptions.ENDERMAN_MAX_SPAWN, EnumCreatureType.MONSTER, getBiomeList());
EntityRegistry.addSpawn(EntityFrienderman.class, ConfigOptions.FRIENDERMAN_PROBABILITY, 1, ConfigOptions.FRIENDERMAN_MAX_SPAWN, EnumCreatureType.CREATURE, Biomes.SKY, Biomes.DESERT, Biomes.HELL);
}
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:14,代码来源:ModEntities.java
示例5: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
public static boolean canCreatureSpawn(Block block, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) {
IBlockState state = world.getBlockState(pos);
if (block instanceof BlockSlab) {
return (block.isFullBlock() || state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP);
}
else if (block instanceof BlockStairs) {
return state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
}
return block.isSideSolid(world, pos, EnumFacing.UP);
}
开发者ID:tyronx,项目名称:vintagetg,代码行数:11,代码来源:WorldGenAnimals.java
示例6: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
@Override
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, SpawnPlacementType type) {
return super.canCreatureSpawn(state, world, pos, type);
}
开发者ID:trigg,项目名称:Firma,代码行数:5,代码来源:ClayBlock.java
示例7: init
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
public static void init(){
ResourceLocation pigzombie = addEntity(EntityCrystalPigZombie.class, "crystalpigzombie");
EntityRegistry.registerEgg(pigzombie, /*PINK*/ 15373203, 0x6CE5F8);
EntitySpawnPlacementRegistry.setPlacementType(EntityCrystalPigZombie.class, SpawnPlacementType.ON_GROUND);
ResourceLocation cow = addEntity(EntityCrystalCow.class, "crystalcow");
EntityRegistry.registerEgg(cow, /*BROWN*/ 4470310, 0x6CE5F8);
EntitySpawnPlacementRegistry.setPlacementType(EntityCrystalCow.class, SpawnPlacementType.ON_GROUND);
ResourceLocation enderman = addEntity(EntityCrystalEnderman.class, "crystalenderman");
EntityRegistry.registerEgg(enderman, /*BLACK*/ 0, 0x6CE5F8);
EntitySpawnPlacementRegistry.setPlacementType(EntityCrystalEnderman.class, SpawnPlacementType.ON_GROUND);
addEntity(EntityMinionWorker.class, "minionworker");
addEntity(EntityMinionWarrior.class, "minionwarrior");
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartBlue.class, CrystalChestType.BLUE);
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartRed.class, CrystalChestType.RED);
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartGreen.class, CrystalChestType.GREEN);
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartDark.class, CrystalChestType.DARK);
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartPure.class, CrystalChestType.PURE);
EntityCrystalChestMinecartBase.register(EntityCrystalChestMinecartDarkIron.class, CrystalChestType.DARKIRON);
for(Entry<CrystalChestType, Class<? extends EntityCrystalChestMinecartBase>> entry : EntityCrystalChestMinecartBase.minecarts.entrySet()){
addEntity(entry.getValue(), "minecart_chest_"+entry.getKey().name().toLowerCase(), 64, 1, true);
}
addEntity(EntityBombomb.class, "bombomb");
addEntity(EntityWirelessChestMinecart.class, "minecart_wirelesschest", 64, 1, true);
addEntity(EntityEnderChestMinecart.class, "minecart_enderchest", 64, 1, true);
addEntity(EntityGrapplingHook.class, "grapplinghook", 900, 1, true);
addEntity(EntityCustomFallingBlock.class, "customfallingblock", 160, 20, true);
ResourceLocation angel = addEntity(EntityAngel.class, "pureangel");
EntityRegistry.registerEgg(angel, 0xFFFFFF, 0xFFFF00);
EntitySpawnPlacementRegistry.setPlacementType(EntityAngel.class, SpawnPlacementType.IN_AIR);
ResourceLocation devil = addEntity(EntityDevil.class, "darkdevil");
EntityRegistry.registerEgg(devil, 0, 0xFFFF00);
EntitySpawnPlacementRegistry.setPlacementType(EntityDevil.class, SpawnPlacementType.IN_AIR);
addEntity(EntityDarkarang.class, "darkarang", 160, 20, true);
addEntity(EntityDagger.class, "dagger", 160, 20, true);
ResourceLocation tamedPolarBear = addEntity(EntityTamedPolarBear.class, "polarbear_tamed");
EntityRegistry.registerEgg(tamedPolarBear, 15921906, 9803152);
addEntity(EntityBambooBoat.class, "bambooboat", 80, 3, true);
addEntity(EntityDart.class, "dart", 64, 24, false);
addEntity(EntityCrystalModPainting.class, "crystalmodpainting", 160, Integer.MAX_VALUE, false);
}
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:55,代码来源:ModEntites.java
示例8: canMobSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
protected static boolean canMobSpawn(@Nonnull final BlockPos pos) {
return WorldEntitySpawner.canCreatureTypeSpawnAtLocation(SpawnPlacementType.ON_GROUND, EnvironState.getWorld(),
pos);
}
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:LightLevelHUD.java
示例9: getPlacementType
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
@Override
public SpawnPlacementType getPlacementType()
{
return SpawnPlacementType.ON_GROUND;
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:6,代码来源:ElephantAnimalDef.java
示例10: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
/**
* {@inheritDoc} <br><br>
* Mobs can't spawn on hypermatter.
*/
@Override
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, SpawnPlacementType type)
{
return !this.isHypermatter() && super.canCreatureSpawn(state, world, pos, type);
}
开发者ID:grondag,项目名称:Hard-Science,代码行数:10,代码来源:SuperBlock.java
示例11: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
@Override
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, SpawnPlacementType type)
{
return false;
}
开发者ID:grondag,项目名称:Hard-Science,代码行数:6,代码来源:VirtualBlock.java
示例12: registerEntities
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
private static void registerEntities() {
int modEntityIndex = 0;
// PROJECTILES
EntityRegistry.registerModEntity(EntityArrowBomb.class, "arrow_bomb", ++modEntityIndex, ZSSMain.instance, 64, 20, true);
EntityRegistry.registerModEntity(EntityArrowCustom.class, "arrow_custom", ++modEntityIndex, ZSSMain.instance, 64, 20, true);
EntityRegistry.registerModEntity(EntityArrowElemental.class, "arrow_elemental", ++modEntityIndex, ZSSMain.instance, 64, 20, true);
EntityRegistry.registerModEntity(EntityBomb.class, "bomb", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityBombosFireball.class, "bombos_fireball", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityBoomerang.class, "boomerang", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityCeramicJar.class, "jar", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityCyclone.class, "cyclone", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityHookShot.class, "hookshot", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityLeapingBlow.class, "leaping_blow", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityMagicSpell.class, "magic_spell", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntitySeedShot.class, "seedshot", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntitySwordBeam.class, "sword_beam", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityThrowingRock.class, "rock", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityWhip.class, "whip", ++modEntityIndex, ZSSMain.instance, 64, 10, true);
// NATURALLY SPAWNING MOBS
EntityRegistry.registerModEntity(EntityDarknut.class, "darknut", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntityDarknut.class, "darknut", 0x1E1E1E, 0x8B2500, 0x1E1E1E, 0xFB2500);
EntitySpawnPlacementRegistry.setPlacementType(EntityDarknut.class, SpawnPlacementType.ON_GROUND);
registerEntity(EntityFairy.class, "fairy", ++modEntityIndex, 80, 0xADFF2F, 0xFFFF00);
EntitySpawnPlacementRegistry.setPlacementType(EntityFairy.class, SpawnPlacementType.ON_GROUND);
EntityRegistry.registerModEntity(EntityNavi.class, "navi", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityChu.class, "chu", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntityChu.class, "chu", 0x008000, 0xDC143C, 0x008000, 0x00EE00, 0x008000, 0x3A5FCD, 0x008000, 0xFFFF00);
EntitySpawnPlacementRegistry.setPlacementType(EntityChu.class, SpawnPlacementType.ON_GROUND);
registerEntity(EntityDekuBaba.class, "baba_deku", ++modEntityIndex, 80, 0x33CC33, 0x0000FF);
registerEntity(EntityDekuFire.class, "baba_fire", ++modEntityIndex, 80, 0xFF0000, 0x0000FF);
registerEntity(EntityDekuWithered.class, "baba_withered", ++modEntityIndex, 80, 0x8B5A00, 0x0000FF);
EntityRegistry.registerModEntity(EntityKeese.class, "keese", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntityKeese.class, "keese", 0x000000, 0x555555, 0x000000, 0xFF4500, 0x000000, 0x40E0D0, 0x000000, 0xFFD700, 0x000000, 0x800080);
EntitySpawnPlacementRegistry.setPlacementType(EntityKeese.class, SpawnPlacementType.ON_GROUND);
EntityRegistry.registerModEntity(EntityOctorok.class, "octorok", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntityOctorok.class, "octorok", 0x68228B, 0xBA55D3, 0x68228B, 0xFF00FF);
EntitySpawnPlacementRegistry.setPlacementType(EntityOctorok.class, SpawnPlacementType.IN_WATER);
EntityRegistry.registerModEntity(EntitySkulltula.class, "skulltula", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntitySkulltula.class, "skulltula", 0x080808, 0xFFFF00, 0x080808, 0xE68A00);
EntitySpawnPlacementRegistry.setPlacementType(EntitySkulltula.class, SpawnPlacementType.ON_GROUND);
EntityRegistry.registerModEntity(EntityWizzrobe.class, "wizzrobe", ++modEntityIndex, ZSSMain.instance, 80, 3, true);
CustomEntityList.addMapping(EntityWizzrobe.class, "wizzrobe", 0x8B2500, 0xFF0000, 0x8B2500, 0x00B2EE, 0x8B2500, 0xEEEE00, 0x8B2500, 0x00EE76);
EntitySpawnPlacementRegistry.setPlacementType(EntityWizzrobe.class, SpawnPlacementType.ON_GROUND);
// BOSSES
registerEntity(EntityBlackKnight.class, "darknut_boss", ++modEntityIndex, 80, 0x1E1E1E, 0x000000);
registerEntity(EntityGrandWizzrobe.class, "wizzrobe_grand", ++modEntityIndex, 80, 0x8B2500, 0x1E1E1E);
// NPCS
registerEntity(EntityGoron.class, "goron", ++modEntityIndex, 80, 0xB8860B, 0x8B5A00);
EntitySpawnPlacementRegistry.setPlacementType(EntityGoron.class, SpawnPlacementType.ON_GROUND);
registerEntity(EntityNpcBarnes.class, "npc.barnes", ++modEntityIndex, 80, 0x8B8378, 0xED9121);
registerEntity(EntityNpcMaskTrader.class, "npc.mask_trader", ++modEntityIndex, 80, 0x0000EE, 0x00C957);
registerEntity(EntityNpcOrca.class, "npc.orca", ++modEntityIndex, 80, 0x0000EE, 0x9A32CD);
registerEntity(EntityNpcZelda.class, "npc.zelda", ++modEntityIndex, 80, 0xCC0099, 0xFFFFFF);
}
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:65,代码来源:ZSSEntities.java
示例13: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
@Override
public boolean canCreatureSpawn(IBlockAccess world, BlockPos pos, SpawnPlacementType type) {
return false;
}
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:5,代码来源:BlockDungeonStone.java
示例14: canCreatureSpawn
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
@Override
public boolean canCreatureSpawn(IBlockAccess world, BlockPos pos, SpawnPlacementType type) {
return type == type.ON_GROUND ? false : true;
}
开发者ID:Tyler1555,项目名称:Mini-Bosses,代码行数:5,代码来源:BlockCryptStone.java
示例15: getPlacementType
import net.minecraft.entity.EntityLiving.SpawnPlacementType; //导入依赖的package包/类
public SpawnPlacementType getPlacementType();
开发者ID:Deadrik,项目名称:TFC2,代码行数:2,代码来源:IAnimalDef.java
注:本文中的net.minecraft.entity.EntityLiving.SpawnPlacementType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论