use of net.minecraftforge.fluids.BlockFluidBase in project MorePlanets by SteveKunG.
the class WalkNodeProcessorMP method getStart.
@Override
public PathPoint getStart() {
int i;
if (this.getCanSwim() && this.entity.isInWater()) {
i = (int) this.entity.getEntityBoundingBox().minY;
BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos(MathHelper.floor(this.entity.posX), i, MathHelper.floor(this.entity.posZ));
for (Block block = this.blockaccess.getBlockState(mutablePos).getBlock(); block == Blocks.FLOWING_WATER || block == Blocks.WATER || block instanceof BlockFluidBase; block = this.blockaccess.getBlockState(mutablePos).getBlock()) {
++i;
mutablePos.setPos(MathHelper.floor(this.entity.posX), i, MathHelper.floor(this.entity.posZ));
}
} else if (this.entity.onGround) {
i = MathHelper.floor(this.entity.getEntityBoundingBox().minY + 0.5D);
} else {
BlockPos pos;
for (pos = new BlockPos(this.entity); (this.blockaccess.getBlockState(pos).getMaterial() == Material.AIR || this.blockaccess.getBlockState(pos).getBlock().isPassable(this.blockaccess, pos)) && pos.getY() > 0; pos = pos.down()) {
}
i = pos.up().getY();
}
BlockPos blockpos2 = new BlockPos(this.entity);
PathNodeType pathnodetype1 = this.getPathNodeType(this.entity, blockpos2.getX(), i, blockpos2.getZ());
if (this.entity.getPathPriority(pathnodetype1) < 0.0F) {
Set<BlockPos> set = new HashSet<>();
set.add(new BlockPos(this.entity.getEntityBoundingBox().minX, i, this.entity.getEntityBoundingBox().minZ));
set.add(new BlockPos(this.entity.getEntityBoundingBox().minX, i, this.entity.getEntityBoundingBox().maxZ));
set.add(new BlockPos(this.entity.getEntityBoundingBox().maxX, i, this.entity.getEntityBoundingBox().minZ));
set.add(new BlockPos(this.entity.getEntityBoundingBox().maxX, i, this.entity.getEntityBoundingBox().maxZ));
for (BlockPos blockpos1 : set) {
PathNodeType type = this.getPathNodeType(this.entity, blockpos1);
if (this.entity.getPathPriority(type) >= 0.0F) {
return this.openPoint(blockpos1.getX(), blockpos1.getY(), blockpos1.getZ());
}
}
}
return this.openPoint(blockpos2.getX(), i, blockpos2.getZ());
}
use of net.minecraftforge.fluids.BlockFluidBase in project Gaia-Dimension by Andromander.
the class GDFluidBlock method mixFluids.
public void mixFluids(World world, BlockPos pos) {
for (EnumFacing side : EnumFacing.VALUES) {
if (side != EnumFacing.DOWN) {
IBlockState offset = world.getBlockState(pos.offset(side));
if (offset.getMaterial().isLiquid()) {
if ((offset.getMaterial() == Material.LAVA) && (offset.getBlock() != GDBlocks.superhot_magma_block) && (offset.getBlock() instanceof BlockFluidBase || offset.getBlock() instanceof BlockLiquid)) {
world.setBlockState(pos, GDBlocks.gaia_cobblestone.getDefaultState());
this.playSound(world, pos);
break;
}
}
}
}
}
use of net.minecraftforge.fluids.BlockFluidBase in project Gaia-Dimension by Andromander.
the class GDSuperhotMagma method mixFluids.
@Override
public void mixFluids(World world, BlockPos pos) {
for (EnumFacing side : EnumFacing.VALUES) {
if (side != EnumFacing.DOWN) {
IBlockState offset = world.getBlockState(pos.offset(side));
if (offset.getMaterial().isLiquid()) {
if (offset.getBlock() instanceof GDFluidBlock) {
if (offset.getBlock() == GDBlocks.mineral_water_block) {
world.setBlockState(pos, GDBlocks.gaia_stone.getDefaultState());
this.playSound(world, pos);
break;
}
if (offset.getBlock() == GDBlocks.sweet_muck_block) {
world.setBlockState(pos, GDBlocks.primal_mass.getDefaultState());
this.playSound(world, pos);
break;
}
} else if (offset.getBlock() instanceof BlockFluidBase || offset.getBlock() instanceof BlockLiquid) {
if (offset.getMaterial() == Material.WATER) {
world.setBlockState(pos, GDBlocks.gaia_cobblestone.getDefaultState());
this.playSound(world, pos);
break;
}
}
}
}
}
}
Aggregations