本文整理了Java中net.minecraft.util.math.BlockPos.east()
方法的一些代码示例,展示了BlockPos.east()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockPos.east()
方法的具体详情如下:
包路径:net.minecraft.util.math.BlockPos
类名称:BlockPos
方法名:east
暂无
代码示例来源:origin: Vazkii/Botania
if (!world.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3)
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void executeSFX(boolean isFilling, @Nonnull World world, @Nonnull BlockPos pos) {
if (!isFilling) {
BlockPos eventPos = pos;
if (world.rand.nextBoolean()) {
eventPos = eventPos.south();
}
if (world.rand.nextBoolean()) {
eventPos = eventPos.east();
}
world.playEvent(2002, eventPos, PotionUtils.getPotionColor(PotionTypes.WATER));
}
}
},
代码示例来源:origin: SleepyTrousers/EnderIO
private BlockPos getMasterPosForNewMB(@Nonnull World worldIn, @Nonnull BlockPos swCorner, @Nonnull BlockPos ignorePos) {
BlockPos testPos = swCorner;
for (int i = 0; i < 3; i++) {
testPos = swCorner.offset(EnumFacing.NORTH, i);
for (int j = 0; j < 3; j++) {
if (!testPos.equals(ignorePos) && !isSingle(worldIn, testPos)) {
return null;
}
testPos = testPos.east();
}
}
return swCorner.offset(EnumFacing.NORTH).offset(EnumFacing.EAST);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Deprecated
@Override
public @Nonnull AxisAlignedBB getSelectedBoundingBox(@Nonnull IBlockState bs, @Nonnull World world, @Nonnull BlockPos pos) {
if (bs.getBlock() == this) {
BlockType bt = bs.getValue(BLOCK_TYPE);
if (bt != BlockType.SINGLE) {
BlockPos masterLoc = bt.getLocationOfMaster(pos);
AxisAlignedBB res = new AxisAlignedBB(masterLoc.south().south().west(), masterLoc.north().east().east().up());
return res;
}
}
return super.getSelectedBoundingBox(bs, world, pos);
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
public void generateArchNS(World world, Random rand, BlockPos position) {
int height = 3 + rand.nextInt(1);
int width = 1 + rand.nextInt(2);
for (int sides = 0; sides < height; sides++) {
world.setBlockState(position.up(sides).east(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3);
world.setBlockState(position.up(sides).west(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3);
}
for (int way = -1; way < width; way++) {
world.setBlockState(position.up(height).east(way), ModBlocks.frozenCobblestone.getDefaultState(), 3);
}
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
public void generateArchNS(World world, Random rand, BlockPos position) {
int height = 3 + rand.nextInt(1);
int width = 1 + rand.nextInt(2);
for (int sides = 0; sides < height; sides++) {
world.setBlockState(position.up(sides).east(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3);
world.setBlockState(position.up(sides).west(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3);
}
for (int way = -1; way < width; way++) {
world.setBlockState(position.up(height).east(way), ModBlocks.charedCobblestone.getDefaultState(), 3);
}
}
代码示例来源:origin: Vazkii/Psi
@Nonnull
@Override
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos) {
IBlockState origState = state;
state = state.withProperty(BLOCK_UP, worldIn.getBlockState(pos.up()).equals(origState));
state = state.withProperty(BLOCK_DOWN, worldIn.getBlockState(pos.down()).equals(origState));
state = state.withProperty(BLOCK_NORTH, worldIn.getBlockState(pos.north()).equals(origState));
state = state.withProperty(BLOCK_SOUTH, worldIn.getBlockState(pos.south()).equals(origState));
state = state.withProperty(BLOCK_WEST, worldIn.getBlockState(pos.west()).equals(origState));
state = state.withProperty(BLOCK_EAST, worldIn.getBlockState(pos.east()).equals(origState));
return state;
}
代码示例来源:origin: Vazkii/Quark
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
boolean flag = canConnectTo(worldIn, pos.north());
boolean flag1 = canConnectTo(worldIn, pos.east());
boolean flag2 = canConnectTo(worldIn, pos.south());
boolean flag3 = canConnectTo(worldIn, pos.west());
boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3;
return state.withProperty(UP, Boolean.valueOf(!flag4 || !worldIn.isAirBlock(pos.up()))).withProperty(NORTH, Boolean.valueOf(flag)).withProperty(EAST, Boolean.valueOf(flag1)).withProperty(SOUTH, Boolean.valueOf(flag2)).withProperty(WEST, Boolean.valueOf(flag3));
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public @Nonnull IBlockState getActualState(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) {
EnumFacing.Axis enumfacing$axis = state.getValue(FACING).getAxis();
if (enumfacing$axis == EnumFacing.Axis.Z
&& (worldIn.getBlockState(pos.west()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.east()).getBlock() instanceof BlockWall)
|| enumfacing$axis == EnumFacing.Axis.X
&& (worldIn.getBlockState(pos.north()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.south()).getBlock() instanceof BlockWall)) {
state = state.withProperty(IN_WALL, true);
}
return state;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public List<BlockPos> getPositionsToHarvest(World world, BlockPos pos, IBlockState state) {
List<BlockPos> ret = new ArrayList<>();
addPositionIfGourd(ret, world, pos.north());
addPositionIfGourd(ret, world, pos.west());
addPositionIfGourd(ret, world, pos.south());
addPositionIfGourd(ret, world, pos.east());
return ret;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
protected void breakAroundOnLevel(World world, BlockPos origin, BlockPos center, float maxHardness) {
affectBlock(world, origin, center, maxHardness);
affectBlock(world, origin, center.north(), maxHardness);
affectBlock(world, origin, center.east(), maxHardness);
affectBlock(world, origin, center.west(), maxHardness);
affectBlock(world, origin, center.south(), maxHardness);
affectBlock(world, origin, center.north().east(), maxHardness);
affectBlock(world, origin, center.east().south(), maxHardness);
affectBlock(world, origin, center.south().west(), maxHardness);
affectBlock(world, origin, center.west().north(), maxHardness);
}
代码示例来源:origin: Vazkii/Quark
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
VariedChests.ChestType myType = getCustomType(source, pos);
return getCustomType(source, pos.north()) == myType ? NORTH_CHEST_AABB : getCustomType(source, pos.south()) == myType ? SOUTH_CHEST_AABB : getCustomType(source, pos.west()) == myType ? WEST_CHEST_AABB : getCustomType(source, pos.east()) == myType ? EAST_CHEST_AABB : NOT_CONNECTED_AABB;
}
代码示例来源:origin: vadis365/TheErebus
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
if (source.getBlockState(pos.north()).getBlock() == this) {
return NORTH_CHEST_AABB;
} else if (source.getBlockState(pos.south()).getBlock() == this) {
return SOUTH_CHEST_AABB;
} else if (source.getBlockState(pos.west()).getBlock() == this) {
return WEST_CHEST_AABB;
} else {
return source.getBlockState(pos.east()).getBlock() == this ? EAST_CHEST_AABB : NOT_CONNECTED_AABB;
}
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
return state.withProperty(NORTH, isCoffeeTable(world, pos.north())).withProperty(EAST, isCoffeeTable(world, pos.east())).withProperty(SOUTH, isCoffeeTable(world, pos.south())).withProperty(WEST, isCoffeeTable(world, pos.west()));
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
return state.withProperty(NORTH, isHedge(world, pos.north())).withProperty(EAST, isHedge(world, pos.east())).withProperty(SOUTH, isHedge(world, pos.south())).withProperty(WEST, isHedge(world, pos.west()));
}
代码示例来源:origin: WayofTime/BloodMagic
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
boolean canNorth = this.canConnectTo(worldIn, pos.north());
boolean canEast = this.canConnectTo(worldIn, pos.east());
boolean canSouth = this.canConnectTo(worldIn, pos.south());
boolean canWest = this.canConnectTo(worldIn, pos.west());
boolean flag4 = canNorth && !canEast && canSouth && !canWest || !canNorth && canEast && !canSouth && canWest;
return state.withProperty(UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(NORTH, canNorth).withProperty(EAST, canEast).withProperty(SOUTH, canSouth).withProperty(WEST, canWest);
}
代码示例来源:origin: Ellpeck/ActuallyAdditions
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){
boolean flag = this.canConnectTo(worldIn, pos.north());
boolean flag1 = this.canConnectTo(worldIn, pos.east());
boolean flag2 = this.canConnectTo(worldIn, pos.south());
boolean flag3 = this.canConnectTo(worldIn, pos.west());
boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3;
return state.withProperty(BlockWall.UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, flag).withProperty(BlockWall.EAST, flag1).withProperty(BlockWall.SOUTH, flag2).withProperty(BlockWall.WEST, flag3);
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
boolean forward = world.getBlockState(pos.north()).getBlock() == this;
boolean back = world.getBlockState(pos.south()).getBlock() == this;
boolean left = world.getBlockState(pos.west()).getBlock() == this;
boolean right = world.getBlockState(pos.east()).getBlock() == this;
return state.withProperty(BACK, back).withProperty(FORWARD, forward).withProperty(LEFT, left).withProperty(RIGHT, right);
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
boolean back = world.getBlockState(pos.south()).getBlock() == this;
boolean forward = world.getBlockState(pos.north()).getBlock() == this;
boolean left = world.getBlockState(pos.west()).getBlock() == this;
boolean right = world.getBlockState(pos.east()).getBlock() == this;
return state.withProperty(BACK, back).withProperty(FORWARD, forward).withProperty(LEFT, left).withProperty(RIGHT, right);
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
private boolean incrementClear() {
clearPos = clearPos.east();
if (clearPos.getX() > bb.max.getX()) {
clearPos = new BlockPos(bb.min.getX(), clearPos.getY(), clearPos.getZ());
clearPos = clearPos.south();
if (clearPos.getZ() > bb.max.getZ()) {
clearPos = new BlockPos(bb.min.getX(), clearPos.up().getY(), bb.min.getZ());
return clearPos.getY() <= bb.max.getY();
}
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!