private Extraction getExtraction(World world, int x, int y, int z) { Fluid f = null; int c = 0; for (int i = 2; i < 6; i++) { ForgeDirection dir = dirs[i]; int dx = x + dir.offsetX; int dz = z + dir.offsetZ; Fluid f2 = ReikaWorldHelper.getFluid(world, dx, y, dz); if (f2 != null && ReikaWorldHelper.isLiquidSourceBlock(world, dx, y, dz)) { if (f == null || f2 == f) { c++; f = f2; } else { return null; } } } return f != null && c >= 3 ? extractions.get(f) : null; }
@Override public ItemStack onItemRightClick(ItemStack is, World world, EntityPlayer ep) { if (!world.isRemote && this.getWater(is) < CAPACITY) { MovingObjectPosition mov = ReikaPlayerAPI.getLookedAtBlock(ep, 5, true); if (mov != null) { int x = mov.blockX; int y = mov.blockY; int z = mov.blockZ; Block id = world.getBlock(x, y, z); if (id == Blocks.water && ReikaWorldHelper.isLiquidSourceBlock(world, x, y, z)) { this.addWater(is, 1000); world.setBlock(x, y, z, Blocks.air); return is; } } } ep.setItemInUse(is, this.getMaxItemUseDuration(is)); return is; }