本文整理了Java中net.minecraft.world.World.checkNoEntityCollision()
方法的一些代码示例,展示了World.checkNoEntityCollision()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.checkNoEntityCollision()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:checkNoEntityCollision
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean checkNoEntityCollision(@Nonnull AxisAlignedBB bb) {
return wrapped.checkNoEntityCollision(bb);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean checkNoEntityCollision(@Nonnull AxisAlignedBB bb, @Nullable Entity entityIn) {
return wrapped.checkNoEntityCollision(bb, entityIn);
}
代码示例来源:origin: SleepyTrousers/EnderIO
public static boolean containsLiving(@Nonnull World world, @Nonnull BlockPos pos) {
return !world.checkNoEntityCollision(new AxisAlignedBB(pos));
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public boolean checkNoEntityCollision(AxisAlignedBB bb) {
return getActualWorld().checkNoEntityCollision(bb);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public boolean checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn) {
return getActualWorld().checkNoEntityCollision(bb, entityIn);
}
代码示例来源:origin: SleepyTrousers/EnderIO
private static boolean isClear(@Nonnull World world, @Nonnull Entity entity, double targetX, double targetY, double targetZ) {
double origX = entity.posX, origY = entity.posY, origZ = entity.posZ;
try {
entity.setPosition(targetX, targetY, targetZ);
boolean result = world.checkNoEntityCollision(entity.getEntityBoundingBox(), entity)
&& world.getCollisionBoxes(entity, entity.getEntityBoundingBox()).isEmpty() && !world.containsAnyLiquid(entity.getEntityBoundingBox());
return result;
} finally {
entity.setPosition(origX, origY, origZ);
}
}
代码示例来源:origin: amadornes/MCMultiPart
public static boolean placeAt(ItemStack stack, EntityPlayer player, EnumHand hand, World world, BlockPos pos, EnumFacing facing,
float hitX, float hitY, float hitZ, IBlockPlacementInfo stateProvider, int meta, IMultipart multipartBlock,
IBlockPlacementLogic blockLogic, IPartPlacementLogic partLogic) {
IBlockState state = stateProvider.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, player, hand);
AxisAlignedBB bb = state.getCollisionBoundingBox(world, pos);
if ((bb == null || world.checkNoEntityCollision(bb.offset(pos)))
&& blockLogic.place(stack, player, world, pos, facing, hitX, hitY, hitZ, state)) {
return true;
}
bb = multipartBlock.getCollisionBoundingBox(world, pos, state);
return (bb == null || world.checkNoEntityCollision(bb.offset(pos)))
&& partLogic.placePart(stack, player, hand, world, pos, facing, hitX, hitY, hitZ, multipartBlock, state);
}
代码示例来源:origin: CoFH/ThermalFoundation
@Override
public boolean isNotColliding() {
return this.world.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.world.containsAnyLiquid(this.getEntityBoundingBox());
}
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
public boolean getCanSpawnHere(boolean ignoreEntityCollision, boolean ignoreLight, boolean ignoreDimension) {
if (!ignoreDimension) {
if (EntityRogueAndroid.dimensionWhitelist.size() > 0) {
return EntityRogueAndroid.dimensionWhitelist.contains(world.provider.getDimension()) && inDimensionBlacklist();
}
if (inDimensionBlacklist()) {
return false;
}
}
boolean light = ignoreLight || isValidLightLevel();
boolean entityCollison = ignoreEntityCollision || this.world.checkNoEntityCollision(this.getEntityBoundingBox());
return this.world.getDifficulty() != EnumDifficulty.PEACEFUL && light && entityCollison && this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.world.containsAnyLiquid(this.getEntityBoundingBox());
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
public boolean getCanSpawnHere() {
return this.world.checkNoEntityCollision(this.getEntityBoundingBox()) && this.world.collidesWithAnyBlock(this.getEntityBoundingBox()) && !this.world.containsAnyLiquid(this.getEntityBoundingBox());
}
代码示例来源:origin: SleepyTrousers/EnderIO
public static boolean isSpaceAvailableForSpawn(World worldObj, EntityLiving entity, EntityCreature asCreature, boolean checkEntityCollisions,
boolean canSpawnInLiquid) {
if (asCreature != null && asCreature.getBlockPathWeight(entity.getPosition()) < 0) {
return false;
}
if (checkEntityCollisions && !worldObj.checkNoEntityCollision(entity.getEntityBoundingBox())) {
return false;
}
if (!worldObj.getCollisionBoxes(entity, entity.getEntityBoundingBox()).isEmpty()) {
return false;
}
if (!canSpawnInLiquid && worldObj.containsAnyLiquid(entity.getEntityBoundingBox())) {
return false;
}
return true;
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && getEntityWorld().isMaterialInBB(getEntityBoundingBox(), Material.LAVA);
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
float light = getBrightness();
if (light >= 0F)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox());
return super.getCanSpawnHere();
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
float light = getBrightness();
if (light >= 0F)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox());
return super.getCanSpawnHere();
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
int y = MathHelper.floor(getEntityBoundingBox().minY);
if(y <= ChunkProviderErebus.swampWaterHeight)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && getEntityWorld().isMaterialInBB(getEntityBoundingBox(), Material.WATER);
return false;
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
float light = getBrightness();
if (light >= 0F)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox()) && getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL;
return super.getCanSpawnHere();
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
float light = getBrightness();
if (light >= 0F)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox()) && getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL;
return super.getCanSpawnHere();
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
float light = getBrightness();
if (light >= 0F)
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox()) && getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL;
return super.getCanSpawnHere();
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean getCanSpawnHere() {
return getEntityWorld().checkNoEntityCollision(getEntityBoundingBox()) && getEntityWorld().getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !getEntityWorld().containsAnyLiquid(getEntityBoundingBox()) && getEntityWorld().isAirBlock(getPosition()) && getEntityWorld().getBlockState(getPosition().up()).getBlock() == ModBlocks.GNEISS;
}
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
private boolean tryPlace(EntityPlayer player, ItemStack stack, World world, BlockPos pos) {
IBlockState state = world.getBlockState(pos);
if (state.getBlock() == this.singleSlab) {
AxisAlignedBB collisionBounds = state.getSelectedBoundingBox(world, pos);
if (collisionBounds != Block.NULL_AABB && world.checkNoEntityCollision(collisionBounds.offset(pos)) && world.setBlockState(pos, state, 11)) {
SoundType soundtype = this.doubleSlab.getSoundType();
world.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
stack.shrink(1);;
}
return true;
}
return false;
}
}
内容来源于网络,如有侵权,请联系作者删除!